Skip to content

Instantly share code, notes, and snippets.

@nekoyokoshima
Last active July 19, 2025 12:35
Show Gist options
  • Save nekoyokoshima/67b8403e9e9fcf1d063f8ddcfaddb6de to your computer and use it in GitHub Desktop.
Save nekoyokoshima/67b8403e9e9fcf1d063f8ddcfaddb6de to your computer and use it in GitHub Desktop.
n8n over TrueNAS Scale

n8n Deployment on TrueNAS SCALE

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)

πŸ› οΈ Prerequisites

Ensure you have Docker and Docker Compose installed on TrueNAS SCALE.

Create macvlan network:

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

πŸ“¦ Docker Compose File

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

πŸ“‚ Prepare Directories

Create the required directories and set correct permissions:

mkdir -p /mnt/app-pool/n8n/local-files
chown -R 1000:1000 /mnt/app-pool/n8n

β–Ά Deploy the Stack

Run:

docker-compose up -d

🌐 Access

  • LAN: http://xxx.xxx.xxx.xxx:5678
  • Public: via Cloudflare Tunnel β†’ https://yourcustomdoamin.com

βœ… Notes

  • SSL handled by Cloudflare via tunnel (no Traefik required)
  • Persistent storage with ZFS for easy snapshots and backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment