Self-Hosting n8n on a VPS with PostgreSQL, Docker, and SSL
Why I Self-Hosted n8n
n8n is awesome — it lets you build automations visually, like Zapier but open-source. The hosted version is great, but I wanted:
- Unlimited executions without hitting a paywall
- Full control over data and privacy
- A setup that could scale beyond just one user
So I spun it up on my own VPS. Cheap, fast, and totally mine.
The Setup I Went With
The default local setup for n8n uses SQLite, which is fine for one-person experiments. But I wanted multi-user support, so I wired it up to PostgreSQL from the start. That gives a more solid foundation — better for teams and more resilient in general.
Deployment-wise, I went with Docker. A single docker-compose.yml, a couple of environment tweaks, and it was live. It’s lightweight enough that even a modest VPS handles it comfortably.
Clean URL and SSL
To make it feel production-grade, I set it up under a subdomain using Nginx as a reverse proxy. Then added a free SSL cert via Certbot..
Cost Savings vs. Maintenance Tradeoffs
Hosting n8n myself saves real money — no per-execution billing, no platform tax. But the flip side? You’re the sysadmin now.
Luckily, updates are dead simple. A docker pull and docker-compose up -d refreshes the whole thing with near-zero downtime. It’s not totally “set and forget,” but it’s close.
Tools I Used
- n8n – the open-source automation engine
- Docker & Docker Compose – for deployment and updates
- PostgreSQL – to enable multi-user support
- Nginx – reverse proxy to serve over a custom subdomain
- Certbot – free SSL for HTTPS
- Ubuntu VPS – lightweight server, cost-effective
What I’d Improve Next Time
- Add basic monitoring/logging (maybe via Grafana or Uptime Kuma)
- Set up automatic backups for PostgreSQL (just in case)