← Все руководства
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.
Система: Ubuntu 22.04 LTS / 24.04 LTS, or any Docker hostWeb ServerCMSОфициальный сайт ↗Официальная документация ↗
Это руководство составлено на основе официальной документации Caddy for static sites, ссылка на которую есть выше — всегда сверяйте точные названия пакетов/версий там перед запуском этих команд на рабочем сервере, так как версии дистрибутива и проекта со временем меняются.
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.