Caddy install

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

Hi everyone,

I’m trying to install caddy on Truenas through DockGe, when I run the 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:

it returns the following error:

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

It seems that truenas uses Nginx at port 80 for the webUI by default, I tried sudo systemctl stop nginx and while it did work and let me deploy caddy, it shut down my UI for truenas.

Any idea how to work around this issue?

Any help is appreciated, thanks.

No experience with Caddy - but couldn’t you just change it from using port 80 to something else?

it binds to ports 80 and 443 for HTTP and HTTPS respectively for reverse proxy, it’s not for a webUI, so I don’t think I could change it

But you can change the webui ports of Truenas and bind them to e.g. 81 and 444

2 Likes

It binds to whatever ports you tell it to, and you could change it to anything else–but the better thing to do would be to change the web UI to something else (like 81 and 444). Here’s my guide on Caddy:

2 Likes

THIS IS IT! thank you guys so much, I think this’ll fix it

lol - I honestly expected that to be much more complicated that working around the app

Yeah dunno what I was thinking lol

you also had to do it in the old truecharts days if you were using their traefik app

Another way to do it would be to assign the web UI to one IP, and Caddy to another–but I think putting the web UI on different ports is more straightforward. You can even then proxy the web UI via Caddy, so you don’t even have to use those alternate ports.

2 Likes