I’ve just used the “sudo apt install caddy” method to install caddy on a new environment (I’m switching from Windows to Raspberry PI). It worked like a charm, and I was up and running in 5 minutes.
A quick question… When V2.0 Final is released, what’s the best was to upgrade? Will ‘sudo apt update’ pick up the new version, or will I need to remove and re-install?
sudo apt update then
sudo apt upgrade! It will update the binary then restart the service on upgrade.
OK - I did the upgrade and it worked (sort of!)
The only issue was that it overwrote the /lib/systemd/system/caddy.service file. I’d got this set to :-
ExecStart=/usr/bin/caddy run --environ --resume
After the upgrade, it was set to :-
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
This, of course, then overwrote my settings with the defaults from the Caddyfile. Not a big issue, as I have the JSON file backed up So, only 2 minutes to fix.
I’d say that’s currently as expected, because if we change the defaults for the service file, we’d want it to use the latest. I’ll take a closer look to see if there’s anything available in the
.deb pipeline to deal with this though, I’m still new to
For now, I recommend you make a copy of the service file like
caddy.service, then enable your custom one. This should make it survive upgrades.
Thanks for trying it so quickly!
Even better, use
systemctl edit --full caddy.service to create an override file in
/etc/systemd/system that takes precedence over the file in
Thanks @carlwgeorge I wasn’t aware of that! Perfect.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.