netstack

edit

n8n install

The subdomain to serve from

SUBDOMAIN=n8n

The above example serve n8n at: https://n8n.example.com

Optional timezone to set which gets used by Cron and other scheduling nodes

New York is the default value if not set

GENERIC_TIMEZONE=America/Chicago

The email address to use for the TLS/SSL certificate creation

SSL_EMAIL=user@example.com

- docker-compose.yaml (cat mod to Jims Garage pattern)
```yaml
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
    environment:
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - N8N_RUNNERS_ENABLED=true
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - TZ=${GENERIC_TIMEZONE}
    volumes:
      - /home/nsadmin/code/docker/n8n/n8n_data:/home/node/.n8n
      - /home/nsadmin/code/docker/n8n/local-files:/files
    networks:
      proxy:

networks:
  proxy:
    external: true

volumes: n8n_data: traefik_data:

- Start n8n-Docker Compose in docker/n8n-compose dir
```bash
sudo docker compose up -d