Skip to Content

n8n Coolify Deployment: Self-Host Workflow Automation Without the DevOps Headache

Deploy n8n on Coolify with PostgreSQL, Redis, and queue mode — get production-ready workflow automation with automatic HTTPS and zero manual server config.

n8n is the most capable open-source workflow automation tool on the market. It connects to 400+ services, handles complex branching logic, and runs custom JavaScript and Python code mid-workflow. The managed n8n cloud is convenient, but it comes with execution limits, per-workflow pricing tiers, and the uncomfortable reality that your automation data lives on someone else's servers. This n8n Coolify deployment guide shows you how to self-host n8n with PostgreSQL, Redis, queue mode, and automatic HTTPS — all managed through Coolify's clean UI without touching a terminal for every config change.

Related reads:

Prerequisites

Before you start, make sure you have:

  • A VPS or dedicated server (Ubuntu 22.04 or 24.04 recommended) with at least 2 CPU cores and 4GB RAM (8GB+ for queue mode)
  • A domain name with an A record pointing to your server's IP
  • Ports 22 (SSH), 80, and 443 open in your firewall
  • A valid email address for Let's Encrypt notifications
  • Basic familiarity with Docker and environment variables

Coolify installs Docker, Traefik, and its own management UI automatically. You don't need to install anything manually beforehand.

What Is Coolify and Why Use It for n8n?

Coolify is an open-source PaaS that installs on your own VPS and handles the infrastructure plumbing you usually configure by hand: SSL certificates, reverse proxying, Docker deployments, environment variable management, and automatic domain routing. Think of it as a self-hosted Heroku or Railway — but you own the servers.

What Coolify Gives You

  • Automatic HTTPS — Traefik terminates TLS with Let's Encrypt certificates. No Certbot, no manual renewal.
  • One-click service templates — n8n, PostgreSQL, Redis, and dozens more deploy from pre-built templates.
  • Environment variable UI — edit secrets and config without SSHing into the server or editing .env files.
  • Git integration — deploy from a Git repo with automatic builds on push.
  • Resource monitoring — CPU, memory, and disk usage per service, visible in the dashboard.
  • Zero-downtime redeploys — update services without dropping active connections.

For n8n specifically, Coolify removes the friction of managing Docker Compose files, certificate renewals, and domain configuration. You focus on building workflows; Coolify handles the infrastructure.

Step 1: Install Coolify on Your Server

Coolify installs with a single command. It sets up Docker, Traefik for SSL termination, and the Coolify management dashboard on port 8000.

Run the Coolify Installer

# SSH into your server as root or a user with sudo
ssh root@your-server-ip

# Run the Coolify installer
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

The script takes 2–3 minutes. It installs Docker, pulls the Coolify images, and starts the services. Once complete, you'll see a URL and default login credentials in the terminal output.

Access the Coolify Dashboard

Navigate to http://your-server-ip:8000 and log in with the credentials shown in the installer output. The first screen will prompt you to create a new project — name it something like automation or n8n-prod.

Connect Your Domain

In Coolify, go to Settings → Domains and add your root domain (e.g., yourdomain.com). Coolify will automatically generate subdomains for each service you deploy. Traefik handles SSL certificates via Let's Encrypt automatically — no manual Certbot needed.

Step 2: Deploy n8n from Coolify's Service Templates

Coolify ships with pre-built service templates for n8n. You get three options depending on your scale and reliability needs.

Option A: n8n with SQLite (Simple, Single-Container)

Best for testing, personal use, or low-volume workflows. Everything runs in one container with an embedded SQLite database.

In Coolify:

  • Go to your project → Add New Resource → Service
  • Search "n8n" and select the default template
  • Set a subdomain (e.g., n8n.yourdomain.com)
  • Click Deploy

Coolify handles the container, SSL, and domain automatically. You'll have a working n8n instance in under 2 minutes.

Option B: n8n with PostgreSQL (Production, No Queue)

For production workloads that need better data persistence and concurrent access, but don't need queue-based execution.

In Coolify:

  • Go to your project → Add New Resource → Service
  • Search "n8n" and select the PostgreSQL variant
  • Set a subdomain and deploy

Coolify automatically creates a PostgreSQL 16 container, configures n8n to use it, and sets up health checks. The database persists across redeploys.

Option C: n8n with PostgreSQL + Redis + Worker (Full Production)

This is the configuration you want for high-volume production use. Queue mode distributes workflow execution across worker processes, preventing the main n8n container from blocking on long-running workflows.

