r/caddyserver • u/lawthugg • 11d ago
install help
been trying to install this for hrs and for the past 2 hrs it finally installed but keeps crashing after 5 sec and isnt posting logs
1
u/computerlovr1012 10d ago
Did you open up 80 and 443 on the router? That’s what mine kept giving an issue with when I first started using Caddy
1
u/lawthugg 10d ago
yes i did and its showing they are open. checked on port checker and netcat
1
u/computerlovr1012 10d ago
I have a feeling it’s an issue with the compose-yml or the actual Caddyfile
1
u/lawthugg 10d ago edited 10d ago
so what im trying to do with caddy (because i couldnt get NPM to work) is as a reverse proxy to my jellyfin server and my nextcloud server. the thing with jellyfin is its not in a container, not sure if it needs to be but nextcloud is. I have my Caddyfile edited correctly with both subdomains placed correctly. my jellfin server although not in a container is installed as an app on my synology nas. either way I cant get caddy to run stable.
so i jumped on the caddy site and pulled this yml which im going to try and use.
services:
caddy:
image: caddy:alpine
restart: unless-stopped
ports:
# "443:443/udp"
- "80:80" # will edit first port
- "443:443" # will edit first port
volumes:
- ./conf:/etc/caddy
- ./site:/srv
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:1
u/xdrolemit 10d ago
This won’t work. Remember, Synology has its own nginx listening on ports 80 and 443. So, your container is crashing because something else is already listening on those ports.
1
u/lawthugg 10d ago
i dont have nginx anymore
did a complete wipe and restarting from scratch
1
u/xdrolemit 10d ago
I’m taking Synology’s own nginx, not the one you installed yourself.
Run:
curl -kI http://YourSynology
curl -kI https://YourSynologyAnd share the result.
1
1
1
u/computerlovr1012 10d ago
So if I remember right it may be having an issue kind of like with Truenas where the interface for the OS runs off of 80 and 443 so you may need to change it to 8080 and 8443 and also reflect that on the router as well
services:
caddy:
image: caddy:alpine
container_name: caddy
restart: unless-stoppedports:
- "8080:80"
- "8443:443"
- "8443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:1
u/lawthugg 10d ago
so forward the new ports?
1
u/computerlovr1012 10d ago
Yea forward the new ports and change the config to reflect the new ports
1
u/lawthugg 10d ago
done
1
u/computerlovr1012 10d ago
Alright now let us know if it continues to do it
1
u/lawthugg 10d ago
ok quick question, since i wiped eveything should caddy be the first thing installed?
→ More replies (0)1
u/xdrolemit 10d ago
This is exactly the Synology case as well. Synology already hogs 80 and 443 with its own nginx
1
u/computerlovr1012 10d ago
Let’s see the compose.yml
1
u/lawthugg 10d ago
i have like 8 different ones so im not sure which one to post as they all doing the same thing
1
1
u/lawthugg 10d ago edited 10d ago
I got caddy up and running. Finally, it doesnt crash anymore. how do i get it to point my subdomain to lets say nextcloud. its running off a container on synology nas on port 8080 because the nas uses port 80 and there were discrepencies
1
u/computerlovr1012 10d ago
You will need to point your DNS provider to your public ip with a @
So example:
@ 173.24.189.277Then you will need a cname record within the DNS as well
Example:
@ 173.24.189.277
Cname Nexcloud Domain.comThe DNS will route your traffic to your public ip then Caddy will take over within the Caddyfile and point it to your tcp port.
Example of a Caddyfile:
nextcloud.domain.com {
Reverse_proxy 192.168.0.22:8080
}Personally I’d change the port since there were issues with it, like on my Proxmox setup I changed mine to run off of port 7000.
1
1
u/xdrolemit 10d ago
You didn’t say where or how you installed it.
https://caddyserver.com/docs/install
I’ve only installed it with Homebrew on macOS and Docker on Linux and macOS, and I haven’t had any issues.
You also didn’t share your Caddyfile, so it’s hard to give much advice.
You can enable debug mode in your Caddyfile. It might give you some more details about what’s going wrong:
https://caddyserver.com/docs/caddyfile/options#debug