Skip to content
SelfHostBR, home page
Guide

How to install n8n with Coolify on your VPS

Install Coolify with a pre-created admin, add n8n with PostgreSQL from the service catalog, set up a domain with HTTPS and fix the errors you will hit.

MMarlon Published on · updated 7 min read
On this page

Short answer: install Coolify with the official script as root, passing ROOT_USERNAME, ROOT_USER_EMAIL and ROOT_USER_PASSWORD so the sign-up page is never left open. In the dashboard, pick This machine as the server, create a project and, under New Resource, search for “n8n” and choose N8N With Postgresql. Before the first deploy, change the n8n and runners image tags to the current stable release, because the catalog ships an old one. Then set the domain to https:// with port 5678.

Coolify is an open-source, Heroku/Vercel-style dashboard that runs on your own VPS. It uses Docker underneath, puts a Traefik proxy in front for domains and HTTPS, and has a catalog of ready-made services, n8n included. If you prefer a leaner panel, see n8n with Easypanel. If you would rather manage the compose file yourself, see n8n with Docker Compose. Coolify is the better fit when you want a dashboard for domains, backups and updates. Coolify itself runs on Docker; if your server can’t run Docker at all, see how to install n8n with Node.js, without Docker.

Some links on this page are affiliate links: if you sign up through them I may earn a commission, at no extra cost to you.

Contabo Black Friday · November 23–30

VPS Plus 2: 2 vCPU, 4 GB of RAM and 75 GB NVMe

From €7.20/month (excl. VAT) with a 24-month term. It is the entry plan of Contabo’s Performance VPS line and is on sale until Monday, November 30. 4 GB is the size the calculator suggests for n8n with PostgreSQL under moderate use.

Before you start

  • Machine: the Coolify documentation asks for at least 2 CPU cores, 2 GB of RAM and 10 GB of free disk. With n8n running, the whole stack sits near 1 GB of RAM: Coolify around 460 MB, n8n around 340 MB, and Traefik, Redis and the two PostgreSQL databases about 150 MB together. A 4 GB VPS leaves plenty of room.
  • Disk: the Coolify, Traefik and n8n-with-PostgreSQL images add up to about 5 GB.
  • Operating system: Debian, Ubuntu LTS, Alpine, Fedora, Rocky, Arch and others are on the supported list. Use a clean VPS with nothing listening on ports 80 and 443.
  • Ports: 22 (SSH), 80 and 443 (Traefik), 8000 (dashboard), and 6001 and 6002 (real-time updates and terminal for the dashboard). The firewall page lists them all.

Install Coolify without leaving sign-up open

Right after installation, Coolify serves a registration page, and whoever gets there first becomes the administrator, with root access to the server. To avoid that, pass the admin account in the install command. Log in as root (sudo -i) and run:

env ROOT_USERNAME=your-username \
ROOT_USER_EMAIL=you@yourdomain.com \
ROOT_USER_PASSWORD='StrongPassword123!' \
bash -c 'curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash'

The password needs 8 or more characters with an uppercase letter, a lowercase letter, a number and a symbol. The email must have a valid domain. On Alpine, bash is not part of the default install, so run apk add bash curl first.

The script installs Docker if it is missing, configures the daemon, pulls the images, generates an SSH key and starts Coolify. It takes about a minute and ends with “Coolify is ready!” and the dashboard addresses, in the form http://YOUR-VPS-IP:8000.

Run it as root, not with sudo -E. With sudo -E, the HOME variable still points to your regular user, so the script writes Coolify's public key to your user's authorized_keys instead of root's. The symptom shows up on first login: the dashboard says "Server is not reachable" with root@host.docker.internal: Permission denied (publickey).

If you already hit this, copy the key to root and click Check Again:

sudo sh -c 'ssh-keygen -y -f "$(ls /data/coolify/ssh/keys/ssh_key@* | grep -v lock)" \
  >> /root/.ssh/authorized_keys'

Keep a copy of /data/coolify/source/.env off the server, in a password manager for example. It holds the APP_KEY, which encrypts Coolify’s data, and you need it to restore a backup.

First login

  1. Open http://YOUR-VPS-IP:8000 and sign in with the email and password from the command.
  2. On the Welcome to Coolify screen, click Continue. If the dashboard opens straight to Dashboard, the wizard is at http://YOUR-VPS-IP:8000/onboarding.
  3. Under Choose Server Type, pick This machine. Coolify connects to the server itself over SSH and validates Docker.
  4. Under Project Setup, click Create “My First Project”. It comes with a production environment.
  5. On the Setup complete screen, click Go to dashboard.

Then open Servers → localhost. If the proxy shows as Exited, click Start Proxy at the top of the page. Without it, no domain works.

Create n8n from the catalog

  1. Under Projects, open the project and the production environment.
  2. Click New Resource and, in Search resources, type n8n.
  3. Three options appear: N8N (SQLite), N8N With Postgresql and N8N With Postgres And Worker (queue mode with a worker). For most setups, choose N8N With Postgresql and click Deploy on the card.

The card only creates the service, still stopped, with three containers: n8n, the Task Runners (which run the code nodes) and PostgreSQL 16. The database user and password are generated for you, and the data lives in Docker volumes. The Coolify page for n8n describes the three variants.

