Question

Caddy Service not starting

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
}

Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
June 2, 2024

Hi there,

I just updated your initial discussion here:

https://www.digitalocean.com/community/questions/web-app-not-working-with-caddy?comment=204785

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 with systemctl start caddy a second time.

The suggested solution was to find any Caddy running processes with:

ps aux | grep caddy

And kill them with kill THE_PID, and after that start Caddy with systemctl start caddy again.

Let me know how this goes!

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel