Certbot is a free, open-source software tool for automatically using Let’s Encrypt certificates on manually-administrated websites to enable HTTPS. It was developed by the Electronic Frontier Foundation (EFF) and is the official client for Let’s Encrypt.
Certbot addresses the challenges of manual certificate management:
Certbot uses the ACME (Automatic Certificate Management Environment) protocol to:
graph TD
A[User runs certbot] --> B[Register ACME account]
B --> C[Generate private key]
C --> D[Request certificate]
D --> E[Complete challenges]
E --> F[Receive certificate]
F --> G[Install in web server]
G --> H[Configure auto-renewal]
# Ubuntu/Debian
sudo apt update
sudo apt install certbot
# CentOS/RHEL
sudo yum install certbot
# macOS with Homebrew
brew install certbot
# Snap (universal)
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Get certificate for example.com
sudo certbot certonly --standalone -d example.com
# Multiple domains
sudo certbot certonly --standalone -d example.com -d www.example.com
# Install plugin
sudo apt install python3-certbot-apache
# Get and install certificate
sudo certbot --apache -d example.com
# Install plugin
sudo apt install python3-certbot-nginx
# Get and install certificate
sudo certbot --nginx -d example.com
Certbot stores certificates in /etc/letsencrypt/live/domain/:
cert.pem: Server certificatechain.pem: Intermediate certificatesfullchain.pem: cert.pem + chain.pemprivkey.pem: Private key (keep secure!)# Enable and start certbot timer
sudo systemctl enable certbot.timer
sudo systemctl start certbot.timer
# Check status
sudo systemctl status certbot.timer
# Add to crontab
sudo crontab -e
# Run daily at 12:00
0 12 * * * /usr/bin/certbot renew --quiet
# Test renewal without making changes
sudo certbot renew --dry-run
# Check certificate status
sudo certbot certificates
# View logs
sudo journalctl -u certbot
# Test certificate
openssl s_client -connect example.com:443 -servername example.com
/etc/letsencrypt/ directory# Use for testing (higher rate limits)
sudo certbot --staging --nginx -d example.com
# Real certificates
sudo certbot --nginx -d example.com