I installed Caddy following the official instructions and when I’m doing sudo systemctl start caddy
I’m getting:
× caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-06-02 13:20:21 CEST; 1min 18s ago
Docs: https://caddyserver.com/docs/
Process: 706 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 706 (code=exited, status=1/FAILURE)
CPU: 185ms
Jun 02 13:20:21 remoti-prod caddy[706]: LOGNAME=caddy
Jun 02 13:20:21 remoti-prod caddy[706]: USER=caddy
Jun 02 13:20:21 remoti-prod caddy[706]: INVOCATION_ID=c17f9e6ef1c44f43aee1e9697ebf1b31
Jun 02 13:20:21 remoti-prod caddy[706]: JOURNAL_STREAM=8:21709
Jun 02 13:20:21 remoti-prod caddy[706]: SYSTEMD_EXEC_PID=706
Jun 02 13:20:21 remoti-prod caddy[706]: {"level":"info","ts":1717327221.9778447,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
Jun 02 13:20:21 remoti-prod caddy[706]: Error: ambiguous config file format; please specify adapter (use --adapter)
Jun 02 13:20:21 remoti-prod systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jun 02 13:20:21 remoti-prod systemd[1]: caddy.service: Failed with result 'exit-code'.
Jun 02 13:20:21 remoti-prod systemd[1]: Failed to start Caddy.
The contents of my /etc/caddy/Caddyfile
I’ve trimmed to be as small as possible:
:80 {
reverse_proxy localhost:4000
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
I just updated your initial discussion here:
As per the discussion on the Caddy forum, the suggestion was that this could happen if caddy was started with
caddy start
once and then withsystemctl start caddy
a second time.The suggested solution was to find any Caddy running processes with:
And kill them with
kill THE_PID
, and after that start Caddy withsystemctl start caddy
again.Let me know how this goes!
- Bobby