Dockge behind Caddy

Verified · Caddy 2.8

Config + gotchas checked against the official Dockge docs and the issues people actually hit · 2026-06-07

A Caddy reverse-proxy setup for Dockge, with automatic HTTPS on dockge.example.com. Copy it, swap the domain — the gotchas that trip people up are solved below.

New to reverse proxies? Start with the Caddy + Docker guide.

Caddyfile
# Caddyfile for Dockge
# Replace dockge.example.com with your real domain. Caddy issues TLS automatically.

dockge.example.com {
	encode zstd gzip
	reverse_proxy dockge:5001
}

Replace dockge.example.com with your domain. Your DNS A record must already point at the server.

Gotchas

What trips people up

The UI loads but stays disconnected, or a remote agent will not connect through the proxy.

Dockge talks to its backend (and remote agents) over WebSockets. Caddy preserves the Upgrade headers automatically, so this block works as-is — the failures people hit are with proxies that strip Upgrade. Do not enable response buffering in front of it.

Dockge is reachable on the LAN IP:5001 but not behind the domain.

Don't publish port 5001 to the public internet — reach Dockge only through the HTTPS proxy. Confirm the dockge container and Caddy share the `proxy` network, and open the https domain, not the container IP.

Deploy

How to deploy

  1. Create the shared proxy network once: `docker network create proxy`.
  2. Start the stack: `docker compose up -d`.
  3. Point dockge.example.com at the server; open the HTTPS URL and create your admin account on first visit.

Runnable

Full runnable stack

Dockge + Caddy + the shared network, in one compose file — so it runs on the first try, not after you stitch the proxy in yourself. Save the Caddyfile above next to it.

docker-compose.yml (app + Caddy)
# docker-compose.yml — Dockge + Caddy, ready to run.
# Pin caddy to a digest for production: caddy:2.8-alpine@sha256:<digest>
# 1. Save the Caddyfile above as ./Caddyfile
# 2. docker network create proxy
# 3. docker compose up -d
services:
  dockge:
    image: docker.io/louislam/dockge:1.5.0@sha256:335c6368b880ecc203236ed89e6e5232e0d6578e8ef5920e4a502390451502bf
    restart: unless-stopped
    environment:
      DOCKGE_STACKS_DIR: ${STACKS_DIR}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - dockge-data:/app/data
      - ${STACKS_DIR}:${STACKS_DIR}
    networks:
      - default
      - proxy
  caddy:
    image: caddy:2.8-alpine
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data
      - caddy-config:/config
    networks:
      - proxy
volumes:
  dockge-data: {}
  caddy-data: {}
  caddy-config: {}
networks:
  proxy:
    external: true

Full Dockge stack (compose + env + docs)