n8n
v1.0.0Workflow automation platform for connecting APIs, services, and custom logic.
automation by getarcaneapp
x-arcane:
icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/n8n.svg
urls:
- https://n8n.io/
- https://github.com/n8n-io/n8n
services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -h localhost -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
labels:
com.getarcaneapp.arcane.icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/postgresql.svg
n8n:
image: docker.n8n.io/n8nio/n8n:${N8N_VERSION:-stable}
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "${APP_PORT:-5678}:5678"
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
DB_POSTGRESDB_USER: ${POSTGRES_USER}
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
GENERIC_TIMEZONE: ${GENERIC_TIMEZONE:-Etc/UTC}
TZ: ${GENERIC_TIMEZONE:-Etc/UTC}
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
N8N_HOST: ${N8N_HOST}
N8N_PORT: 5678
N8N_PROTOCOL: ${N8N_PROTOCOL:-http}
N8N_SECURE_COOKIE: ${N8N_SECURE_COOKIE:-false}
WEBHOOK_URL: ${WEBHOOK_URL}
N8N_RUNNERS_MODE: external
N8N_RUNNERS_AUTH_TOKEN: ${RUNNERS_AUTH_TOKEN}
N8N_RUNNERS_BROKER_LISTEN_ADDRESS: 0.0.0.0
volumes:
- n8n-data:/home/node/.n8n
labels:
com.getarcaneapp.arcane.icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/n8n.svg
n8n-runner:
image: n8nio/runners:${N8N_VERSION:-stable}
restart: unless-stopped
depends_on:
- n8n
environment:
N8N_RUNNERS_AUTH_TOKEN: ${RUNNERS_AUTH_TOKEN}
N8N_RUNNERS_TASK_BROKER_URI: http://n8n:5679
labels:
com.getarcaneapp.arcane.icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/n8n.svg
volumes:
postgres-data:
n8n-data:
APP_PORT=5678
N8N_VERSION=stable
POSTGRES_USER=n8n
POSTGRES_PASSWORD=change-this-postgres-password
POSTGRES_DB=n8n
GENERIC_TIMEZONE=Etc/UTC
N8N_ENCRYPTION_KEY=replace-with-a-random-32-character-key
RUNNERS_AUTH_TOKEN=replace-with-a-random-runner-token
N8N_HOST=localhost
N8N_PROTOCOL=http
N8N_SECURE_COOKIE=false
WEBHOOK_URL=http://localhost:5678/
README
Change all database passwords, N8N_ENCRYPTION_KEY, and RUNNERS_AUTH_TOKEN before using this template for real workflows.
Set N8N_HOST, N8N_PROTOCOL, and WEBHOOK_URL to the externally reachable URL if webhooks or OAuth callbacks will be used.