The concepts you need
- VPS: your own virtual server running Linux, where n8n runs 24/7.
- Docker Compose: a file (
compose.yaml) that starts n8n and the HTTPS proxy together. - Volume: the folder where n8n stores workflows, credentials and its encryption key. It is the most important thing to back up.
- Webhook: the public address other apps call to trigger a workflow.
The steps, in short
Commands follow the official documentation (October 2026), except ufw (Ubuntu) and the backup tar (Docker’s volume pattern), which are not from the n8n documentation.
- Create a VPS with Ubuntu LTS and connect over SSH with a non-root user that can use
sudo. First time? Follow Linux VPS from scratch. - Install Docker and the Compose plugin using the official Docker documentation. If
docker compose versionshows a version, it worked. - Point a subdomain at the server: create an A DNS record (for example
n8n.yourdomain.com) with your VPS IP. If DNS is new to you, read Domain, DNS and HTTPS. - Create the working folder and
local-files(the compose mounts it at/files):
mkdir n8n-compose
cd n8n-compose
mkdir local-files
nano .env
In nano, paste this with your details, save (Ctrl+O, Enter) and exit (Ctrl+X):
DOMAIN_NAME=yourdomain.com
SUBDOMAIN=n8n
GENERIC_TIMEZONE=America/Bogota
SSL_EMAIL=you@example.com
- Copy the official
compose.yamlfrom the n8n Docker Compose guide into that folder, unchanged. It includes n8n, Traefik (the proxy that gets the HTTPS certificate) and then8n_datavolume. - Open ports 22 (SSH), 80 (redirects to HTTPS) and 443 (n8n). Allow 22 before enabling
ufw, or you lock yourself out:
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
ufw enable asks for confirmation: answer y; it should say the firewall is active. Docker publishes its ports bypassing ufw; so anything that must not be public goes with 127.0.0.1: in front. If your provider has a firewall, open the same ports there.
7. Start everything:
sudo docker compose up -d
With sudo docker compose ps you should see n8n and Traefik running.
- Open
https://n8n.yourdomain.com, create your owner account and test a workflow with a webhook. - Back up before updating. With SQLite (the default database), n8n must be stopped while you copy:
sudo docker compose stop
sudo docker volume ls
sudo docker run --rm -v n8n-compose_n8n_data:/data -v "$PWD":/backup ubuntu tar czf /backup/n8n_data.tar.gz -C /data .
ls -lh n8n_data.tar.gz
Compose puts the folder name before the volume name (n8n-compose_n8n_data); confirm it in volume ls or the backup will be empty. n8n_data.tar.gz must appear with a size above zero. Copy it off the server and keep it somewhere private: it includes your credentials and the encryption key. If you are not updating now, start n8n again with sudo docker compose up -d.
10. Update. Read the release notes and the update guide. Then:
sudo docker compose pull
sudo docker compose down
sudo docker compose up -d
sudo docker compose ps must show n8n and Traefik running; if it fails, restore using the backup guide.
Common mistakes
- Not mounting the volume and losing workflows and credentials on update.
- Updating without a backup or the release notes, or copying the volume while n8n is running.
- Keeping the backup only on the server, or without the encryption key: it is in the
configfile inside.n8n(in the volume), unless you setN8N_ENCRYPTION_KEY. Without it you cannot recover credentials. - In
compose.yaml, changing127.0.0.1:5678:5678to5678:5678: n8n is exposed over HTTP, bypassingufw. - Forgetting the timezone: scheduled workflows run at an unexpected time.
How we help
We leave n8n running on your server with a domain, HTTPS, volume backups and a clear update flow, and we show you how to operate it yourself.