DockRoute
Configuration

Environment variables

Every environment variable DockRoute reads, with defaults.

DockRoute is configured entirely through environment variables — there is no config file and no database. The container is stateless and disposable.

Core

VariableDefaultDescription
DOCKER_SOCK/var/run/docker.sockDocker Engine socket path
DOCKROUTE_PROVIDERloglog (dry-run) or cloudflare
DOCKROUTE_DEFAULT_TARGETFallback record target when dockroute.target is omitted
DOCKROUTE_RESYNC_SECONDS60Interval of the periodic full reconcile

Ownership and policy

VariableDefaultDescription
DOCKROUTE_OWNER_IDdefaultOwnership id — lets several instances share a zone safely
DOCKROUTE_POLICYsyncsync, upsert-only or create-only — see Sync policies
DOCKROUTE_TXT_PREFIX_dockroute-Ownership TXT name prefix
DOCKROUTE_DOMAIN_FILTERComma-separated zone allowlist — entries are matched against provider zone names, not hostname suffixes

Set a distinct owner id per instance

If two DockRoute instances ever share a zone with the same DOCKROUTE_OWNER_ID, each will treat the other's records as its own. Give every host a unique id (home-lab, vps-1, …) and they will coexist safely — see Multiple instances.

Cloudflare

VariableDescription
CLOUDFLARE_API_TOKENToken with Zone → Zone → Read + Zone → DNS → Edit (+ Account → Cloudflare Tunnel → Edit for tunnels)
CLOUDFLARE_ACCOUNT_IDRequired for tunnel publishing
CLOUDFLARE_TUNNEL_IDRequired for tunnel publishing (an existing tunnel — you run cloudflared)

Fatal at startup

Two misconfigurations stop the container immediately instead of degrading silently: DOCKROUTE_PROVIDER=cloudflare without CLOUDFLARE_API_TOKEN, and an invalid DOCKROUTE_POLICY value.

Example

compose.yaml
services:
  dockroute:
    image: ghcr.io/dockroute/dockroute:latest
    environment:
      DOCKROUTE_PROVIDER: cloudflare
      DOCKROUTE_OWNER_ID: home-lab
      DOCKROUTE_POLICY: sync
      DOCKROUTE_DOMAIN_FILTER: example.com
      CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    group_add:
      - "990"

On this page