Deployment
devopsdeploymentGuideBeginner
Configuring Free SSL/TLS with Let's Encrypt & Certbot
Complete guide to obtaining, installing, and auto-renewing free SSL/TLS certificates for Nginx and Apache using Certbot and Let's Encrypt.
Verified: 2026-09-30
Tested on:certbot 2.11.x, ubuntu 24.04
Platforms:
linux
#ssl#https#certbot#letsencrypt#nginx#security
Let's Encrypt provides free, automated 90-day X.509 certificates. Certbot is the official Electronic Frontier Foundation (EFF) client that handles domain challenge verification, certificate installation, and automated renewals.
Prerequisites
- An Ubuntu/Debian Linux VPS with public IPv4.
- A registered domain name with an
Arecord pointing to the VPS IP address. - Ports
80and443open in your firewall (sudo ufw allow 'Nginx Full').
Step-by-Step Installation
```bash
sudo certbot --nginx -d example.com -d www.example.com
```
Follow the interactive prompts:
- Enter your emergency contact email address.
- Agree to the Terms of Service.
- Choose whether to automatically redirect HTTP traffic to HTTPS (Select **Yes / Redirect**).Test the renewal workflow with a dry run:
```bash
sudo certbot renew --dry-run
```Useful Certbot Commands
# List all installed certificates and expiration dates
sudo certbot certificates
# Force immediate renewal
sudo certbot renew --force-renewal
# Revoke a compromised certificate
sudo certbot revoke --cert-path /etc/letsencrypt/live/example.com/cert.pemRelated Guides
Configuring an Nginx Reverse Proxy
Complete production guide to configuring Nginx as a reverse proxy for Node.js/Next.js apps, WebSocket upgrades, gzip compression, and security headers.
Basic Git-Based Deployments & CI/CD Webhooks
Complete guide to Git-based deployments, bare repository hooks (post-receive), GitHub Actions CD workflows, and automated deployment pipelines.