Problem with with caddy

1. Caddy version (caddy version):


2. How I run Caddy:


a. System environment:

Raspberry OS Systemd

b. Command:

sudo caddy start

c. Service/unit/compose file:


d. My complete Caddyfile or JSON config:


3. The problem I’m having:

caddy service doesn’t start

4. Error messages and/or full log output:

I installed caddy and it worked. I tried to make it run self hosted apps with SSL with no DNS, basically when I got to I wanted it to be ssl’d. encountered many problems and had to restart it several times and then suddenly It doesn’t work anymore, “caddy start” shows no problem but it doesn’t really work (going to local IP doesn’t show anything) and systemctl status show a problem. I messed up with random caddy files and folders (don’t remember what tho) but nothing worked, I did sudo apt purge command and installed caddy again but the problem persists.

this is systemctl status error

● caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-04-23 00:16:55 BST; 4s ago
Docs: Welcome — Caddy Documentation
Process: 1185150 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 1185150 (code=exited, status=1/FAILURE)
CPU: 80ms

Apr 23 00:16:55 raspberrypi caddy[1185150]: HOME=/var/lib/caddy
Apr 23 00:16:55 raspberrypi caddy[1185150]: LOGNAME=caddy
Apr 23 00:16:55 raspberrypi caddy[1185150]: USER=caddy
Apr 23 00:16:55 raspberrypi caddy[1185150]: INVOCATION_ID=b62b8b22cfed4928938779bac0b10073
Apr 23 00:16:55 raspberrypi caddy[1185150]: JOURNAL_STREAM=8:2784864
Apr 23 00:16:55 raspberrypi caddy[1185150]: {“level”:“info”,“ts”:1650669415.8768725,“msg”:“using provided configuration”,“config_file”:"/etc/caddy/Caddyfile",“config_adapter”:""}
Apr 23 00:16:55 raspberrypi caddy[1185150]: run: loading initial config: loading new config: starting caddy administration endpoint: listen tcp bind: address already in use
Apr 23 00:16:55 raspberrypi systemd[1]: Started Caddy.
Apr 23 00:16:55 raspberrypi systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Apr 23 00:16:55 raspberrypi systemd[1]: caddy.service: Failed with result ‘exit-code’.

5. What I already tried:

I purged caddy and reinstalled it

6. Links to relevant resources:

Don’t use caddy start if you’re also using systemd. Those are two separate ways of running Caddy, and aren’t compatible. If you use caddy start, then it starts Caddy as a background process. Then when you try to start the systemd service, it can’t run because there’s already another instance of Caddy running.

Run caddy stop once for now, then never run caddy start again. Then, run sudo systemctl start caddy to make sure it’s running as a systemd service. Follow these instructions for information on how to use it past that point:

Also, don’t use systemctl status caddy to read your logs, because that command will truncate your logs (notice the > at the end of some log lines). Instead, use the command mentioned in the docs above :point_up:

I actually purged caddy again, will try to install through docker now, ig it’s better.

also I actually zoomed out so O get the full systemctl log

Running Caddy in Docker will only give you benefits if you’re trying to use it to serve other things already in Docker.

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