Skip to main content
DNZ and a Caddy can start together from one docker-compose.yml and be connected from the first start:
  • DNZ’s environment declares the proxy (DNZ_PROXY_SEED_KIND=caddy), with a token you pick. The same token goes into Caddy’s dnz.json, so Caddy connects from wherever it calls, without the connect key or an approval.
  • DNZ_ZONES makes the zone at the first start.
  • Caddy’s dnz.json is written inline in the compose file (configs.content), so the compose file is the only file. That needs Docker Compose 2.23 or newer.
The same file is in the repository as deploy/caddy-stack/docker-compose.yml.

The file

Replace the values marked CHANGE. Make the proxy token with:
and put the same value in both places.
docker-compose.yml
Then point the LAN’s devices (or the router’s DHCP) at this host for DNS. See Pointing clients at DNZ.

Adding routes

Caddy has no container labels DNZ reads, so routes are made in DNZ. Each one makes the service, the router and the DNS record at once.
Open Proxy → edge → Add route, give the hostname and the upstream (http://whoami:80).
Within 10 seconds Caddy has the route, and whoami.home.example.com resolves to 192.168.1.10.

Certificates

Caddy gets HTTPS certificates itself (Let’s Encrypt or ZeroSSL), which needs the name reachable from the internet on ports 80 and 443. For names that only exist on a LAN, keep the route on http:// (--http) or upload a certificate to the proxy (TLS → Certificates). A wildcard needs Caddy built with a DNS provider module, or an uploaded certificate. See What Caddy gets.

The settings

The same DNZ_PROXY_SEED_* settings as for Traefik, with DNZ_PROXY_SEED_KIND=caddy. DNZ_PROXY_SEED_TRAEFIK_API and DNZ_PROXY_SEED_AUTO_RECORDS are for Traefik only. The fields set there are read-only in the dashboard, the API and the CLI.