添加必要的依赖项:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https -y
添加官方 Caddy GPG 密钥:
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
更新apt-get:
sudo apt-get update
安装 Caddy:
sudo apt-get install caddy -y
启动并启用 Caddy 服务:
sudo systemctl enable --now caddy