Web / Caddy Server Interview questions
How do you start, stop, and reload the Caddy service?
When Caddy is installed via the APT package, it registers as a systemd service, so the usual systemd verbs apply directly.
sudo systemctl start caddy # start the service sudo systemctl stop caddy # stop the service sudo systemctl restart caddy # stop then start (drops connections briefly) sudo systemctl reload caddy # apply Caddyfile changes with zero downtime sudo systemctl status caddy # check whether it's running sudo systemctl enable caddy # start automatically on boot
reload is preferred over restart for config changes because Caddy performs a graceful config swap through its admin API rather than tearing down existing listeners, so in-flight requests are not dropped.
More Related questions...