How to Self-Host n8n with Docker Compose (2026 Guide)
To self-host n8n with Docker Compose you need one docker-compose.yml with the n8nio/n8n image, a named volume mounted at /home/node/.n8n, and the N8N_HOST, WEBHOOK_URL and GENERIC_TIMEZONE environment variables set — then docker compose up -d. The default setup stores everything in SQLite and speaks plain HTTP on port 5678, so this guide also covers the four things that bare file leaves out: PostgreSQL, restarting after a reboot, HTTPS, and doing it all without Traefik.
n8n is a popular open-source automation tool – like Zapier, but self-hosted. Here's how to run it on your own VPS using Docker Compose, and expose it securely over HTTPS using Caddy as the ingress proxy.
If you want a broader primer, check out How to Self-Host a Docker Compose App. But you don't need to read it first – this guide is self-contained.
🗓️ Last updated: August 2026. Tested with the latest
n8nio/n8nimage on Ubuntu 24.04.