Engineering notes

Run n8n on a UK VPS: size, Docker Compose install, HTTPS and backups

How to self-host n8n on a VPS with n8n's own Docker Compose and Traefik setup. What n8n's docs say about memory, which server size fits, the install on Ubuntu 24.04 or Debian 12, securing it, and a backup that includes the encryption key.

By Vozora · Published

n8n is a workflow automation tool: you connect triggers (a webhook, a schedule, a new row somewhere) to actions (call an API, send a message, run some code) in a visual editor. Self-hosting it suits people who run a lot of executions, who want workflows and credentials on a server they control, or who need it to reach things on a private network.

n8n's own docs are frank about who should do this: "n8n recommends self-hosting for expert users. Mistakes can lead to data loss, security issues, and downtime." This guide is for someone comfortable with SSH and Docker. It uses n8n's own Docker Compose setup with Traefik for HTTPS, and follows n8n's documentation as we read it on 18 November 2026. We have not run this exact sequence on a Vozora server, so read each step against the linked page before you run it.

What it needs

n8n does not publish a single minimum for a self-hosted server. Its production requirements page asks for "a 64-bit Linux host", Docker Engine and the Docker Compose v2 plugin, and a persistent volume for the data directory, "which holds the encryption key" (n8n docs, production requirements, checked 2026-11-18).

The closest thing to a figure is on n8n's prerequisites page for embedded deployments: memory "320 MB - 2 GB", database "512 MB - 4 GB SSD", and the advice that "n8n isn't CPU intensive" and "memory requirements supersede CPU requirements". It gives a scale: "an n8n Cloud instance at idle requires ~100MB. It's the nature of your workflows and the data being processed that determines your memory requirements" (n8n docs, prerequisites, checked 2026-11-18). Workflows that move large files, or Code nodes working on big payloads, are what push memory up.

One exception: n8n's newer "Install using Docker Compose" guide also sets up a sandbox for n8n Assistant, and asks for "At least 4 GB of RAM and 2 vCPUs", on "a dedicated host or VM with nothing else on it", because its runner is privileged (n8n docs, install using Docker Compose, checked 2026-11-18). This guide uses the plainer server setup without that sandbox.

Which Vozora size

  • Nano (1 vCPU, 2 GB RAM, 30 GB disk) runs n8n with its built-in SQLite database for personal workflows: webhooks, scheduled API calls, notifications.
  • Small (2 vCPU, 4 GB, 60 GB) once you add PostgreSQL, which n8n recommends for production, run workflows that handle files, or have several people using it. It is also the minimum for the Assistant sandbox setup above.
  • Medium (4 vCPU, 8 GB) for heavy file processing or many concurrent executions.

Specifications and current rates are on the pricing page. An hourly server can be resized to a larger size while stopped, but not down. Our RAM sizing guide shows how to measure what your workflows actually use with docker stats.

Before you install

You need a domain or subdomain. n8n's setup serves the editor and webhooks over HTTPS only, at a name such as n8n.example.com. Create an A record for that name pointing at your server's IPv4 address, with your DNS provider or on Vozora's free DNS hosting.

In the server's Vozora firewall, allow TCP 22 (ideally from your own address only), and TCP 80 and 443 from anywhere. Traefik needs port 443 reachable to get its certificate. The default firewall a new server joins allows everything, so tighten it now.

Install Docker

n8n's guide starts from Docker Engine and the Compose plugin, installed "using the instructions for your Linux distribution". Docker's install pages for Ubuntu and Debian (checked 2026-11-18) give the same steps apart from the word ubuntu or debian in two URLs and the codename. This version reads both from /etc/os-release, so it works on either Vozora image:

. /etc/os-release
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/$ID/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/$ID
Suites: ${UBUNTU_CODENAME:-$VERSION_CODENAME}
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Check both, as n8n's guide does:

docker --version
docker compose version

Install n8n

These steps are from n8n's server guide (n8n docs, use Docker Compose, checked 2026-11-18).

Make a project directory and the shared files directory:

mkdir n8n-compose
cd n8n-compose
mkdir local-files

Create .env with your own values. We have changed only the timezone from n8n's example, to London:

# DOMAIN_NAME and SUBDOMAIN together determine where n8n will be reachable from
# The top level domain to serve from
DOMAIN_NAME=example.com

# The subdomain to serve from
SUBDOMAIN=n8n

# The above example serve n8n at: https://n8n.example.com

# Optional timezone to set which gets used by Cron and other scheduling nodes
# New York is the default value if not set
GENERIC_TIMEZONE=Europe/London

# The email address to use for the TLS/SSL certificate creation
SSL_EMAIL=user@example.com

Create compose.yaml. This is n8n's file as published:

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
    environment:
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - N8N_WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - TZ=${GENERIC_TIMEZONE}
      - N8N_RESTRICT_FILE_ACCESS_TO=/files
    volumes:
      - n8n_data:/home/node/.n8n
      - ./local-files:/files

volumes:
  n8n_data:
  traefik_data:

