Self-Host n8n on a VPS with Docker and HTTPS
Run your own n8n automation server on a cheap VPS, secured with HTTPS and persistent backups, in under an hour.
No-Code & AutomationPDF · 8 pages· v1.0
4.4Run your own n8n automation server on a cheap VPS, secured with HTTPS and persistent backups, in under an hour.
No-Code & AutomationPDF · 8 pages· v1.0
4.4n8n Cloud is convenient, but self-hosting gives you unlimited workflow executions, full data privacy, and a flat monthly cost. This guide takes you from a blank Ubuntu VPS to a production-grade n8n instance reachable over HTTPS at your own domain, running in Docker with persistent storage and a working backup routine. It's written for technically comfortable founders, indie hackers, and operators who can use SSH and edit a config file, but who want a clear, correct path rather than piecing it together from forum posts. The example uses a $5-6/month VPS (DigitalOcean, Hetzner, or similar) and a domain you control. Every step is real and current: provisioning the server, installing Docker, running n8n with Docker Compose, putting Caddy in front as a reverse proxy that auto-provisions a Let's Encrypt TLS certificate, persisting data in a Docker volume, and locking down the firewall. It also covers the environment variables that catch people out - the webhook URL, timezone, and encryption key that protects your stored credentials. After completing it you'll have a private, HTTPS-secured n8n you fully own, with automatic certificate renewal and a backup you can actually restore.
A 1-2 GB RAM VPS at $5-7/month from providers like DigitalOcean or Hetzner comfortably runs n8n for personal and small-team use. There are no per-execution fees, unlike n8n Cloud.
For HTTPS, yes. Caddy provisions a free Let's Encrypt certificate for a domain you point at the server. The guide shows the single DNS A record you need to add.
n8n encrypts saved credentials with N8N_ENCRYPTION_KEY. If you lose it or change it, every stored credential becomes unreadable. The guide tells you to set it explicitly and back it up - this is the number-one self-hosting mistake.
n8n keeps its data in a Docker volume (and optionally a database). The guide includes a tar-based backup of the volume plus the encryption key, and the exact restore steps to bring it back on a new server.
Read the full refund policy and trust & safety terms.