Caddy as a service examples
Please see dist/init/linux-systemd for the most recent complete systemd unit file.
You will need systemd version ≥229! For example: Ubuntu 16.04, Coreos 1029.0.0, Debian unstable sid (not 8.0), Fedora rawhide (not 23) and later come with that version of systemd.
Example for an init script on FreeBSD: https://gist.github.com/dprandzioch/f3a0bc4ebde3efd5c2a4
You can use nssm.cc in order to automatically launch, and restart if crashed Caddy.
- First download both NSSM and Caddy then extract them to c:\myserver\
- Then install Caddy as a service by entering the following commands in your Terminal:
c:\myserver\nssm.exe install Caddy c:\myserver\caddy.exe
c:\myserver\nssm.exe set Caddy AppDirectory C:\myserver\
c:\myserver\nssm.exe set Caddy AppParameters -agree=true -log=C:\myserver\Caddylog.log
Or whatever parameters you need to pass
You can download Caddy with caddy-service plugin already embedded on it.
- Download Caddy with caddy-service (hook.service option).
- Install and start Caddy as a service.
caddy -service install [caddyOptions]
caddy -service start