Before starting it, change two things on the service page:

  1. Under Service configuration, fill in PostgreSQL · Database Name with n8n. With that field empty, Coolify refuses to save any change and shows “The Database Name field is required”.
  2. Click Edit Compose File. The catalog template pins an old n8n release, below the minimum safe n8n version. Change the tag of both n8nio/n8n and n8nio/runners to the current stable release, the same on both (2.45.7, for example). The runners image has to match the n8n version, as the task runners documentation says. While you are there, replace UTC with your time zone (for example America/New_York) on the GENERIC_TIMEZONE and TZ lines, or schedules run on UTC. Click Save Changes.

Check the Compose resources list to confirm the images show the new version. Then click Deploy at the top and wait for all three containers to show Running (healthy), which takes about two minutes.

Why PostgreSQL: with a real number of executions, SQLite becomes the bottleneck, as explained in n8n with PostgreSQL. If you expect to need several workers, pick the worker variant from the start and read queue mode with Redis first.

Domain and HTTPS

Coolify generates a temporary domain like http://n8n-xxxx.IP.sslip.io. That address is plain HTTP, and n8n blocks access with the message “Your n8n server is configured to use a secure cookie”. So set up the HTTPS domain before you use it:

  1. In your DNS, create an A record for n8n.yourdomain.com pointing to the VPS IP.
  2. In the service, open Domains and click the gear next to the domain.
  3. Under Protocol, choose https. Under Domain, enter n8n.yourdomain.com. Under Port, enter 5678.
  4. Click Save, then Restart current version at the top.

If a Use a different port? warning says the service requires port 5678, check the Port field. With 5678 filled in, click Use This Port Anyway. In the domain list, the Internal port column should show 5678.

With the domain on https://, Coolify’s Traefik proxy requests a Let’s Encrypt certificate on its own. For that, DNS has to be propagated and ports 80 and 443 open. Coolify also fills in N8N_HOST, N8N_EDITOR_BASE_URL, WEBHOOK_URL and N8N_PROTOCOL=https from that domain, which is what makes webhooks come out with the right URL. You don’t need to edit those variables by hand.

First login to n8n

  1. Open https://n8n.yourdomain.com. Set up owner account appears: fill in email, name and password (8 or more characters, with a number and an uppercase letter).
  2. n8n shows a short questionnaire and offers a free license key for extra features. Both are optional.
  3. Create a workflow with a Manual Trigger node connected to an Edit Fields node and click Execute workflow. Both nodes turn green with “1 item” between them, and the run appears in the Executions tab as Succeeded.

It is worth restarting the service once from Coolify and checking that the workflow and execution history are still there. They are, because n8n and PostgreSQL write to volumes.

Security and maintenance

  • Close port 8000 when you can. Under Settings → General, the URL field puts the dashboard itself behind a domain, and then you only need to allow 22, 80 and 443 in the firewall.
  • Backups: the service’s PostgreSQL has a Backups tab in Coolify, covered in the Coolify backup docs. Also export your workflows and credentials with the n8n CLI export commands, as described in backing up n8n.
  • Updating n8n: the service pins an image tag, and the catalog does not bump it for you. To upgrade, change the n8n and runners tags in Edit Compose File, as in step 3. Before changing it, read how to update n8n, check the minimum safe n8n version, read the n8n release notes and take a backup first.

Where to host it

For Coolify with n8n, 4 GB of RAM is the comfortable size. Hostinger’s KVM 1 (1 vCPU, 4 GB RAM) covers the memory but sits below the 2 cores Coolify asks for. KVM 2 (2 vCPU, 8 GB RAM) meets the requirements with room to spare: see the plans ↗. Contabo’s Cloud VPS 4 (4 vCPU, 8 GB RAM, 100 GB SSD) also meets them; pick the region closest to your users from the locations page (see the plansaffiliate), and follow the n8n on Contabo guide for the order and firewall. Check the current price on the plans page before you buy, since entry and renewal prices differ. For a cost comparison across providers, see how much it costs to host n8n.

VPS calculator

Not sure how much RAM and CPU to plan for? Enter your executions per day, database and whether you use queue mode: the calculator estimates RAM and vCPUs and lists the plans that fit.

Frequently asked questions

Which n8n template should I pick in Coolify?

For most setups, N8N With Postgresql: it starts n8n, the Task Runners and a PostgreSQL 16 database with a generated user and password. The plain N8N template uses SQLite, and N8N With Postgres And Worker is for queue mode.

Why does n8n on Coolify show the secure cookie error?

Because the temporary sslip.io domain is plain HTTP. Set your own domain with https:// and port 5678 under Domains, then restart the service. Coolify’s Traefik proxy issues the certificate.

What should I do when Coolify says Server is not reachable on localhost?

Coolify’s SSH key is not in root’s authorized_keys. This happens when you install with sudo -E. Copy the public key from /data/coolify/ssh/keys to /root/.ssh/authorized_keys and click Check Again.

How much RAM does Coolify with n8n use?

About 1 GB in total: Coolify sits around 460 MB, n8n around 340 MB, and Traefik, Redis and the databases about 150 MB together. A 4 GB VPS leaves plenty of room.

Does the Coolify n8n template ship the current version?

No. The catalog pins an old n8n and Task Runners release. Before the first deploy, open Edit Compose File and change the n8nio/n8n and n8nio/runners tags to the current stable release, the same on both.

M

Written by

Marlon

I like automation and write here what I learn building automations with n8n. Spotted a mistake or an outdated detail? Let me know.

Keep reading