N8n Rock-on Config

Hi,

if there is an interest, i could think about an PR for an n8n config.

This is an working config, behind an traefik proxy.

So it would need some modifications.

{
  "n8n": {
    "containers": {
      "n8n": {
        "image": "n8nio/n8n",
        "launch_order": 1,
        "opts": [
          [
            "--network",
            "traefik-network"
          ],
          [ 
            "--label",
            "traefik.enable=true"
          ],
          [ 
            "--label",
            "traefik.http.routers.n8n.rule=Host(`n8n.domain.tld`)"
          ],
          [ 
            "--label",
            "traefik.http.routers.n8n.entrypoints=websecure"
          ],
          [ 
            "--label",
            "traefik.http.routers.n8n.tls.certresolver=cloudflare"
          ],
          [ 
            "--label",
            "traefik.http.services.n8n.loadbalancer.server.port=5678"
          ]
        ],
        "ports": {
          "5678": {
            "description": "n8n web UI (accessed via Traefik on port 443)",
            "label": "Web UI (Direct Access)",
            "host_default": 5678,
            "ui": true
          }
        },
        "volumes": {
          "/home/node/.n8n": {
            "description": "Persistent n8n data (workflow definitions, credentials, etc.)",
            "label": "Data"
          },
          "/files": {
            "description": "Persistent data for any files n8n might need to store",
            "label": "Files"
          }
        },
        "environment": {
          "N8N_HOST": {
            "description": "Hostname for n8n (must match Traefik rule)",
            "value": "n8n.domain.tld",
            "label": "N8N Host",
            "index": 1
          },
          "N8N_PORT": {
            "description": "Internal port n8n listens on",
            "value": "5678",
            "label": "N8N Port",
            "index": 2
          },
          "N8N_PROTOCOL": {
            "description": "Protocol - use https when behind Traefik with SSL",
            "value": "https",
            "label": "Protocol",
            "index": 3
          },
          "WEBHOOK_URL": {
            "description": "Public webhook URL for n8n",
            "value": "https://n8n.domain.tld",
            "label": "Webhook URL",
            "index": 4
          },
          "N8N_SECURE_COOKIE": {
            "description": "Set to false if having cookie issues behind Traefik",
            "value": "false",
            "label": "Secure Cookie",
            "index": 5
          },
          "N8N_EDITOR_BASE_URL": {
            "description": "Base URL for the n8n editor",
            "value": "https://n8n.domain.tld",
            "label": "Editor Base URL",
            "index": 6
          }
        }
      }
    },
    "description": "n8n workflow automation tool configured for Traefik reverse proxy with automatic HTTPS.",
    "more_info": "Official Docker image: <a href=\"https://hub.docker.com/r/n8nio/n8n\" target=\"_blank\">n8nio/n8n</a>. Access vi>
    "ui": {
      "slug": "",
      "https": true
    },
    "volume_add_support": false,
    "website": "https://n8n.io",
    "version": "1.0"
  }
}


1 Like

I think this could be of interest to the community. You could consider creating a Rockon that includes the traefik proxy. Or, as you seem to suggest above, as a standalone.

See: added n8n rock-on config by BrokenOnedroid · Pull Request #482 · rockstor/rockon-registry · GitHub

2 Likes