All Guides

Let's Encrypt SSL Certificate Setup

Get a free SSL/TLS certificate with Certbot and enable HTTPS.

Beginner10 min

Setup Steps

1. Install Certbot:

sudo apt install certbot -y

2. Install the Apache plugin:

sudo apt install python3-certbot-apache -y

3. Install the Nginx plugin:

sudo apt install python3-certbot-nginx -y

4. Get a certificate with Apache:

sudo certbot --apache -d mysite.com -d www.mysite.com

5. Get a certificate with Nginx:

sudo certbot --nginx -d mysite.com -d www.mysite.com

6. Enter your email address and accept the terms

7. Test automatic renewal:

sudo certbot renew --dry-run

8. Automatic renewal cron job (usually added automatically):

sudo crontab -e
# Add:
0 0,12 * * * certbot renew --quiet

9. Check SSL status:

sudo certbot certificates