
Let's Encrypt is a free, automated, and open Certificate Authority (CA) operated by the Internet Security Research Group (ISRG). It issues Domain Validated (DV) SSL certificates at no cost, backed by Mozilla, Google, Cisco, and other technology leaders.
Certbot is an ACME protocol client developed by the Electronic Frontier Foundation (EFF) that automates the process of obtaining and renewing Let's Encrypt certificates. It has native plugins for Nginx and Apache.
Before installing Certbot, ensure the following are in place:
| Requirement | Details | Status |
|---|---|---|
| Ubuntu VPS | Ubuntu 20.04 / 22.04 / 24.04 | ✅ Required |
| Nginx installed | Version 1.18+ recommended | ✅ Required |
| Domain pointing to VPS | A Record → VPS IP address | ✅ Required |
| Ports 80 and 443 open | Certbot uses HTTP challenge | ✅ Required |
| Root or sudo access | Required for package installation | ✅ Required |
Verify Nginx is running:
sudo systemctl status nginx
# Should show: Active: active (running)
Installing via snap is recommended as it always provides the latest version with automatic updates:
# Update package list
sudo apt update
# Install snapd (pre-installed on Ubuntu 20.04+)
sudo apt install -y snapd
# Update snap core
sudo snap install core
sudo snap refresh core
# Install certbot via snap
sudo snap install --classic certbot
# Create symlink
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Verify installation
certbot --version
sudo apt remove certbot
Certbot's Nginx plugin handles everything automatically — certificate issuance and Nginx configuration:
# Issue certificate and configure Nginx automatically
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Or obtain certificate only, without modifying Nginx config
sudo certbot certonly --nginx -d yourdomain.com -d www.yourdomain.com
Certbot will prompt for your email address and ask you to agree to the Terms of Service. Certificates are stored at:
/etc/letsencrypt/live/yourdomain.com/fullchain.pem # Certificate
/etc/letsencrypt/live/yourdomain.com/privkey.pem # Private Key
Wildcard SSL covers all subdomains (*.yourdomain.com) and requires a DNS Challenge:
sudo certbot certonly --manual --preferred-challenges dns \
-d "yourdomain.com" -d "*.yourdomain.com"
Certbot will ask you to add a TXT record to your DNS. After DNS propagates, press Enter to continue.
When using the --nginx flag, Certbot modifies your config automatically. For manual setup, use this template:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name yourdomain.com www.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /var/www/yourdomain.com;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
}
# Test configuration
sudo nginx -t
# Reload Nginx
sudo systemctl reload nginx
HSTS forces browsers to always use HTTPS, adding an extra layer of security:
# Inside the 443 server block
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
Let's Encrypt certificates are valid for 90 days. When installed via snap, Certbot automatically sets up a systemd timer or cron job for renewal.
# Check the renewal timer
sudo systemctl list-timers | grep certbot
# Or check cron
sudo crontab -l | grep certbot
Test renewal without actually issuing a certificate (dry run):
sudo certbot renew --dry-run
# Should show: Congratulations, all simulated renewals succeeded
After installation, verify your SSL configuration with these tools:
ssllabs.com/ssltest — comprehensive check of cipher suites, protocols, and certificate chaincurl -I https://yourdomain.com — check headers and status codeopenssl s_client -connect yourdomain.com:443 — view certificate details# View issued certificates
sudo certbot certificates
# Output shows domain, expiry date, and certificate path
# Open ports 80 and 443 in UFW
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload
The domain's A Record may not be pointing to the VPS IP, or DNS hasn't propagated. Wait 24–48 hours after changing DNS.
# Check DNS propagation
dig yourdomain.com A +short
# Should return your VPS IP address
# Check logs
sudo journalctl -u snap.certbot.renew --since "1 day ago"
# Or view certbot log directly
sudo tail -50 /var/log/letsencrypt/letsencrypt.log
The certificate and private key don't match. Force-renew the certificate:
sudo certbot renew --force-renewal -d yourdomain.com
100% free with no hidden costs. Let's Encrypt is a non-profit supported by Mozilla, Google, Cisco, and EFF. Certificate issuance and renewal are always free.
Let's Encrypt issues DV (Domain Validated) SSL, suitable for blogs and general websites. Paid SSL comes in DV, OV (Organization Validated), and EV (Extended Validation) — higher tiers provide organizational identity verification, important for enterprise and e-commerce sites.
Run sudo certbot renew --force-renewal followed by sudo systemctl reload nginx. If auto-renewal was configured correctly, Certbot should have renewed before expiry.
Yes. AsiaGB VPS (Thailand and Singapore) fully supports Let's Encrypt. Simply point your domain's A Record to your VPS IP and follow the steps in this guide.
Certbot supports Ubuntu 20.04, 22.04, and 24.04 LTS. Installing via snap is recommended for the latest version and automatic updates.
50 certificates per registered domain per week, and 5 duplicate certificates per hour. These limits are rarely encountered in normal usage.
Installing Let's Encrypt SSL with Certbot on Nginx VPS takes just 5–10 minutes with a handful of commands. The critical step is configuring auto-renewal correctly so your certificate never expires unexpectedly.
Need an OV or EV SSL certificate for a business site requiring organizational validation? AsiaGB offers multiple SSL certificate types with professional installation support.
View AsiaGB VPS Plans