This setup runs n8n on TrueNAS SCALE using Docker Compose with:
- macvlan networking for LAN IP isolation
- Persistent storage on ZFS dataset
- Cloudflare Tunnel for remote access (no Traefik)
Ensure you have Docker and Docker Compose installed on TrueNAS SCALE.
docker network create -d macvlan \
--subnet=192.168.0.0/24 \
--gateway=192.168.0.254 \
--ip-range=192.168.0.128/27 \
-o parent=enp0s31f6 \
macvlan_lan
Save this as docker-compose.yml
:
version: "3.7"
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
container_name: n8n
networks:
macvlan_lan:
ipv4_address: xxx.xxx.xxx.xxx
environment:
- N8N_HOST=yourcustomdoamin.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://yourcustomdoamin.com/
- GENERIC_TIMEZONE=Europe/Malta
- PUID=1000
- PGID=1000
ports:
- "5678:5678"
volumes:
- /mnt/app-pool/n8n:/home/node/.n8n
- /mnt/app-pool/n8n/local-files:/files
restart: unless-stopped
networks:
macvlan_lan:
external: true
Create the required directories and set correct permissions:
mkdir -p /mnt/app-pool/n8n/local-files
chown -R 1000:1000 /mnt/app-pool/n8n
Run:
docker-compose up -d
- LAN:
http://xxx.xxx.xxx.xxx:5678
- Public: via Cloudflare Tunnel β
https://yourcustomdoamin.com
- SSL handled by Cloudflare via tunnel (no Traefik required)
- Persistent storage with ZFS for easy snapshots and backup