Skip to Content

n8n Coolify Deployment: Self-Host Workflow Automation in 20 Minutes

Deploy n8n on Coolify with PostgreSQL, SSL, and webhooks that actually work—no DevOps degree required.

n8n Coolify Deployment: Self-Host Workflow Automation in 20 Minutes

Zapier bills scale fast. Make.com has limits. And every time you need a webhook to hit an internal service, you remember why self-hosting matters. n8n gives you unlimited workflow automation with a visual builder. Coolify gives you the platform to deploy it without wrestling with Kubernetes. This guide shows you a production-ready n8n Coolify deployment—from empty server to running workflows with webhooks that actually work.

If you want a quicker overview focused on the why, see n8n Coolify Deployment: Self-Host Workflow Automation Without the DevOps Headache.

What You Will Build

By the end of this guide you will have:

  • n8n running on Coolify with a PostgreSQL backend
  • HTTPS access with auto-renewing certificates
  • Webhook URLs that point to your public domain, not localhost
  • Persistent storage for credentials and workflow data
  • A tested workflow that receives and responds to webhooks

Prerequisites

Before you start, make sure you have:

  • A VPS or dedicated server (Ubuntu 22.04+ recommended) with at least 2 CPU cores, 4 GB RAM, and 30 GB disk
  • Coolify installed and running on your server
  • A domain or subdomain pointed at your server (Coolify handles SSL automatically)
  • Basic familiarity with Docker concepts and environment variables

If Coolify is not installed yet, run the official installer:

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

After installation, access the Coolify dashboard at http://your-server-ip:8000 and complete the onboarding.

Step 1: Create a New Project and Resource

Coolify organizes deployments into projects. Each project contains resources, which are your services.

  1. Log in to your Coolify dashboard
  2. Click Projects in the sidebar, then Add New Project
  3. Name it automation and click Create
  4. Inside the project, click Add New Resource
  5. Search for n8n in the service catalog

Coolify offers three n8n variants. For production, choose n8n with PostgreSQL. SQLite is fine for testing, but PostgreSQL handles concurrency and survives restarts.

Step 2: Configure Environment Variables

Environment variables are where most n8n Coolify deployments go wrong. Get these right and everything else is smooth.

After selecting the n8n with PostgreSQL template, Coolify pre-fills most values. You need to verify and adjust these critical ones:

N8N_HOST=n8n.yourdomain.com
N8N_PORT=5678
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.yourdomain.com/
NODE_ENV=production

The WEBHOOK_URL variable is non-negotiable. Without it, n8n generates webhook URLs like http://localhost:5678/webhook/... which external services cannot reach. With it set, webhooks use your public HTTPS domain.

Generate a secure encryption key for credential storage:

openssl rand -base64 32

Copy the output and set it as:

N8N_ENCRYPTION_KEY=your-generated-key-here

This key encrypts saved credentials. Lose it and you lose access to every connected service.

Step 3: Configure Domains and SSL

Coolify handles SSL automatically via Let's Encrypt, but you need to tell it which domain to use.

  1. In the resource settings, go to the Domains tab
  2. Add your subdomain: n8n.yourdomain.com
  3. Ensure the DNS A record points to your server IP
  4. Toggle HTTPS to enabled

Coolify will request a certificate on first deploy. If DNS is not propagated yet, the cert request fails. Verify with:

dig n8n.yourdomain.com +short

Once the domain resolves to your server, click Deploy in Coolify.

Step 4: Deploy and Verify

Click the Deploy button and wait. Coolify pulls the n8n image, starts PostgreSQL, runs migrations, and brings up the web interface.

Monitor the deployment logs for errors:

# In Coolify, click the resource → Logs
# Or from the server shell:
docker logs -f n8n-container-name

When the status shows Running, open https://n8n.yourdomain.com in a browser. You should see the n8n setup screen asking you to create an owner account.

Complete the setup:

  1. Enter your email and a strong password
  2. Skip the telemetry prompt if you prefer
  3. You land on the n8n canvas

Step 5: Build and Test Your First Webhook Workflow

The real test of any n8n Coolify deployment is whether webhooks work. Let us build a simple workflow that proves it.