In Coolify:

  • Go to your project → Add New Resource → Service
  • Search "n8n" and select the PostgreSQL + Worker variant
  • Set a subdomain and deploy

This deploys four services: n8n main, n8n worker, PostgreSQL 16, and Redis. The main container handles the UI and webhooks; workers pick up execution jobs from the Redis queue.

Related read: For a manual Docker Compose approach to the same stack, see our Production Guide: Deploy n8n with Docker Compose + Caddy + PostgreSQL + Redis on Ubuntu.

Step 3: Configure Critical Environment Variables

Coolify's templates set sensible defaults, but there are several environment variables you must configure correctly for a production deployment. Go to your n8n service in Coolify → Environment Variables.

Required Variables

# Encryption key for credentials — generate a random 32-char string
N8N_ENCRYPTION_KEY=your-random-32-character-string-here

# The public URL n8n uses for webhooks and OAuth callbacks
# MUST end with a trailing slash
WEBHOOK_URL=https://n8n.yourdomain.com/

# The host and protocol for the editor
N8N_HOST=n8n.yourdomain.com
N8N_PORT=5678
N8N_PROTOCOL=https

# Timezone for scheduled workflows
GENERIC_TIMEZONE=America/New_York
TZ=America/New_York

Critical: WEBHOOK_URL must end with a trailing slash (/). Without it, webhook triggers will generate incorrect URLs and external services won't be able to reach your workflows. This is the #1 cause of broken webhooks in self-hosted n8n.

Queue Mode Variables (PostgreSQL + Worker Only)

# Enable queue mode for distributed execution
EXECUTIONS_MODE=queue

# Redis connection for the job queue
QUEUE_BULL_REDIS_HOST=redis
QUEUE_BULL_REDIS_PORT=6379

# Database config (auto-populated by Coolify template, but verify)
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgresql
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_SCHEMA=public

Security Hardening

# Disable user registration (admin creates accounts manually)
N8N_USER_MANAGEMENT_DISABLED=false

# Require authentication for all workflow operations
N8N_BASIC_AUTH_ACTIVE=false  # Use n8n's built-in auth instead

# Run in production mode
NODE_ENV=production

After setting variables, click Redeploy in Coolify. The container will restart with the new configuration.

Step 4: Verify the Deployment

Once deployment shows as "Running" in Coolify, run through these checks.

Check the Web UI

Navigate to https://n8n.yourdomain.com. You should see the n8n login screen. The first user to sign up becomes the instance owner — create your account immediately.

Verify Webhook URLs Are Correct

Create a simple webhook workflow:

  • Click Add Workflow
  • Add a Webhook trigger node
  • Set it to POST and save
  • The webhook URL displayed should start with https://n8n.yourdomain.com/ — not localhost or an IP address

If the URL is wrong, your WEBHOOK_URL environment variable is misconfigured. Fix it and redeploy.

Test a Workflow Execution

Create a simple workflow with a manual trigger and a Set node. Click Test Workflow — it should execute and show the output. If execution hangs or fails, check the Coolify logs for the n8n service.

Check Coolify Logs

# In Coolify UI: click your n8n service → Logs
# Or from the server:
docker logs $(docker ps -q -f name=n8n) --tail 100 -f

Step 5: Custom Dockerfile for Extended n8n

The default n8n image covers most use cases. If you need custom system packages (ffmpeg for video processing, extra Python libraries, etc.), extend the image with a custom Dockerfile.

Create a Custom Dockerfile

In Coolify, go to your n8n service → Configuration → Build and switch to a custom Dockerfile. Or create a Git repository with this Dockerfile:

FROM n8nio/n8n:latest

# Switch to root for package installation
USER root

# Install custom system packages
RUN apk update && apk add --no-cache \
  ffmpeg \
  wget \
  git \
  bash \
  python3 \
  py3-pip

# Install Python packages if needed for Python code nodes
RUN pip3 install --break-system-packages requests beautifulsoup4

# Set environment variables
ENV N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
ENV N8N_PORT=5678
ENV N8N_PROTOCOL=https
ENV NODE_ENV=production
ENV WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/

# Switch back to n8n's default user
USER node

Point Coolify at this Dockerfile (either via Git integration or by pasting it into the build configuration). Coolify will build and deploy the custom image automatically.

Tips, Gotchas, and Troubleshooting

Problem: Webhooks Return 404 or Don't Trigger

The WEBHOOK_URL environment variable is wrong or missing the trailing slash. This is the most common n8n self-hosting issue.

