Webserver
- Install Caddy.
# debian or ubuntu
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
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
chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
chmod o+r /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
verify
systemctl status caddy
- Clone static website files to server.
git clone <git-repo-url> /var/www/html
# ex. git clone https://gitea.nodusk.me/jay/mercury-publish.git /var/www/html
- Edit Caddyfile
/etc/caddy/Caddyfile.
:80 {
root * /var/www/html
file_server
}
- Reload Caddy
systemctl restart caddy
- Open server at http://localhost or
http:<server-ip>:80if hosted remotely. - (optional) Use Pangolin, Caddy, or another reverse proxy to add domain name and remote access.