
Self-Host n8n with Cloudflare Zero Trust and Docker
Originally published at kjetilfuras.com When I decided to host n8n at home, I knew I didn’t want to expose it directly to the internet. I wanted a clean, secure setup — something scalable, easy to maintain, and protected without needing to open up ports on my home firewall. After testing a few approaches, I ended up building a simple and secure setup using: Docker Compose (with Traefik reverse proxy) PostgreSQL for persistent storage Cloudflare Tunnel (Zero Trust) to securely expose my services Cloudflare Access to protect the n8n UI login page This guide walks you through how I run n8n on my home server today — including the exact docker-compose.yml and .env files I use. Overview of the Setup Dockerized n8n with Traefik Cloudflare Tunnel — no open ports needed PostgreSQL backend for stability Two hostnames: one for the UI, one for webhook endpoints UI login protected with Cloudflare Access Prerequisites A Cloudflare account with your domain added A Linux server (I’m running Ubuntu 24.
Continue reading on Dev.to Tutorial
Opens in a new tab