Create the Workflow

  1. Click Add Workflow in n8n
  2. Drag a Webhook node onto the canvas
  3. Set the method to POST
  4. Save the workflow (webhooks only activate after saving)

Copy the webhook URL. It should look like:

https://n8n.yourdomain.com/webhook/test/my-workflow

If it shows localhost instead of your domain, stop. Go back to Step 2 and fix the WEBHOOK_URL environment variable, then redeploy.

Test the Webhook

From your local machine, send a test payload:

curl -X POST https://n8n.yourdomain.com/webhook/test/my-workflow \
  -H "Content-Type: application/json" \
  -d '{"event": "test", "source": "cli"}'

In n8n, click Execute Workflow and watch the webhook node light up with your payload. If you see the data, your n8n Coolify deployment is fully functional.

For a deeper look at production hardening and scaling patterns, read Deploy n8n on Coolify: Self-Hosted Workflow Automation Without the SaaS Bill.

Step 6: Add Persistent Storage and Backups

By default, n8n stores workflows and credentials in PostgreSQL, which Coolify already persists. But if you upload files or use the binary data feature, you need a volume for local storage.

Mount a Persistent Volume

In Coolify, go to your n8n resource settings and add a persistent storage mount:

Host path: /var/lib/coolify/volumes/n8n-data
Container path: /home/node/.n8n

This ensures your .n8n directory—including config and local files—survives container restarts and redeploys.

Back Up PostgreSQL

Set up a cron job on your host to dump the database daily:

0 3 * * * docker exec n8n-postgres-container pg_dump -U n8n n8n > /backups/n8n-$(date +\%Y\%m\%d).sql

Store these backups off-server. Workflows represent hours of logic. Losing them hurts.

If you are also running n8n on Windows for local development, our n8n Windows Setup WSL2 Guide covers the full local stack with webhook tunneling.

Tips and Troubleshooting

Webhook URLs show localhost:5678

  • This is the most common n8n Coolify deployment issue. The WEBHOOK_URL environment variable is either missing, misformatted, or not applied
  • Ensure it includes the trailing slash: https://n8n.yourdomain.com/
  • Redeploy after changing environment variables. A simple restart may not pick them up

SSL certificate fails to provision

  • Verify DNS propagation with dig or nslookup
  • Ensure port 80 is open for the HTTP-01 challenge. Coolify handles this, but firewalls can block it
  • If you use Cloudflare, disable the orange cloud (proxy) until the certificate is issued

Workflow executions hang or timeout

  • Check your server's CPU and memory usage. n8n can spike during heavy workflows
  • Scale up your VPS if needed, or enable queue mode with Redis for distributed execution

Cannot connect to external APIs from workflows

  • Some APIs block VPS IP ranges. Use a residential proxy or whitelist your server IP
  • Check that outbound port 443 is not blocked by your hosting provider

Credentials disappear after redeploy

  • Ensure N8N_ENCRYPTION_KEY is set and consistent across redeploys
  • Without this key, n8n cannot decrypt saved credentials and treats them as invalid

High memory usage or OOM kills

  • n8n's default execution mode runs everything in the main process. For heavy loads, switch to queue mode by adding Redis and worker containers
  • Coolify's n8n with PostgreSQL and Worker template sets this up automatically

Next Steps

You now have a working n8n Coolify deployment with HTTPS, PostgreSQL, persistent storage, and verified webhooks. That is a solid foundation. From here, consider:

  • Connecting n8n to your self-hosted services— databases, APIs, and message queues
  • Setting up error workflows that notify you when automations fail
  • Using the n8n CLI to version-control workflows in Git
  • Enabling queue mode with Redis for high-volume parallel execution
  • Building custom nodes for internal APIs that do not have official integrations

Automation is not about replacing work. It is about removing the repetitive parts so you can focus on the ones that matter.

Need Help Scaling This?

If you are running production workloads and need queue-based execution, custom nodes, multi-environment pipelines, or migration from Zapier / Make, we can help. Contact the Sysbrix team and we will build an automation stack that fits your workflow.

Keycloak Docker Setup Guide: Self-Hosted SSO Without the Headaches
Deploy Keycloak with Docker, connect your first app, and stop managing passwords in spreadsheets.