Let’s Encrypt provides free SSL/TLS certificates, and Certbot is the most common tool to issue and renew them automatically.
Certbot installation depends on your OS and web server. The safest approach is to use the official instructions and select your exact environment:
Below is a common example for Ubuntu using Snap (may vary by version):
sudo apt update
sudo apt -y install snapd
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Nginx example:
sudo certbot --nginx -d example.com -d www.example.com
Apache example:
sudo certbot --apache -d example.com -d www.example.com
Certbot will ask for an email address and whether you want to redirect HTTP to HTTPS.
Let’s Encrypt certificates are short-lived and should renew automatically. Test with:
sudo certbot renew --dry-run