This runbook describes how to set up SSL for a website using Let’s Encrypt and Nginx.
Prerequisites
- Access to the server
- Nginx installed
- Domain name pointing to the server
Steps
- Install Certbot
sudo apt update
sudo apt install -y certbot python3-certbot-nginx
- Obtain SSL Certificate
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
- Follow Certbot Prompts
- Enter your email address.
- Agree to the terms of service.
- Choose to redirect HTTP to HTTPS.
- Renew SSL Certificates
sudo certbot renew --dry-run
Verification
- Check your website at https://yourdomain.com.
- Verify that the SSL certificate is correctly installed and valid.