Trying to setup runners in external mode with docker compose

Describe the problem/error/question

I want to setup n8n using runners to offload tasks. I use docker compose along with an nginx reverse proxy.

I receive the following error message:

Error: command /usr/local/bin/task-runner-launcher not found

This is my docker-compose.yml

x-shared: &shared
  restart: always
  image: docker.n8n.io/n8nio/n8n
  env_file:
      - .env
  extra_hosts:
    - "host.docker.internal:host-gateway"
  volumes:
    - n8n_data:/home/node/.n8n
    - ./local-files:/files

services:
  n8n:
    <<: *shared
    ports:
      - "5678:5678"
    environment:
      - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
      - N8N_RUNNERS_ENABLED=true
      - N8N_RUNNERS_MODE=external

  n8n-runner-1:
    image: docker.n8n.io/n8nio/n8n
    command: ["/usr/local/bin/task-runner-launcher", "javascript"]
    env_file:
      - .env
    environment:
      - N8N_RUNNERS_TASK_BROKER_URI=n8n:5679
      - N8N_RUNNERS_MAX_CONCURRENCY=5
      - N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT=15
      - NODE_OPTIONS=--max-old-space-size=512
    depends_on:
      - n8n
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5680/healthz"]
      interval: 30s
      timeout: 10s
      retries: 3

volumes:
  n8n_data:

And this is my .env

# App
DOMAIN_NAME=example.com
SUBDOMAIN=n8n
GENERIC_TIMEZONE=Europe/Berlin
NODE_ENV=production
WEBHOOK_URL=https://n8n.example.com/

# N8N
N8N_ENCRYPTION_KEY=fo0Bar
N8N_PROTOCOL=https
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true

# Runners
N8N_RUNNERS_AUTH_TOKEN="my-custom-token"
N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0

# S3 Storage
N8N_EXTERNAL_STORAGE_S3_HOST=...
N8N_EXTERNAL_STORAGE_S3_BUCKET_NAME=...
N8N_EXTERNAL_STORAGE_S3_BUCKET_REGION=...
N8N_EXTERNAL_STORAGE_S3_ACCESS_KEY=...
N8N_EXTERNAL_STORAGE_S3_ACCESS_SECRET=...

# Postgres
DB_POSTGRESDB_USER=...
DB_POSTGRESDB_PASSWORD=...
DB_POSTGRESDB_DATABASE=...
DB_POSTGRESDB_HOST=...
DB_POSTGRESDB_PORT=...
DB_TYPE=postgresdb

QUEUE_BULL_REDIS_HOST=...
QUEUE_BULL_REDIS_PORT=...
EXECUTIONS_MODE=queue

Information on your n8n setup

  • n8n version: 1.97.1
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker compose
  • Operating system: Ubuntu 24.04
1 Like

Hey @Fabian_Hagen

It seems this is because of the entry point n8n/docker/images/n8n/docker-entrypoint.sh at master · n8n-io/n8n · GitHub in the docker image, which puts n8n infront of each command, so calling task-runner-launcher, won’t work.

you can workaround this using entrypoint: ["/bin/sh", "-c", "/usr/local/bin/task-runner-launcher javascript;"] and not command

Hope this helps,

Samuel

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.