To self host n8n cheap and still have it hold up, rent a 2 vCPU, 4 GB VPS and run n8n with PostgreSQL in Docker Compose. On a Hetzner CX23 at 6.64 € a month, n8n 2.46.6 handled up to 15.04 webhook executions per second in our load test with zero failed requests. With daily backups the total is 7.97 € a month.
Why this matters now: managed n8n plans are priced by executions, and many cheap VPS offers only look cheap until they renew. We priced the full setup, not just the server, and checked that the cheapest one survives real load. This guide is part of our n8n hosting section.
Tested in the Lab Hetzner CX23 · n8n 2.46.6 + PostgreSQL 16 · Nov 2026
The full monthly cost
| Item | What we use | Per month |
|---|---|---|
| Server | Hetzner CX23, 2 vCPU, 4 GB, 40 GB disk | 6.64 € |
| Backups | Hetzner backups, daily, 7 kept (20% of server price) | 1.33 € |
| HTTPS | Caddy with an automatic certificate | 0 € |
| n8n and PostgreSQL | Self-hosted Docker images | 0 € |
| Domain | A subdomain of a domain you already own | 0 € extra |
| Total | 7.97 € |
Server price is gross (incl. VAT) from the Hetzner Cloud API, checked 5 November 2026. The backup rule is from Hetzner's billing FAQ: "a monthly flat price, which is 20% of the price of the server". Hetzner's docs say backups are taken once a day and each server has seven backup slots. That is 95.64 € a year.
No domain yet? Any registrar works. Cloudflare Registrar says it "does not mark up domain prices at all", so you pay the registry fee. We did not price individual domain endings for this page, so add your registrar's renewal price to the total.
Why the cheapest tested server is enough
We ran the same n8n stack on five Hetzner servers. The CX23 is the smallest and cheapest of them. Here is what it did with a webhook → Code node → response workflow:
| Concurrent requests (total) | Executions/s | Median | p95 | Failed | n8n peak RAM |
|---|---|---|---|---|---|
| 1 (300) | 10.11 | 104 ms | 162 ms | 0 | 519.8 MiB |
| 10 (400) | 14.81 | 697 ms | 893 ms | 0 | 660.1 MiB |
| 25 (1000) | 15.04 | 1651 ms | 1936 ms | 0 | 824.8 MiB |
| 50 (2000) | 14.25 | 3445 ms | 3954 ms | 0 | 1003.0 MiB |
Executions/s is completed workflow runs per second. p95 is the response time 95% of requests beat. MiB is mebibytes (1 MiB = 1.048576 MB). The load came from the same server over localhost, so add network time for real callers, and expect heavier workflows to be slower.
15 executions per second is about 54,000 an hour of this light workflow. A typical personal or small-team setup runs a few thousand a day. RAM is fine too: n8n idled at 402.7 MiB and PostgreSQL at 58.75 MiB on the test CX23, and the peak stayed near 1 GB on a server with 3819 MiB.
And on our production CX23 (Ubuntu 26.04), with n8n and PostgreSQL running and no workflows yet:
| n8n 2.46.6 on Hetzner CX23 | Measured |
|---|---|
| Docker install | 22 s |
| Image pull + first start to healthy | 105 s |
| n8n RAM right after start | 785.3 MiB |
| n8n RAM idle (after ~60 s) | 379.7 MiB |
| PostgreSQL 16 RAM idle | 69.6 MiB |
| Whole server RAM used, idle | 1036 MiB of 3,814 |
| n8n image size | 1.94GB |
| Disk used after install | 4.7G of 38G |
Measured by AI Hosting Lab on 2026-11-05 · docker compose: n8n + postgres:16, docker.io from Ubuntu repo, task runners on · method
What you give up at this price
- Burst speed. At 50 concurrent requests the median response took 3445 ms. If a store or a chat platform sends you bursts and retries after a short timeout, a 4 vCPU server helps: the CX33 (10.27 €) kept p95 at 1846 ms at the same load. Our best VPS for n8n page compares all five.
- Room for other apps. 4 GB is plenty for n8n, but not for n8n plus a local LLM or a full Supabase stack.
- Someone else's on-call. Updates, security, backups and restores are yours. n8n Cloud does that for you, from 20 € a month billed annually for 2,500 executions on Starter (n8n pricing page, 5 November 2026).
- Dedicated CPU. The CX line is shared. CPU steal was 0.0 % on test day; a busy neighbour could change that.
Cheaper than 7.97 €?
There are lower sticker prices. Read them carefully:
- Hostinger KVM 1 (1 vCPU, 4 GB): $6.49 a month only with 24 months paid upfront, renewing at $11.99 a month (Hostinger, 5 November 2026). Not yet tested in our Lab; testing is scheduled.
- InterServer, 2 slices (1 core, 4 GB): $6 a month, billed monthly, no promo stated (InterServer, 5 November 2026). Not yet tested in our Lab; testing is scheduled.
- Smaller Hetzner plans with 1 or 2 GB of RAM: we have not tested them. Our numbers make 2 GB look tight: Docker and the OS used 435 MiB on the CX23 before n8n started, and n8n peaked near 1 GB under load.
Both 1-core offers above give less CPU than the 2 vCPU server we measured, and on our servers n8n throughput rose with every vCPU up to four. We have not measured a 1 vCPU server, so we cannot tell you its ceiling. The ARM CAX11 is not a saving either: 7.25 € a month and slightly slower than the CX23 for n8n (13.9 vs 15.04 executions/s).
Is it cheaper than n8n Cloud for you?
Put in your executions and the plan you would otherwise buy:
The calculator counts money only. Add an hour or two a month for updates and checks, and value it honestly. More on the trade-off in n8n Cloud vs self-hosted.
The setup, in short
Our full timed walk-through is in install n8n on Hetzner. The parts that keep the cost low and the server safe:
1. Harden SSH and the firewall first
We run our hardening.sh before anything else: key-only SSH, ufw with ports 22, 80 and 443, fail2ban and unattended upgrades. One gotcha on Ubuntu 24.04 and 26.04: sshd starts through ssh.socket, so systemctl reload ssh fails with "ssh.service is not active". The new config still applies to new connections. Our script handles it:
sshd -t
systemctl reload ssh 2>/dev/null || echo "ssh.socket activation: config applies to new connections"
The full script, line by line, is in secure an Ubuntu VPS.
2. n8n with PostgreSQL in Docker Compose
n8n uses SQLite by default and also supports PostgreSQL. We use PostgreSQL 16 so the setup can grow into queue mode later without a migration. The .env holds four values; generate the secrets:
POSTGRES_USER=n8n
POSTGRES_PASSWORD=change-me-openssl-rand-hex-24
POSTGRES_DB=n8n
N8N_ENCRYPTION_KEY=change-me-openssl-rand-hex-32
openssl rand -hex 24 # POSTGRES_PASSWORD
openssl rand -hex 32 # N8N_ENCRYPTION_KEY
The n8n service from our production compose file, shortened (the full file also sets the host name, webhook URL, proxy hops and time zone). It binds to localhost only, and prunes executions older than 336 hours (14 days) so the 40 GB disk does not fill up:
n8n:
image: docker.n8n.io/n8nio/n8n:2.46.6
restart: unless-stopped
env_file: .env
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
N8N_RUNNERS_ENABLED: "true"
N8N_DIAGNOSTICS_ENABLED: "false"
EXECUTIONS_DATA_PRUNE: "true"
EXECUTIONS_DATA_MAX_AGE: "336"
ports:
- "127.0.0.1:5678:5678"
On our CX23 the first start took 105 s from pull to a healthy n8n, and 4.7 GB of the 38 GB disk was used after install.
3. HTTPS with Caddy
Caddy sits in front on ports 80 and 443 and proxies to 127.0.0.1:5678. Our live config and checks are in n8n behind Caddy with HTTPS.
4. Turn on backups, then test a restore
Enable backups for the server in the Hetzner console (the 1.33 € line above). A backup you have never restored is a guess, so restore one to a new server once. Keep your N8N_ENCRYPTION_KEY somewhere outside the server too: the n8n docs say n8n uses that key to encrypt credentials before saving them to the database, so a restore needs the same key.
When to stop being cheap
- Webhook callers time out or retry during bursts.
- You add another heavy app to the same server.
- Your workflows grow to more than occasional heavy Code nodes or large files.
At that point the CX33 (10.27 €, 12.32 € with backups) doubled throughput in our test, to 31.93 executions/s.
Next step: set up the 7.97 € server with our timed guide to install n8n on Hetzner.
Hetzner prices on this page include 21% VAT, as charged to our Czech (EU consumer) account by the Hetzner API on 2026-11-05. Without VAT (businesses, most buyers outside the EU): CX23 5.49 €, CX33 8.49 €, CX43 15.99 €, CAX11 5.99 €, CAX21 10.49 € per month.
FAQ
What is the cheapest way to self host n8n?
The cheapest setup we measured and would run in production is a Hetzner CX23 (2 vCPU, 4 GB, 6.64 € a month) with n8n and PostgreSQL in Docker Compose. With Hetzner's backups (20% of the server price) it costs 7.97 € a month.
Can n8n run on a 4 GB VPS?
Yes, comfortably. On our CX23 the whole server used 1036 MiB idle with n8n and PostgreSQL, and the n8n container peaked at 1003.0 MiB under 50 concurrent webhook requests.
Is self-hosted n8n free?
n8n publishes a standard self-hosted version on GitHub, and we paid nothing for the software on our server; check its licence terms for your use case. Your real costs are the server, backups and your own time for updates and security.
Can I run n8n on a 1 GB or 2 GB server?
We have not tested servers below 4 GB yet. Our numbers suggest 2 GB is tight: n8n peaked near 1 GB under load and the operating system and Docker used about 435 MiB on their own.
Sources
- Hetzner Docs, Billing FAQ (2026)
- Hetzner Docs, Backups and snapshots overview (2026)
- n8n, Pricing (checked Nov 2026)
- n8n Docs, Supported databases (2026)
- Hostinger, VPS hosting plans (checked Nov 2026)
- InterServer, VPS hosting (checked Nov 2026)
- Cloudflare, Registrar (2026)
- n8n Docs, Set a custom encryption key (2026)



