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 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, search for “n8n” and choose N8N With Postgresql. Then switch the domain to https:// with port 5678 and restart the service.

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.

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 450 MB, n8n around 320 MB, Traefik about 115 MB, and the rest for the databases. 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 \
[email protected] \
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 [email protected]: 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.
  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.

Then open Servers → localhost → Proxy. If Traefik shows as Exited, click Start Proxy. Without it, no domain works.

Create n8n from the catalog

  1. Under Projects, open the project and the production environment.
  2. Click + New 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.

Coolify creates the service with three containers: n8n, the Task Runners (which run the code nodes) and PostgreSQL 16. User, password and database name are generated for you, and the data lives in Docker volumes. Click Deploy at the top and wait for all three to show Running (healthy), which took about a minute. The Coolify page for n8n describes the three variants.

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 the Port field is empty, Coolify warns “This service requires port 5678 to function correctly”. Fill in 5678 before saving.

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. 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 ↗. 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.

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 450 MB, n8n around 320 MB and Traefik about 115 MB. A 4 GB VPS leaves plenty of room.

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