n8n Docker Compose Generator
Save your encryption key now. Copy theN8N_ENCRYPTION_KEYline from.envinto your password manager. If you lose it, every saved credential in your backups is unreadable. The key starts and ends with. Clicking Generate again creates new secrets.
.env
docker-compose.yml
Caddyfile
Using the files
- Point a DNS A record for your domain at the server. Open ports 80 and 443.
- Put the three files in one folder, e.g.
~/n8n, and runchmod 600 .env. - Run
docker compose up -d, then openhttps://your-domainand create the owner account. - Set up backups before you build workflows: How to back up n8n properly.
Full walkthrough: Self-host n8n with Docker Compose, Postgres and HTTPS. Output of this generator was checked with docker compose config and caddy validate.
Not affiliated with n8n GmbH. n8n is a trademark of its owner. Prefer not to run a server? n8n Cloud is the hosted option (n8n.io).