Deployment Automation: Setting Up n8n with Coolify — Step-by-Step Guide

A step-by-step guide to setting up n8n on Coolify: from installation to automatic deployments and GitHub integration.

How to Run n8n on Coolify: Complete Guide

n8n is a powerful automation tool, and Coolify is a self-hosting platform. Together, they create a self-contained automation system without cloud dependencies. This guide covers the setup step by step.

Prerequisites

  • A VPS with Ubuntu 22.04 or 24.04 (minimum 2 GB RAM recommended)
  • A domain pointing to the server
  • Basic familiarity with SSH and the command line

Step 1: Installing Coolify

Connect to your server and run the installation script:

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

The script will install Docker, Docker Compose, and Coolify itself. Once complete, the console will display a URL and password for your first login.

Open Coolify in a browser, set a new password, and you’ll land on the control panel.

Step 2: Preparing the Project

In Coolify, create a new project. Name it, for example, “Automation.” Inside the project, create a “Production” environment.

Step 3: Installing n8n

In the environment, click “Add Resource” → “Service” → select “n8n” from the list of ready-made services.

Coolify will suggest standard n8n settings. Important parameters:

  • PostgreSQL — we recommend using an external database or Coolify’s built-in service for production. SQLite is fine for testing.
  • Domain — specify a subdomain (n8n.yourdomain.com), Coolify will automatically configure SSL.
  • Environment variables — set N8N_ENCRYPTION_KEY (required for production!).
N8N_ENCRYPTION_KEY=your-random-string-here
WEBHOOK_URL=https://n8n.yourdomain.com

Click “Deploy.” In a couple of minutes, n8n will be accessible at the specified domain.

Step 4: Automatic Deployment via GitHub

To store workflow updates in Git and deploy them automatically:

  1. Connect the GitHub integration in Coolify (Settings → Git Providers)
  2. Create a repository for your n8n workflows
  3. Configure Coolify Git deployment for the n8n service
  4. Specify the branch and directory

Now, on push to the main branch, Coolify will automatically restart n8n with the new data.

Step 5: Monitoring

Coolify displays CPU/memory/disk usage for each service. Set up alerts for threshold breaches — n8n can consume significant memory on heavy workflows.

Useful Environment Variables for n8n

# Database
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=secure-password

# Logging
N8N_LOG_LEVEL=info
N8N_LOG_OUTPUT=console

# Timeouts
EXECUTIONS_TIMEOUT=3600
N8N_METRICS=true

Conclusion

n8n + Coolify is a powerful combination for building self-contained automation infrastructure. No cloud subscriptions, full control over your data. Setup takes 20-30 minutes and pays off by eliminating monthly bills.

Official n8n website | Official Coolify website