Debian、Ubuntu、Raspbian安装caddy2与无需编译添加模块方法!

安装此软件包会自动启动并运行 Caddy 作为名为systemd 的服务caddy。它还带有一个可选caddy-api服务,该服务默认情况下启用,但如果您主要通过其 API 而不是配置文件来配置 Caddy,则应使用该服务。

官方最新稳定版本一键安装:

apt install -y debian-keyring debian-archive-keyring apt-transport-https
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 update
apt install caddy
 查看是否安装成功
caddy version
 开机自启
systemctl daemon-reload
systemctl enable caddy
systemctl start caddy

 caddy安装模块:

官网模块下载地址:https://caddyserver.com/download

安装方法:
caddy add-package github.com/caddy-dns/cloudflare
#“github.com/caddy-dns/cloudflare”替换为你要安装的模块地址

 

 

THE END