Port 80 in use already

1. The problem I’m having:

Trying to deploy Caddy on my TrueNas Scale server, but it looks like TrueNas uses Nginx for Web UI causing for the docker compose to not deploy. Is there any workaround or any way to fix this? All help is appreciated

2. Error messages and/or full log output:

[+] Running 0/1
⠙ Container cadd-caddy-1 Starting 0.2s
Error response from daemon: driver failed programming external connectivity on endpoint cadd-caddy-1 (e6d3b950dcd6dbd6b494dc48d44d6df10655d422873758d9641aca11fae788ee): 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

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

Latest

4. How I installed and ran Caddy:

Docker compose through DockGe which is also installed on my truenas server, following yaml:
services:
caddy:
image: caddy:latest
working_dir: /mnt/NAS 16TB 2 Vdevs Mirrored /arr-apps/caddy v2
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:

a. System environment:

Operating system: TrueNas Scale ElectricEel-24.10.2.4
Docker environment: DockGe | App Version: 1.5.0 | Version: 1.2.14

b. Command:

Just the compose yaml above

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

N/A

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

N/A

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

Using this Keep Caddy Running — Caddy Documentation

1 Like

Solved, changed truenas default port

1 Like

Your other option would be to change the port 80 in your docker compose file. So, instead of this:

you would have something like this:

- “8080:80”
- “443:443”
- “443:443/udp”

This way, Caddy would listen on port 8080 on your NAS.

Got it working, thanks! Unfortunately now it’s having issues locating the dockerfile, likely an issue with how Truenas works and DockGe, been at it for about 5 hours today so gonna take a break and try again tomorrow.

1 Like

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