Self-hosting n8n on a VPS: My Automation Stack
Why I self-host n8n workflow automation instead of paying for the cloud tier — and the honest resource cost nobody talks about.
Why self-host in the first place
I ran n8n on a $6/month VPS for about eight months before ripping it out. That sentence probably tells you more than the rest of this article, but let me unpack it anyway.
The n8n cloud tier is solid. Managed, updated, scales when you need it. For a lot of people, that's the right call. But there are two reasons I kept gravitating back to self-hosting: cost at scale, and vendor lock-in avoidance. n8n cloud pricing ramps fast once you hit even moderate workflow volume. At 50+ active workflows running several hundred executions a day, I was looking at $100+/month on the managed tier. The equivalent VPS — a $6 instance with enough headroom — cost me $18/year because I run it alongside other things.
The second reason is the one I care more about long-term: if n8n the company disappears, gets acquired, or changes their pricing model, my automations don't break. That's not hypothetical — it's happened to other workflow tools I've relied on. Self-hosting means my automations live on infrastructure I control, using software I can pin to a version I trust.
The setup: what I actually ran
My VPS is a Hetzner CX22. 2 vCPU, 4GB RAM, 80GB NVMe SSD. Ubuntu 22.04 LTS. Total cost: ~€4.15/month after tax. I run n8n, Postgres, and a few other lightweight services on it. The machine never broke a sweat with n8n alone.
Resource footprint, real numbers:
- n8n (npm install, not Docker): ~800MB RAM at idle, ~1.2GB under load
- Postgres 15: ~200MB RAM at idle
- OS + misc: ~400MB RAM
- Total baseline: ~1.4GB RAM, well within the 4GB available
The disk footprint is less flattering. n8n plus its node modules, Postgres data directory, and the workflow export backups I keep: 2.6GB total. If you're on a cramped VPS with a 20GB disk, that's not nothing.
Installing via npm
The npm route is what I used. It's straightforward:
# Node.js 20 LTS
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install n8n globally
npm install -g n8n
# Start it
n8n start That gets you a running instance. For production, you'll want a process manager. I use systemd:
[Unit]
Description=n8n workflow automation
After=network.target postgresql.service
[Service]
Type=simple
User=ubuntu
Environment="WEBHOOK_URL=https://n8n.yourdomain.com"
Environment="N8N_PROTOCOL=https"
Environment="N8N_PORT=5678"
ExecStart=/usr/bin/n8n start
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target Point that at your domain, set up nginx as a reverse proxy with a Let's Encrypt certificate, and you have a working HTTPS setup in about 20 minutes.
The npm install approach is lighter than Docker — no container overhead, marginally less RAM. The tradeoff is that you're responsible for updating n8n manually (npm update -g n8n). For a tool that ships security patches regularly, that's worth putting on a calendar.
Docker alternative
If you want clean isolation and easier updates, Docker is the better path. I ran Docker for the first few months:
# docker-compose.yml
version: '3'
services:
## When self-hosting makes sense (and when it doesn't)
My honest take after eight months: self-host n8n if you already have a VPS running Postgres and you're comfortable maintaining Linux packages. The $6/month VPS scenario works when your automation stack is simple — a few scheduled workflows, maybe a webhook or two.
But for anything beyond 10 active workflows, the maintenance overhead of database backups, n8n upgrades, and dependency management starts eating into the cost advantage. At that point, n8n Cloud at $20-99/month starts looking reasonable — especially when you factor in your time.
## The real cost breakdown
| Component | Self-hosted | n8n Cloud |
|---|---|---|
| Hosting | $6/month VPS | $20-99/month |
| Maintenance | ~2h/month manual | $0 |
| Upgrades | Manual (apt/npm) | Automatic |
| Backups | DIY (pg_dump) | Built-in |
| SSL/Certificates | DIY (Caddy/LetsEncrypt) | Built-in |
| Uptime | Your problem | Their problem |
The verdict: self-host for prototyping and personal workflows. Move to cloud when automations start generating revenue worth protecting.
---
## Automate your revenue
I build production automation pipelines for founders who want to stop doing manual operations work. If n8n — or any automation stack — could save your team 10+ hours a week, let's talk.
[Book a free Technical AI Audit →](https://calendly.com/rizrizawan/30min)
*Full disclosure: This article contains affiliate links for n8n. If you sign up through them, I earn a commission at no extra cost to you. I'm sharing this because I actually ran this setup in production — not because someone paid me to.*