How to reload caddy so that it reads the /etc/caddy Caddyserver file changes and updates itself

Latest version of Caddy here. What I am trying to do is not do the following every time I update the Caddyfile in /etc/caddy:

killall caddy
rm ~/.config/caddy/caddyfile.json
caddy stop
caddy start

So like an option to change the Caddyfile and then do caddy reload without having to delete files or kill a process. The idea is for me to add a new domain or update an existing domain and then the reload or whatever command can refresh the current running process.

You just need to run caddy reload --config /etc/caddy/Caddyfile

How did you install Caddy?

Please fill out the help topic template, I can’t really say much more without proper context, which answers to the help topic template would clarify.

Sorry, I installed it via the PPA in Ubuntu. This way:

Then you should use sudo systemctl caddy reload if you’re running Caddy as a service (which the PPA automatically sets up)

And that would reload the Caddyserver file with the new changes? Also how would that differ just so I can understand from the reload option? Would the systemctl know where the Caddyfile is in the /etc/caddy folder?

It’s defined in the service file:

1 Like

OMG. Thank you buddy.

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