How to Self-Host n8n on a $6 VPS (And When You Shouldn’t)
The exact setup I use for client instances: Docker Compose, Caddy for HTTPS, the two things you must back up, and the honest checklist for whether to self-host at all.
Self-hosted n8n is the cheapest way to run serious automation — free software, unlimited workflow runs, on a server that costs less than two coffees a month. It’s also a small commitment people underestimate, and I’d rather you know both halves before you start. This is the setup I use for client instances: what to buy, the exact configuration, the two things you must back up, and the honest checklist for whether you should be doing this at all.
What you need
Three things: a small VPS, a domain (or subdomain like n8n.yourbusiness.com), and about an hour. For the server, any provider works — Hetzner and DigitalOcean are the usual picks at roughly $5–7 a month. Two gigabytes of RAM is comfortable; one works for a handful of light workflows. Don’t overbuy: n8n idles at almost nothing, and you can resize a VPS later in minutes.
The whole thing runs in Docker, which is the part that makes self-hosting sane: one configuration file describes the install, updates are two commands, and nothing you do contaminates the server itself.
The setup
On a fresh Ubuntu server with Docker installed, create a folder and put this in docker-compose.yml:
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
ports:
- "127.0.0.1:5678:5678"
environment:
- N8N_HOST=n8n.yourbusiness.com
- WEBHOOK_URL=https://n8n.yourbusiness.com/
- N8N_ENCRYPTION_KEY=a-long-random-string-you-generated
- GENERIC_TIMEZONE=Asia/Dhaka
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
Three details in there earn their own sentences. The port is bound to 127.0.0.1, which means n8n is not reachable from the internet directly — that’s deliberate, and the reverse proxy below is the only way in. WEBHOOK_URL must be your real HTTPS address, or every webhook trigger you build will hand out wrong URLs. And N8N_ENCRYPTION_KEY is the key that encrypts every credential you store — generate something long and random once, and never change it casually.
For HTTPS, put Caddy in front. Its entire configuration for this job is three lines, and it fetches and renews the certificate itself:
n8n.yourbusiness.com {
reverse_proxy 127.0.0.1:5678
}
Start both, open your subdomain, and n8n walks you through creating the owner account. That account is your login security — use a real password, because this page is on the public internet now. From here, updating is docker compose pull && docker compose up -d; skim the release notes first when the version number jumps a major.
The two things you must back up
Here’s the mistake that actually hurts people, so it gets its own section. An n8n instance has two pieces worth protecting: the data volume (your workflows, credentials and execution history) and the encryption key from the compose file. Back up the volume without the key and your restore will come up with every stored credential unreadable — the workflows return, but every connection to Gmail, your CRM and your spreadsheets has to be re-authorised by hand. Copy the key into your password manager the day you set this up, and snapshot the volume on a schedule (most VPS providers sell automated snapshots for about a dollar a month — buy it). Exporting your workflows as JSON now and then is a nice belt-and-braces habit, but the volume plus the key is the real backup.
The small maintenance reality
Self-hosting isn’t set-and-forget, but it’s close. The honest monthly reality is: apply server updates, pull the new n8n image, and glance at whether anything failed. Build your workflows with error handling and alerts from day one — here’s how I design that — and the instance will mostly tell you when it needs attention rather than failing silently. An automation server nobody looks at is a liability, because by definition it’s doing work someone depends on.
When you shouldn’t self-host
Skip all of the above if any of these is true: nobody on the team has ever SSH’d into a server and nobody wants to learn; your volume is small enough that Zapier’s free tier or Make’s cheap plans cover it; or the workflows are business-critical enough that “I’ll look at it this weekend” isn’t an acceptable incident response. n8n Cloud at about €24 a month exists precisely for that middle ground — managed for you, still execution-priced. And if you want self-hosted economics with someone accountable for the running of it, that’s a service I provide: I set n8n up on your server, under your accounts, and can keep managing it under an optional retainer.
Key takeaways
- A $5–7 VPS, Docker Compose, and Caddy for HTTPS gets you unlimited-run n8n for the price of the server (prices checked August 2026).
- Bind n8n to localhost, put the proxy in front, and treat the owner-account password as real security — the editor is on the public internet.
- The backup is the data volume plus the encryption key. A volume without the key restores workflows with every credential dead.
- Budget an hour a month of honest upkeep, and build alerts into the workflows themselves.
- If nobody wants to own a server, that’s fine — n8n Cloud or a managed setup beats a neglected instance every time.
Want the setup done for you — workflows included? Book a free intro call and tell me what you’re trying to automate; a single workflow starts around $600, self-hosting guidance included.