n8n
This example shows a small, practical Docker Compose setup for n8n, the open-source workflow automation tool.
The stack includes:
- A single n8n container
- Persistent storage via a Docker volume
- Local-only port binding for safety
- Simple reverse-proxy instructions (Caddy example)
1. docker-compose.yml
Create a folder and add:
services:
n8n:
image: n8nio/n8n:latest
restart: always
ports:
- "127.0.0.1:5678:5678"
environment:
- N8N_HOST=n8n.example.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
Start the stack:
docker compose up -d
2. Add a Reverse Proxy (Caddy example)
If you want HTTPS, add a simple Caddyfile:
n8n.example.com {
reverse_proxy localhost:5678
}
Reload Caddy:
systemctl reload caddy
3. Optional: Auto-Start with systemd
# /etc/systemd/system/n8n.service
[Unit]
Description=n8n workflow automation (Docker Compose)
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/root/n8n
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Enable it:
systemctl enable n8n
systemctl start n8n
4. Deploy on Hostim.dev Instead
If you prefer not to maintain servers or proxies:
- Create a project on Hostim.dev
- Choose Paste Docker Compose
- Insert the YAML from this example
The platform handles HTTPS, domains, restarts, logs, and persistence automatically.