# curl https://devtools.krishanchawla.com/raw/letsencrypt-installation.txt LET'S ENCRYPT - INSTALLATION Install Certbot and configure Let's Encrypt SSL certificate tool Category: Certificate · Type: cheatsheet Official docs: https://letsencrypt.org/ ──────────────────────────────────────────────────────────── ## What is Let's Encrypt? **Let's Encrypt** is a free, automated, and open certificate authority that provides SSL/TLS certificates to enable HTTPS on websites. This guide covers installing Certbot, the recommended client for Let's Encrypt. **⚡ Key Features** - Free SSL/TLS certificates - Automated issuance and renewal - 90-day certificate validity - Wildcard certificate support - Cross-platform compatibility **🎯 Use Cases** - HTTPS website security - Production server setup - Automated SSL renewal - Multi-domain certificates - Development and testing --- ## 📥 Certbot - Install Ubuntu Install Certbot with NGINX plugin on Ubuntu/Debian. ```bash sudo apt update sudo apt install certbot python3-certbot-nginx ``` ## 📥 Certbot - Install RHEL Install Certbot on RHEL/CentOS/Rocky Linux. ```bash sudo dnf install certbot python3-certbot-nginx ``` ## 📥 Certbot - Install Apache Plugin Install Apache plugin instead of NGINX. ```bash sudo apt install python3-certbot-apache ``` ## 📥 Certbot - Install Fedora Install on Fedora Linux. ```bash sudo dnf install certbot python3-certbot-nginx ``` ## 📥 Certbot - Install Arch Install on Arch Linux. ```bash sudo pacman -S certbot certbot-nginx ``` ## 📦 Certbot - Snap Installation Install using Snap (works on most Linux distributions). ```bash # Remove old certbot sudo apt remove certbot # Install snap sudo snap install core sudo snap refresh core # Install certbot sudo snap install --classic certbot # Link command sudo ln -s /snap/bin/certbot /usr/bin/certbot ``` ## ✅ Verify Installation Check Certbot is installed correctly. ```bash certbot --version ``` ## 🔌 List Available Plugins View installed Certbot plugins. ```bash certbot plugins ``` Expected output: ``` * nginx Description: Nginx Web Server plugin * standalone Description: Standalone Authenticator * webroot Description: Webroot Authenticator ``` ## 🔧 First Time Setup Verify everything is ready for certificate issuance. ```bash # Check Certbot certbot --version # Check web server sudo systemctl status nginx # or sudo systemctl status apache2 # Check port 80 is open sudo netstat -tlnp | grep :80 # Check port 443 is open sudo netstat -tlnp | grep :443 ``` ## 🔥 Firewall Configuration Ensure firewall allows HTTP and HTTPS. ### UFW (Ubuntu) ```bash sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw status ``` ### Firewalld (RHEL/CentOS) ```bash sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload ``` ### iptables ```bash sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT sudo service iptables save ``` ──────────────────────────────────────────────────────────── Full page: https://devtools.krishanchawla.com/devtools/letsencrypt-installation More tools: https://devtools.krishanchawla.com