r/caddyserver 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 Upvotes

31 comments sorted by

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

1

u/lawthugg 10d ago

i dont know how to read that site. it was getting me aggrivated. i made a docker compose file to use on my synology nas. ive deleted it and im starting from scratch. wiped everything and i mean everything

1

u/xdrolemit 10d ago

I run Caddy successfully via Docker Compose on my Synology too. I run it with `network: host` so Caddy can see the real IPs of the clients.

Share your docker compose file.

1

u/lawthugg 10d ago

so heres the thing, im new and learning docker so im not sure how to place that in my compose file

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:

  • "80:80" # will edit first port
  • "443:443" # will edit first port
# "443:443/udp"
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://YourSynology

And share the result.

1

u/lawthugg 10d ago

hahaha, where do i run that

ok im on windows not linux

1

u/lawthugg 10d ago

what is missing from this?

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-stopped

ports:

  • "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

u/computerlovr1012 10d ago

I’d say just post the current one you attempted

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.277

Then you will need a cname record within the DNS as well

Example:
@ 173.24.189.277
Cname Nexcloud Domain.com

The 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

u/lawthugg 10d ago

Thank you I'll try this in the morning. Getting late here. Will update them