Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Install the Caddy Web Server on a VPS

Caddy is a web server with automatic HTTPS (Let’s Encrypt) and no Certbot. Great for simple sites and reverse proxies on a VPS.

Steps

  1. Add the official repo and install Caddy:

    sudo apt update
    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
    sudo apt update
    sudo apt install -y caddy
  2. Enable the service:

    sudo systemctl enable --now caddy
    systemctl status caddy --no-pager
  3. Edit the Caddyfile (domain must point at the VPS):

    sudo tee /etc/caddy/Caddyfile >/dev/null <<'EOF'example.com {  root * /var/www/html  file_server}EOF
    sudo mkdir -p /var/www/html
    echo "ok" | sudo tee /var/www/html/index.html
  4. Reload and test HTTPS:

    sudo systemctl reload caddy
    curl -I https://example.com

Tips

  • Open 80/443 in UFW and point the DNS A record at the VPS before the first TLS issue.
  • For reverse proxy: reverse_proxy 127.0.0.1:3000 inside the site block.

ext step

Frictionless HTTPS on a clean VPS: Deploy your Cloud VPS.

Related guides