Caddy Docker failed to bind on restart

1. The problem I’m having:

Using an old computer to run a small home hobby server, & there have been several power loss incidents lately. The server machine was rebooted recently & now I cannot reach the website from the domain name & pings are host unreachable (I have already ruled out any config problems with the webserver app, networking, & domain). This machine is not running nginx, apache, or similar, nor has it ever had them installed.

Ideally I am looking for a setup that when the machine (re)boots docker automatically starts the containers for caddy & the other app without any need for direct interaction beyond troubleshooting. Power on; server’s up kinda deal. Though, I realize that’s beyond the scope of this single error.

2. Error messages and/or full log output:

Output when I run docker compose up -d

Error response from daemon: driver failed programming external connectivity on endpoint docker-caddy-1 (15dbab547a8c595f29f89164fcbb5bb4389b03dfbf2dc71daccdfa869bda7fcb): failed to bind port 0.0.0.0:80/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

3. Caddy version:

caddy 2.6.2

4. How I installed and ran Caddy:

Installed in a docker container.

a. System environment:

Docker running on debian 12

b. Command:

docker compose up -d

c. Service/unit/compose file:

docker-compose.yml

# version: "3"

volumes:
  caddy_data:
  caddy_config:

services:
  caddy:
    image: caddy:latest
    restart: unless-stopped
    ports:
      - "80:80"
#      - "8080:8080"
      - "443:443"
      - "443:443/udp"
    volumes:
      - /home/captain/share/caddy/Caddyfile:/etc/caddy/Caddyfile
#      - ./site:/srv
      - caddy_data:/data
      - caddy_config:/config

d. My complete Caddy config:

Caddyfile

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

foundry.theivoryguard.com {
        # debug
        debug
        # log function settings
        log {
                level INFO
                output file "/data/logs/access.log" {
                        roll_size 10MB
                        roll_keep 10
                }
        }
        # reverse proxy settings
        reverse_proxy foundry:30000
}

5. Links to relevant resources:

¯\(ツ)

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