Install and configure Certbot for automatic certificate management.
Certbot is the official Let's Encrypt client, developed by the EFF (Electronic Frontier Foundation). It automates obtaining, installing, and renewing free SSL certificates. With Certbot properly configured, you never have to worry about certificates manually again.
Certbot offers plugins for the most common web servers (Apache, Nginx) that automatically configure HTTPS. It can also run in standalone or webroot mode for custom configurations.
This guide covers Certbot installation, configuration for different web servers, and advanced options like hooks and wildcards. You'll have all the tools to fully automate your SSL certificates.
What Certbot can do for you:
Installation by system:
Get your first certificate:
The most used commands:
#!/bin/bash
# Installation (Ubuntu/Debian with Nginx)
apt update
apt install certbot python3-certbot-nginx
# Get certificate with Nginx auto-config
certbot --nginx -d example.com -d www.example.com
# Get certificate without modifying config
certbot certonly --nginx -d example.com
# Webroot mode (server already configured)
certbot certonly --webroot -w /var/www/html -d example.com
# Wildcard certificate (requires DNS)
certbot certonly --manual --preferred-challenges dns -d "*.example.com" -d example.com
# List certificates
certbot certificates
# Simulate renewal
certbot renew --dry-run
# Revoke certificate
certbot revoke --cert-name example.com
# Delete certificate
certbot delete --cert-name example.com
# Renewal hook (reload Nginx)
certbot renew --deploy-hook "systemctl reload nginx"
--nginx mode is simplest for most cases. Use --webroot if you want to control configuration manually.
Configure Certbot for optimal operation:
Certbot is more accessible for beginners with its plugins. acme.sh is a pure shell script, lighter and without Python dependencies.
Use DNS-01 challenge instead of HTTP-01. The DNS challenge works even if HTTP traffic goes through a CDN.
Officially Certbot is for Linux/macOS. On Windows, use win-acme or Certify the Web.
Add multiple -d: certbot --nginx -d example.com -d www.example.com -d blog.example.com.
Check the timer is active with systemctl status certbot.timer. Consult logs for errors.
Copy all of /etc/letsencrypt to the new server. Certificates and keys will work.
Certbot greatly simplifies SSL certificate management. Once configured, it handles everything automatically: obtaining, installing, and renewing.
Combine Certbot with MoniTao monitoring for total peace of mind. You'll be alerted if renewal issues occur before the certificate expires.
Start free, no credit card required.