What you need to host n8n
n8n is an automation tool: workflows that connect your applications and run on a schedule or when a webhook is called. Self-hosted, it needs four things:
- Docker and Docker Compose: this is the installation method n8n describes, and it requires the Compose v2 plugin. On our VPS, Docker installs with the official script (see installing Docker on a VPS).
- A database: by default, n8n stores workflows, credentials and executions in SQLite, a single file in its data folder. Its documentation keeps SQLite for testing and small setups, and recommends PostgreSQL in production; SQLite is not supported in queue mode. For a new instance, start straight away with PostgreSQL: SQLite data is not carried over automatically.
- HTTPS: n8n recommends not exposing its port 5678 directly to the Internet, and putting a reverse proxy that holds the certificate in front of it. In practice it is mandatory: by default, n8n only sends its session cookie over HTTPS (
N8N_SECURE_COOKIE), and many services refuse to call a webhook over plain HTTP. So you need a subdomain, for example n8n.example.com, pointing to the VPS's IPv4.
- The right variables: behind a proxy, n8n must know its public address, otherwise it shows webhooks as
http://localhost:5678.
N8N_HOST=n8n.example.com
N8N_PROTOCOL=https
N8N_EDITOR_BASE_URL=https://n8n.example.com/
N8N_WEBHOOK_URL=https://n8n.example.com/
N8N_PROXY_HOPS=1
# openssl rand -hex 32
N8N_ENCRYPTION_KEY=
GENERIC_TIMEZONE=Europe/Paris
TZ=Europe/Paris
DB_TYPE=postgresdb
N8N_WEBHOOK_URL has existed since n8n 2.30.0 and replaces WEBHOOK_URL, deprecated since 2.35.0. N8N_PROXY_HOPS=1 tells n8n to trust the proxy's X-Forwarded-* headers. N8N_ENCRYPTION_KEY encrypts the stored credentials: set it before the first start and keep it safe, because without it a restored database cannot be read. GENERIC_TIMEZONE sets the time used by scheduled triggers, TZ the system time. The other DB_POSTGRESDB_* variables (host, database, user, password) complete the PostgreSQL connection: the full file is in the guide installing n8n on a VPS.
Which VPS for your workflows
Memory is the first criterion. n8n does not limit how much data a node can load, and its documentation lists what drives memory use: the volume of JSON data and files processed, the number of nodes, the Code node, executions started by hand from the editor (n8n then copies the data for display) and workflows running at the same time. A hundred small scheduled workflows often weigh less than a single one that processes a large file.
- To start with: a Start tier (2 vCPU, 4 GB), Ryzen or Intel, for n8n, PostgreSQL and the reverse proxy.
- Files, long lists, code: the Ryzen VPS Plus (8 GB of DDR5). The Ryzen 9 9950X cores and NVMe shorten executions and make the editor more responsive.
- Several services on the same machine: the Intel VPS Plus or Pro, which gives 4 or 6 vCPU with 8 or 16 GB of DDR4 ECC.
- A large volume of executions: n8n queue mode adds Redis and workers. Plan for an Élite tier or above, and a dedicated server beyond that.
Watch actual usage over the first few weeks with docker stats. If a workflow fills the memory, n8n advises processing data in smaller batches or splitting the work into sub-workflows before moving up a tier: changing tier is monthly, with no commitment. Think about disk space too: by default, n8n keeps execution history for 14 days, up to 10,000 executions, and the EXECUTIONS_DATA_* variables let you save only failed executions.
One limit to know about. Our Ryzen and Intel VPS are Linux containers (LXC): n8n, PostgreSQL, Redis and the reverse proxy need no kernel module and fit in fine. However, the sandbox of n8n Assistant, the built-in AI assistant, requires in its self-hosted variants either a privileged Docker container or Kubernetes with Sysbox: neither belongs in a container VPS. The AI nodes in your workflows, which call an external API, work normally. The differences between a container and a virtual machine are covered in KVM or LXC VPS.
Install, back up, update
- Pick the tier from the offers on this page, based on the memory your workflows need. Today's price is shown on each one.
- Order with a recent Debian or Ubuntu: the VPS is ready in a few minutes, with root access.
- Secure access before installing anything: SSH key, firewall, automatic updates, with the guide securing a Linux VPS.
- Point your subdomain to the VPS's IPv4 (a DNS record of type A), then install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
docker compose version
- Start n8n, PostgreSQL and the reverse proxy with a
compose.yaml file: the guide installing n8n on a VPS gives the complete files, with Caddy obtaining the certificate on its own. Prefer a web interface? Nginx Proxy Manager does the same job; with a standard Nginx, follow Certbot and Let's Encrypt.
- Create the owner account straight away: the first person to complete n8n's welcome screen becomes the owner of the instance.
Publish neither n8n's port 5678 nor PostgreSQL's port 5432: ports published by Docker bypass UFW rules. Only the reverse proxy should answer on ports 80 and 443.
Backups. A complete n8n backup includes its data folder (/home/node/.n8n in the container), which holds the encryption key, and the PostgreSQL database, backed up with its own tools. With SQLite, that folder also holds the database: stop n8n before copying it. The n8n export:workflow --backup export is not enough to restore an instance: it contains neither users, nor history, nor variables, nor the key. For example, for the database:
docker compose exec -T postgres pg_dump -U n8n -d n8n -Fc > n8n-$(date +%F).dump
Then copy these files off the VPS: a copy left on the same machine protects you from nothing. Before each update, take a full backup, as n8n recommends, and read the release notes: n8n applies its database migrations on startup, and going back to the old image does not undo them.
n8n's licence, and when a VPS is not the right choice
n8n is not open source software in the OSI sense, as its publisher says itself: its code is available under the Sustainable Use License, a fair-code licence, free for the self-hosted version. According to the licence FAQ published by n8n:
- Allowed: using it to run your business or for personal projects; building automations for your clients on your instance, as long as they can neither create nor edit the workflows; charging for building, setup, maintenance, training and consulting; using n8n behind the scenes in your product; running several instances.
- Not allowed without a commercial agreement with n8n: hosting n8n as a service where your clients build their workflows; letting outside users create or configure their own workflows, through your own interface, the API, MCP or an AI agent; reusing the code to launch your own automation product; reselling n8n as a white label; using features that require a key without an Enterprise licence.
To install and maintain n8n for a client, the FAQ states that this is allowed on the client's own server, provided you do not also host it for them. If you are unsure about your case, read the licence and its FAQ in the n8n documentation, or ask the publisher before you start.
A VPS is not the right choice if:
- you do not want to administer anything: on a VPS, updates to the system, Docker and n8n, the firewall and backups are your responsibility;
- you want to host the n8n Assistant sandbox, which requires a privileged container or Kubernetes with Sysbox on a machine of its own: choose a dedicated server;
- you expect a very large volume of executions in queue mode, with several workers: a dedicated server gives more headroom;
- you plan to offer n8n to your clients as their own tool: the licence forbids it without an agreement with the publisher, whatever the server.
To run n8n alongside other containers, see also the Docker VPS page.