Let's Encrypt with Certbot
1 min read
- Authors
- Name
- Vijaykumar Rajendran
- @vijayrajendran_

Table of Contents
Let's Encrypt with Certbot
Install Certbot
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
Get Certificate
sudo certbot --nginx -d example.com -d www.example.com
Certbot will:
- Validate domain ownership
- Generate certificate
- Update Nginx config
- Set up auto-renewal
Verify Installation
sudo certbot certificates
Auto-Renewal
Certificates from Let's Encrypt expire in 90 days.
Certbot automatically renews via systemd timer:
sudo systemctl enable certbot.timer
sudo systemctl start certbot.timer
Test Renewal
sudo certbot renew --dry-run
Nginx Config
server {
listen 443 ssl http2;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}
Free HTTPS forever!