Skip to Content

Deploy n8n on Coolify: Self-Hosted Workflow Automation Without the SaaS Bill

Spin up a production-ready n8n instance on Coolify with PostgreSQL, Redis, SSL, and queue mode — unlimited executions, full data control, zero monthly fees.

Why Deploy n8n on Coolify?

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.

Self-hosting n8n removes all of that. You get unlimited executions, full data control, and the ability to run workflows that touch internal APIs, private databases, and sensitive documents without routing anything through a third party.

Coolify makes self-hosting n8n genuinely easy. It's an open-source PaaS that installs on your own VPS, handles SSL certificates automatically, manages Docker deployments through a clean UI, and gives you environment variable management without touching a terminal. This n8n Coolify deployment guide gets you from a blank server to a production-ready automation stack with PostgreSQL, Redis, queue mode, and HTTPS — in one sitting.

If you want to explore other deployment patterns, we have dedicated guides covering the full spectrum: n8n Windows Setup with WSL2, n8n with Docker Compose + Caddy + PostgreSQL + Redis on Ubuntu, and n8n with Docker Compose + Nginx + PostgreSQL on Ubuntu.


Prerequisites

Get these in place before you start. Coolify handles a lot, but it needs a solid foundation.

Server Requirements

  • CPU: 2 cores minimum, 4+ recommended for queue mode with workers
  • RAM: 4 GB minimum for SQLite deployments, 8 GB+ for PostgreSQL + Redis + queue mode
  • Disk: 30 GB SSD minimum, 50 GB+ recommended for production with execution history
  • OS: Ubuntu 22.04 or 24.04 (Coolify's supported platform)

Software

  • A domain name with an A record pointed at your server (Coolify handles subdomains automatically)
  • Ports 22 (SSH), 80, and 443 open in your firewall
  • A server with a clean Ubuntu install — Coolify will install Docker itself

What Coolify Installs For You

Coolify's install script sets up Docker, Traefik (for reverse proxy and SSL), and its own management UI. You don't need to install anything manually beforehand.


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:

  1. Go to your project → Add New Resource → Service
  2. Search "n8n" and select the default template
  3. Set a subdomain (e.g., n8n.yourdomain.com)
  4. 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:

  1. Go to your project → Add New Resource → Service
  2. Search "n8n" and select the PostgreSQL variant
  3. 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:

  1. Go to your project → Add New Resource → Service
  2. Search "n8n" and select the PostgreSQL + Worker variant
  3. 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.


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:

  1. Click Add Workflow
  2. Add a Webhook trigger node
  3. Set it to POST and save
  4. 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.


Step 6 — Troubleshooting and Production Tips

These are the issues you'll actually encounter. Most have straightforward fixes.

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.

Tip: 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 specific version for stability:

# In your Dockerfile or Coolify image field, use a version tag
n8nio/n8n:1.45.0

# Check current versions at:
# https://hub.docker.com/r/n8nio/n8n/tags

Tip: Back Up Your Workflows and Credentials

n8n stores workflows and credentials in PostgreSQL. Back up the database before major updates:

# Export workflows via n8n CLI (from inside the container)
docker exec -it $(docker ps -q -f name=n8n) n8n export:workflow --all --output=/backup/

# Or back up the PostgreSQL database directly
docker exec $(docker ps -q -f name=postgres) pg_dump -U n8n n8n > n8n-backup-$(date +%Y%m%d).sql

Tip: Enable Execution Logging for Debugging

Set these variables to keep execution logs for troubleshooting:

EXECUTIONS_MODE=regular
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true

What You've Built

At the end of this n8n Coolify deployment guide, you have:

  • Coolify running as your self-hosted PaaS with automatic SSL and domain management
  • n8n deployed with PostgreSQL for production-grade data persistence
  • Queue mode with Redis and workers for high-volume, distributed workflow execution
  • HTTPS via Traefik with auto-renewing Let's Encrypt certificates
  • Environment variables correctly configured for webhooks, encryption, and timezone
  • A custom Dockerfile path for extending n8n with additional system packages

This stack handles serious automation workloads. You're not limited by execution counts, you control your data, and you can connect to internal services that no SaaS platform can reach.

For alternative deployment patterns — native Docker Compose with Caddy or Nginx, or a Windows development setup with WSL2 — check our dedicated guides: n8n Windows Setup with WSL2, n8n with Docker Compose + Caddy, and n8n with Docker Compose + Nginx.


Need Enterprise Workflow Automation?

A single-server n8n deployment handles a lot of automation. When you're ready to scale — multi-node worker pools, high-availability PostgreSQL, external secret management, or integration with 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. If you're evaluating self-hosted n8n at scale, we're happy to walk through the options.

Talk to Us About Enterprise n8n Deployment →

See Everything: How to Self-Host Grafana for Production Monitoring
Deploy Grafana on your own server with Docker, wire up Prometheus and Loki, provision dashboards as code, and build a monitoring stack you fully control.