SSL Certificate Renewal Notes
SSL Certificate Renewal Notes
This note records a simple SSL certificate workflow with
certbot: acquire, verify, renew, and deploy.
The example domain is api.example.com. Replace it with
your own domain.
Acquire A Certificate
For a standalone HTTP-01 challenge, port 80 must be
reachable and not occupied by another process:
1 | sudo certbot certonly --standalone -d api.example.com |
If Caddy or Nginx is already using port 80, stop it
temporarily:
1 | sudo systemctl stop caddy |
Check The Certificate
1 | sudo certbot certificates |
Enable Renewal
1 | sudo systemctl enable --now certbot.timer |
Run a dry test:
1 | sudo certbot renew --dry-run |
Deploy Hook
Some services cannot read directly from
/etc/letsencrypt/live/..., or they need certificate files
copied into a service-owned directory.
Example hook for a service called myapp:
1 |
|
Install it as a deploy hook:
1 | sudo install -m 0755 deploy-myapp-cert.sh \ |