Setup

Installation

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Validation

which caddy
caddy version

which-caddy

Upon a successful installation you should see the location of the caddy binary and the version of the installed caddy package with the preceding commands.

For more information and to see useful Caddy commands run the below command:

caddy help

Managing the Caddy Service

Caddy Start

sudo systemctl start caddy

Check status:

systemctl-status-caddy

systemctl status caddy

Curl Localhost

curl-localhost-caddy

If you scroll towards the top of the STDOUT you will find similar html formatting.

curl localhost

Caddy Stop

caddy-stop

caddy stop
curl localhost

caddy-stop-curl