Caddy reload in Docker?

1. The problem I’m having:

sudo docker exec -it caddy-caddy-1 caddy reload gives me an error.

2. Error messages and/or full log output:

2026/10/09 18:57:19.125	ERROR	no config file to load

3. Caddy version:

v2.11.7 h1:yj0Y4fYZGPkSvibBJ1sTWE33xC0fxztVyXEW5iIdUT4=

4. How I installed and ran Caddy:

Docker compose at /mnt/data/Containers/Caddy. I have a Caddyfile in mnt/data/Containers/Caddy/conf. It seems to be working with my first entry in it, but I added a second entry and am getting that error when I try to reload it to apply.

a. System environment:

Ubuntu 26.04.1 LTS, x86/x64, Docker compose

b. Command:

sudo docker exec -it caddy-caddy-1 caddy reload

c. Service/unit/compose file:

services:
  caddy:
    image: caddy:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./conf:/etc/caddy
      - ./site:/srv
      - caddy_data:/data
      - caddy_config:/config

volumes:
  caddy_data:
  caddy_config:

d. My complete Caddy config:

immich.michellehm.com {
    reverse_proxy 127.0.0.1:2283
}

cloud.michellehm.com {
    header {
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
        X-Content-Type-Options "nosniff"
        Referrer-Policy "strict-origin-when-cross-origin"
        -Server
    }
    reverse_proxy 127.0.0.1:11000
}

5. Links to relevant resources:

Container info:

Container ID Image Names Command Created Status Ports
ba25dea2f39b caddy:latest caddy-caddy-1 “caddy run --config …” 21 hours ago Up 21 hours 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp, 0.0.0.0:443->443/udp, [::]:443->443/udp, 2019/tcp

Okay I think I ‘fixed’ it, though I’m not really understanding why this works when the container name shows as caddy-caddy-1, but looking back at the Caddy docker install instructions I saw that to reload you should use:

sudo docker compose exec -w /etc/caddy caddy caddy reload

and not the command from the guide I was following elsewhere (can’t remember where I saw it)

sudo docker exec -it caddy-caddy-1 caddy reload

That said, now that I have this ‘working’ - neither of these reverse proxies are working :confused:, I’m getting 502 Bad Gateway on both of them in the browser.