Start it:

sudo docker compose up -d

Then open https://n8n.example.com. n8n's guide notes it "is only accessible using secure HTTPS, not over plain HTTP", and that if you cannot reach it, check the server's firewall and your DNS record.

A few things worth knowing about that file:

  • Only Traefik is public. n8n is published on 127.0.0.1:5678, so it answers only on the server itself and Traefik reaches it over Docker's network. That matches n8n's own rule: "Don't expose the n8n process directly to the internet. Put a reverse proxy or load balancer in front of it."
  • --api.insecure=true turns on Traefik's dashboard on its internal port 8080. That port is not published in this file, so it is not reachable from outside. Keep it that way.
  • The images are not pinned. n8nio/n8n and traefik with no tag mean whatever is newest when you pull. n8n's update guide says to "Pin a specific image tag, for example n8nio/n8n:<n8n-version>" (n8n docs, update n8n, checked 2026-11-18). On the day we checked, n8n listed 2.48.5 as the current stable release, so image: n8nio/n8n:2.48.5 would pin that. Pin Traefik to a version too.
  • N8N_WEBHOOK_URL is new: the docs say it "is available from n8n 2.30.0; on earlier versions, use WEBHOOK_URL."

Secure it

Set up the owner account first. The first visit to a new n8n shows the owner setup screen. Do it as soon as the site answers, before anyone else finds the hostname. Publicly trusted certificates are logged in Certificate Transparency logs, so a new name gets noticed quickly.

SSH. Log in as the image's user with your key, as Vozora servers are set up; prove passwords are refused with ssh -o PubkeyAuthentication=no ubuntu@<server-ip>, as in our new VPS checklist.

Firewall. Rely on the Vozora firewall rather than ufw for Docker ports. Docker's documentation says traffic to published container ports "gets diverted before it goes through the ufw firewall settings" (Docker docs, packet filtering and firewalls, checked 2026-11-18). The Vozora firewall filters before traffic reaches the server, so Docker cannot open a hole in it.

Webhooks are public by design. Anything you build on a Webhook node can be called by anyone who knows the URL. Use the node's authentication options for anything that changes data.

Updates. Change the pinned tag, then sudo docker compose pull and sudo docker compose up -d. Take a backup first: n8n's update guide warns that "Changing the image tag or Helm release back to the older version doesn't reverse database migrations."

Backups

n8n's backup page is the one to read (n8n docs, back up and restore, checked 2026-11-18). The essentials:

  • In Docker, everything lives in the n8n_data volume, mounted at /home/node/.n8n. With the default SQLite database, that folder holds "the SQLite database file, which contains users, settings, and execution data, the encryption key", so it is the whole instance.
  • The encryption key matters as much as the data: "Without the encryption key from the config file, or a custom N8N_ENCRYPTION_KEY, a restored database or encrypted credential export can't be decrypted."
  • "With the default SQLite database, stop n8n before copying the .n8n folder."

So a full backup of this setup is: stop n8n, archive the volume, start it again.

cd ~/n8n-compose
sudo docker compose stop n8n
sudo docker run --rm -v n8n-compose_n8n_data:/data -v "$PWD":/backup alpine \
  tar czf /backup/n8n-data-$(date +%F).tar.gz -C /data .
sudo docker compose start n8n

Compose names the volume after the project directory, so with n8n-compose it is n8n-compose_n8n_data; sudo docker volume ls shows the real name. The archive contains your credentials' encryption key, so treat it like a password file. Copy it off the server, with .env and compose.yaml, using restic or another tool that writes somewhere else; our self-hosting guide sets that up on a timer.

n8n's CLI export (n8n export:workflow --backup and n8n export:credentials --backup) is useful for moving workflows between instances, but the docs say it does not include users, execution history, variables or "Instance settings, including the encryption key". It is not a full backup.

On top of that, turn on Vozora's daily backups for the server (taken each night, newest 7 kept), and press Back up now before each n8n upgrade. A restore puts the whole disk back as it was. These are stored on the same platform as the server, so keep the off-server copy as well.

Short version

  1. Nano for personal workflows on SQLite; Small for PostgreSQL, files or several users.
  2. A DNS name pointing at the server; Vozora firewall with 80 and 443 open, SSH from your address.
  3. Docker from Docker's own repository, then n8n's .env and compose.yaml.
  4. Pin the image tags; open the site and create the owner account straight away.
  5. Back up the n8n_data volume with n8n stopped, keep it off the server, and turn on Vozora's daily backups.

Vozora servers are billed by the minute from prepaid credit while they exist, including while stopped. Sizes and prices are on the pricing page. If you want n8n as one of several apps behind a deployment platform, see Coolify on a UK VPS; to watch n8n's webhook URL from somewhere else, see Uptime Kuma on a UK VPS.

© 2026 Vozora. A trading name of Bankside Technology Ltd, registered in England and Wales, company no. 17253446. Registered office: First Floor, Swan Buildings, 20 Swan Street, Manchester, England, M4 5JW.