Fix: Verify WEBHOOK_URL=https://n8n.yourdomain.com/ (with trailing slash) in your environment variables. Redeploy after changing it. Test by creating a new webhook node — the generated URL should match your public domain exactly.

Problem: Queue Mode Not Working (PostgreSQL + Worker)

The worker container can't connect to Redis, or the main n8n container isn't configured to use queue mode.

# Verify all services are running
docker ps | grep -E "n8n|redis|postgres"

# Check Redis is reachable from the n8n container
docker exec -it $(docker ps -q -f name=n8n) nc -zv redis 6379

# Check n8n logs for queue connection errors
docker logs $(docker ps -q -f name=n8n) | grep -i "queue\|redis\|worker"

Common fix: Ensure QUEUE_BULL_REDIS_HOST=redis (the service name, not localhost) and EXECUTIONS_MODE=queue are set on the main n8n container. The worker container needs the same Redis variables.

Problem: Workflows Execute Slowly or Hang

Check if you're running in queue mode without workers, or if the main container is overloaded.

  • In queue mode, verify the worker container is running: docker ps | grep worker
  • Check CPU and memory usage in Coolify's resource monitor
  • Increase server RAM if consistently above 80% usage

Problem: Database Connection Errors After Restart

PostgreSQL data should persist in a Docker volume. If it doesn't, the database reinitialises on every redeploy.

# Verify PostgreSQL has a persistent volume
docker volume ls | grep postgres

# Check the volume is mounted in the PostgreSQL container
docker inspect $(docker ps -q -f name=postgres) | grep -A 5 "Mounts"

Coolify's template should handle this automatically. If not, add a named volume in the service configuration.

Problem: SSL Certificate Not Generated

Traefik (Coolify's reverse proxy) needs port 80 and 443 accessible, and your domain must resolve to the server IP.

# Verify DNS resolution
dig n8n.yourdomain.com +short

# Check Traefik logs for certificate errors
docker logs $(docker ps -q -f name=traefik) | grep -i "cert\|acme\|error"

Ensure your domain's A record points to the server IP and that ports 80/443 aren't blocked by a firewall.

Pro Tips

  • Pin to a specific n8n version — the :latest tag auto-updates on redeploy, which can break workflows if n8n releases a breaking change. Pin to a version like n8nio/n8n:1.45.0 for stability.
  • Back up your workflows and credentials — n8n stores workflows and credentials in PostgreSQL. Back up the database before major updates.
  • Enable execution logging for debugging — set EXECUTIONS_DATA_SAVE_ON_ERROR=all and EXECUTIONS_DATA_SAVE_ON_SUCCESS=all to keep execution logs for troubleshooting.
  • Use Git integration for workflow versioning — Coolify can deploy from a Git repo. Store your custom Dockerfile and environment templates in version control.
  • Monitor resource usage — queue mode with workers consumes more RAM and CPU. Scale your server before adding heavy workloads.
  • Test webhooks immediately after deploy — don't assume they work. Create a test webhook workflow and hit it with curl to confirm end-to-end connectivity.

Wrapping Up

A complete n8n Coolify deployment gives you a self-hosted automation platform that rivals the managed cloud offering — without execution limits, pricing tiers, or data leaving your infrastructure. With Coolify, you get automatic HTTPS, Docker orchestration, and environment management through a clean UI. With n8n's queue mode, you get distributed execution that scales beyond what a single container can handle.

The setup is straightforward: install Coolify, pick the n8n template that matches your scale, configure the critical environment variables, and verify webhooks before building production workflows. From there, extend with custom Docker images, enable execution logging, and back up your PostgreSQL database regularly.

Start with the PostgreSQL + Worker template in this guide, create your first webhook workflow, and confirm end-to-end execution. Once you see external services triggering your self-hosted automations with zero latency and zero SaaS bills, you'll understand why teams are moving their workflow engines off the cloud.

Need Help Scaling n8n in Production?

If you're running n8n at scale — with multi-node worker pools, high-availability PostgreSQL, external secret management, or enterprise identity providers — the architecture gets more involved. The sysbrix team designs and deploys production automation infrastructure for teams who need reliability without the ops overhead.

Talk to Us About Enterprise n8n Deployment →

Nextcloud Docker Setup: Deploy a Self-Hosted Cloud Storage Platform in Under an Hour
Build a production-ready Nextcloud instance with Docker Compose, PostgreSQL, Redis, and HTTPS — your files, your rules, no vendor lock-in.