首页/网络/协议速查/certbot 常用命令

certbot 常用命令

最常用的 ACME 客户端:申请、续期、吊销一条命令完成;nginx 插件还能自动改配置,但生产建议先 dry-run 验证。

协议速查网络更新于 2026-10-12

高频命令

高频命令
certbot certificates                       # 列出已管理证书与到期时间
certbot renew --dry-run                    # 预演全部续期
certbot renew --deploy-hook 'systemctl reload nginx'
certbot delete --cert-name example.com     # 删除某证书
openssl x509 -in /etc/letsencrypt/live/example.com/fullchain.pem -noout -enddate
自动续期系统自带 systemd timer/cron(certbot renew)
路径/etc/letsencrypt/live/<name>/ 下 cert.pem/chain/fullchain/privkey
钩子--deploy-hook 用于重载服务
续期成功但没 reload 服务 = 服务仍用旧证书:务必配置 deploy hook 或改用一个共享证书路径。

易错点

  • cron 里 certbot renew 默认只对 30 天内到期证书操作;机器时间错误会让续期判断失准

数据来源与参考

  • certbot 官方文档
  • RFC 8555

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