Guides ยท Sep 27, 2026
How to Self-Host n8n on a VPS with Docker and HTTPS
Self-host n8n with Docker Compose and Caddy for automatic HTTPS on your own domain, with persistent data and easy updates.
Self-hosting n8n gives you unlimited workflows on your own server. Chose the Debian 12 + n8n image at checkout? n8n is already installed and you can skip ahead to securing it. Otherwise, follow along with Docker. Point a domain such as n8n.example.com at your server first.
1. Install Docker
Follow our Docker install guide, or pick the Debian 12 + Docker image.
2. Create the Compose file
mkdir ~/n8n && cd ~/n8n
Create compose.yaml (replace the domain and timezone):
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
environment:
- N8N_HOST=n8n.example.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.example.com/
- GENERIC_TIMEZONE=America/New_York
volumes:
- n8n_data:/home/node/.n8n
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
command: caddy reverse-proxy --from n8n.example.com --to n8n:5678
volumes:
- caddy_data:/data
volumes:
n8n_data:
caddy_data:
3. Start it
docker compose up -d
docker compose logs -f n8n
Caddy fetches a free HTTPS certificate automatically. Open https://n8n.example.com and create your owner account. Do this right away, since the first person to visit sets it up.
4. Updating n8n
docker compose pull && docker compose up -d
Keep it safe
- Your workflows live in the
n8n_datavolume and are included in your server's daily backups. - Use strong passwords; n8n stores credentials for all your connected apps.
Need a server for this?
Every TidalVPS VPS comes with full root access, unmetered traffic, daily backups and DDoS protection.