Introduction
Let’s Encrypt is a free, automated, and open Certificate Authority (CA) that provides SSL certificates for securing websites. This guide covers the installation of Let’s Encrypt, requesting SSL certificates, and configuring them on Linux and Windows servers.
Prerequisites
- Root or administrative access to the server.
- Registered domain name with proper DNS configuration.
- Web server (e.g., Nginx, Apache) installed and running.
Installing Let’s Encrypt on Linux
Ubuntu/Debian
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d www.example.com
Verify and reload the web server:
sudo nginx -t
sudo systemctl reload nginx
CentOS/RHEL
sudo yum install epel-release -y
sudo yum install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d www.example.com
Verify and reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Fedora
sudo dnf install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d www.example.com
Verify and reload the server:
sudo nginx -t
sudo systemctl reload nginx
Arch Linux
sudo pacman -S certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Reload Nginx to apply changes:
sudo nginx -t
sudo systemctl reload nginx
Installing Let’s Encrypt on Windows
Use Certbot or a GUI-based client like Win-ACME.
Steps:
- Download and install Win-ACME from its official website.
- Run the client and select the option to issue a new certificate.
- Configure the certificate for your domain and follow the on-screen instructions.
Once issued, bind the SSL certificate to your website in IIS.
Automating SSL Certificate Renewal
Let’s Encrypt certificates are valid for 90 days. Automate the renewal using the following command:
sudo certbot renew --dry-run
Add a cron job to ensure automatic renewal:
sudo crontab -e
Add the following line:
0 0 * * * certbot renew --quiet
Troubleshooting
- Firewall Issues: Ensure ports 80 and 443 are open.
sudo ufw allow 'Nginx Full'
- DNS Configuration: Verify DNS records for your domain are correctly pointing to your server.
- Error Logs: Check logs for troubleshooting:
- Linux:
/var/log/nginx/error.log
- Windows: Check Event Viewer under System logs.
Conclusion
By following this guide, you can easily install and configure Let’s Encrypt SSL certificates on both Linux and Windows servers. Regularly renewing and testing your setup ensures continued secure communication for your domains.