HostingBaba

n8n VPS guide

Self-host n8n on a VPS.
Step by step.

n8n is a workflow automation tool: you connect apps, AI models and scripts by dragging boxes, and your workflows run on their own. This guide shows how to install it on your own HostingBaba Linux VPS with Docker and HTTPS, so it runs around the clock.

What you need

A Linux VPS with Ubuntu 24.04 LTS (choose it on the order form), a domain or subdomain you control, such as n8n.yourdomain.com, and SSH access from your own computer. How much memory n8n needs depends on how many workflows run at the same time and how much data they handle. Our smallest VPS plan has 4 vCPU and 8 GB of memory; start there and move to a bigger plan if your server runs short. Running AI models on the server itself needs much more memory and processing power.

n8n is made by n8n GmbH. Its free self-hosted Community Edition may be used for your own internal business or personal use under the n8n Sustainable Use License; read it before you use n8n for clients. HostingBaba is not affiliated with n8n.

Step 1: point your domain at the server

When your server is ready, copy its IPv4 address from your dashboard. At your domain provider, add an A record for your subdomain (for example n8n) with that address. It usually starts working within minutes; check that the name shows your server's address with:

ping n8n.yourdomain.com

Step 2: install Docker

Log in to the server over SSH as root with the details from your dashboard. Update it, then install Docker from Docker's own package repository, as Docker's guide for Ubuntu describes:

apt update && apt -y upgrade
apt install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 3: create the n8n setup

Make a folder and a file called compose.yaml. Replace n8n.yourdomain.com with your own subdomain (three times) and pick your time zone. n8n listens only on the server itself (127.0.0.1); Caddy gets a free HTTPS certificate and is the only part reachable from the internet.

mkdir -p /opt/n8n && cd /opt/n8n
nano compose.yaml
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - N8N_PROXY_HOPS=1
      - GENERIC_TIMEZONE=Europe/London
      - TZ=Europe/London
    volumes:
      - n8n_data:/home/node/.n8n
  caddy:
    image: caddy:2
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    command: caddy reverse-proxy --from n8n.yourdomain.com --to n8n:5678
    volumes:
      - caddy_data:/data
volumes:
  n8n_data:
  caddy_data:

Step 4: claim n8n privately, then go public

The first person to open a new n8n creates its owner account, so do that before n8n is reachable from the internet. Start n8n on its own:

docker compose up -d n8n

On your own computer, open an SSH tunnel to the server (use your server's address), keep that window open, and go to http://localhost:5678 in Chrome or Firefox (Safari does not allow the n8n login here; use one of the others for this step). Create your owner account with a strong password.

ssh -L 5678:127.0.0.1:5678 root@YOUR.SERVER.IP

Then start Caddy, close the tunnel and open https://n8n.yourdomain.com. If it does not load yet, wait a minute while the certificate is issued and check the logs with docker compose logs caddy.

docker compose up -d

Step 5: firewall, updates and backups

Turn on the firewall for SSH. If you use a different SSH port, allow that one instead of OpenSSH. Note that ports published by Docker bypass this firewall: here only Caddy publishes ports 80 and 443, and n8n is bound to 127.0.0.1, so do not publish other containers' ports to the internet unless you mean to.

ufw allow OpenSSH
ufw enable

Your workflows, credentials and encryption key live in the n8n_data volume. To make a safe backup, stop n8n for a moment, archive the volume, then start it again. Copy the file off the server, for example with scp, and keep it somewhere else.

cd /opt/n8n
docker compose stop n8n
docker run --rm -v n8n_n8n_data:/data:ro -v /opt/n8n:/backup alpine tar czf /backup/n8n-backup.tgz -C /data .
docker compose start n8n

To update n8n, read its release notes, make a backup as above, then run:

cd /opt/n8n
docker compose pull && docker compose up -d

We do not back up your server by default, so keep your own copies.

What is not allowed

Your server, and everything n8n does from it, must follow our Acceptable Use Policy: no spam of any kind, including unsolicited messages and posting links or comments on other people's sites without permission, no getting around platform bans or fraud and detection systems, and no scanning systems you are not allowed to test. Serious abuse such as phishing, malware, attacks or fraud stops the server at once; for other complaints you reply within 12 hours and fix it within 24.

Prices

Monthly price on a 1-month term, in our EU region. Other locations add a small monthly extra. Longer terms may be discounted; the discount and the exact total are shown on the order form before you pay.

PlanCPUMemoryStoragePort EU region Order
VPS 4 4 vCPU 8 GB 100 GB SSD 200 Mbit/s $16.50 / mo Order
VPS 6 6 vCPU 12 GB 200 GB SSD 300 Mbit/s $22.50 / mo Order
VPS 8 8 vCPU 24 GB 300 GB SSD 600 Mbit/s $42.00 / mo Order
VPS 12 12 vCPU 48 GB 400 GB SSD 800 Mbit/s $75.00 / mo Order
VPS 16 16 vCPU 64 GB 500 GB SSD 1 Gbit/s $111.50 / mo Order
VPS 18 18 vCPU 96 GB 600 GB SSD 1 Gbit/s $147.00 / mo Order
NVMe 4 4 vCPU 8 GB 150 GB NVMe 500 Mbit/s $33.50 / mo Order
NVMe 6 6 vCPU 12 GB 300 GB NVMe 500 Mbit/s $47.00 / mo Order
NVMe 8 8 vCPU 24 GB 450 GB NVMe 1 Gbit/s $85.00 / mo Order
NVMe 12 12 vCPU 48 GB 600 GB NVMe 1 Gbit/s $143.50 / mo Order
NVMe 16 16 vCPU 64 GB 750 GB NVMe 1 Gbit/s $191.50 / mo Order
NVMe 18 18 vCPU 96 GB 900 GB NVMe 1 Gbit/s $239.50 / mo Order

Also available: Dedicated CPU · Storage VPS · Windows VPS · all nine locations

Questions

Is n8n free on a VPS?

The self-hosted Community Edition of n8n is free for your own use under its licence; you pay only for the server. n8n itself sets no limit on how many workflows or runs you have; your server's size does. Some business features need a paid n8n licence.

Do you install n8n for me?

No. We provide and support the server; you install n8n with this guide and manage your own workflows. If something on the server itself does not work, open a support ticket.

Can I run AI agents with n8n?

Yes. n8n has AI nodes that connect to AI providers with your own API key. When the model runs at the provider, your server sends the requests and handles the replies. Running a model on the server itself needs a much bigger plan.

Linux or Windows for n8n?

Linux. n8n runs in Docker on Linux, which leaves more of the server for your workflows. You open it in your browser, so you never need the server's desktop.

Can I use n8n without a domain?

Yes, just for yourself: open it over an SSH tunnel as in step 4, in Chrome or Firefox. Webhooks from other apps and logging in from anywhere need a public HTTPS address, and a domain or subdomain is the easiest way to get one.

Related