← Todas las guías
Caddy for static sites
A free, open-source web server that issues and renews HTTPS certificates automatically with zero configuration -- the simplest way to serve a static site or reverse-proxy an app with real TLS.
Sistema: Ubuntu 22.04 LTS / 24.04 LTS, or any Docker hostWeb ServerCMSSitio oficial ↗Documentación oficial ↗
Esta guía se elaboró a partir de la documentación oficial de Caddy for static sites, enlazada arriba — verifica siempre ahí los nombres exactos de paquetes/versiones antes de ejecutar estos comandos en un servidor de producción, ya que las versiones de la distribución y del proyecto cambian con el tiempo.
1Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curlcurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpgcurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.listsudo apt updatesudo apt install caddy2Point your domain's DNS at this server first
Caddy requests a Let's Encrypt certificate automatically the first time it serves your domain -- DNS must already resolve to this server's IP before that step succeeds.
3Configure the Caddyfile
sudo tee /etc/caddy/Caddyfile <<'EOF' example.com { root * /var/www/example.com file_server } EOFsudo mkdir -p /var/www/example.comsudo systemctl reload caddyReplace example.com with your real domain -- Caddy fetches and renews the HTTPS certificate for it automatically, no Certbot needed.