How to Install n8n on a VPS
Six steps, real spec guidance, and Docker + Caddy instead of the usual Nginx + Certbot sprawl. Provider-agnostic — pick your VPS first, then follow along.
Before You Start
The Setup, Step by Step
- 1
Provision the VPS and note its public IP
Any provider works — the steps below are the same on DigitalOcean, Hetzner, Linode, or a bare VPS. Pick Ubuntu 22.04 or newer if you have the choice; it's what most Docker install guides (including n8n's own) assume.
- 2
Point a DNS A record at that IP
Create an A record for the subdomain you want n8n on (e.g. n8n.yourdomain.com) pointing at the server's IP. DNS propagation can take a few minutes to a few hours depending on your registrar.
- 3
SSH in and install Docker
curl -fsSL https://get.docker.com | sh installs both Docker and the Compose plugin on most distros in one line. Confirm with docker compose version before moving on.
- 4
Write the compose file and a Caddyfile
n8n + Postgres in docker-compose.yml (see our Docker guide for the full file), plus a two-line Caddyfile — Caddy handles SSL certificate issuance and renewal automatically, no separate Certbot setup:
n8n.yourdomain.com { reverse_proxy n8n:5678 } - 5
Bring it up and verify
docker compose up -d, then watch docker compose logs -f n8n until it reports it's listening. Visit your domain — Caddy should present a valid certificate within a few seconds of the first request.
- 6
Set up backups before you rely on it
A cron job running pg_dump against the Postgres container, shipped somewhere off the server, is the minimum viable backup. Volume snapshots at the provider level are a good second layer.
Need the full n8n + Postgres compose file? See our Docker guide.
How Much VPS Do You Actually Need?
RAM is n8n's real bottleneck, not CPU. Size for your workflow volume, not a generic recommendation.
| Workload | Specs | Fits |
|---|---|---|
| Light | 1 vCPU / 2 GB RAM | A handful of workflows, occasional triggers, no queue mode |
| Moderate | 2 vCPU / 4 GB RAM | Regular webhook traffic, several concurrent workflows — the point where queue mode starts to matter |
| Heavy | 4+ vCPU / 8+ GB RAM | High-volume automation, queue mode with multiple workers, large JSON payloads |
Already picked a provider?
We've written the provider-specific versions of this guide for the two we use ourselves:
Or Get These Exact Specs, Pre-Installed
These are the same VPS tiers, already running n8n with backups and updates handled. From $7/mo.
Frequently Asked Questions
What's the minimum VPS size for n8n?
n8n's own documentation lists 1 GB RAM as the floor, but that's a bare-minimum figure for light testing. Once you're running scheduled workflows or handling real webhook traffic, 2 GB RAM is a more realistic starting point — RAM is n8n's actual bottleneck, not CPU, since each active execution holds its payload in memory.
Which VPS provider should I use for n8n?
Any provider that gives you root access and a public IP works — the Docker setup is identical. DigitalOcean and Hetzner are the two most commonly used for n8n specifically (see our provider-specific guides), largely because both have simple per-hour billing and NVMe storage by default.
Do I need a domain name, or can I use just an IP address?
You can run n8n on a bare IP for testing, but webhook-triggered workflows and Let's Encrypt/Caddy's automatic SSL both expect a real domain. Get a cheap domain (or a subdomain of one you own) before going further than a local test.
Is Caddy really enough for SSL, or do I need Certbot too?
Caddy handles certificate issuance and renewal on its own — no separate Certbot process, no cron job to remember. It's the reverse proxy this site's own infrastructure uses for exactly that reason: fewer moving parts than the Nginx + Certbot combination most older guides describe.
How is this different from the DigitalOcean or Hetzner-specific guides?
The steps are the same everywhere — this page is the provider-agnostic version. Our DigitalOcean and Hetzner guides add the provider-specific parts: which image to pick, region selection, and each provider's firewall UI.
What if I outgrow the VPS I picked?
Most providers let you resize a VPS to a larger plan with a short reboot, as long as you're moving up within the same CPU family. Plan for it — moving from 2 GB to 8 GB later is normal and not something you need to get right on day one.
Or Skip Straight to a Working Instance
Same specs, same n8n, zero setup — provisioned in minutes with updates and backups already handled. Free for 10 days.