Free SSL Certificate with Certbot: Step by Step
sudo certbot --nginx -d example.com -d www.example.com for Nginx or --apache for Apache. Certbot validates the domain, installs the certificate and schedules renewal. No web server plugin? Use the certonly command with the webroot or standalone method.Before you get a free SSL certificate with Certbot
- Your domain's DNS must point to the server (DNS lookup shows what it resolves to).
- Port 80 must be reachable from the internet for HTTP validation.
- If you set CAA records, they must allow Let's Encrypt. Check with the CAA checker.
Free SSL certificate with Certbot: pick a method
| Method | Command | Use when |
|---|---|---|
| Nginx plugin | certbot --nginx | Nginx is running and you want automatic config edits |
| Apache plugin | certbot --apache | Apache is running, same convenience |
| Webroot | certbot certonly --webroot | You want to edit config yourself and keep the server running |
| Standalone | certbot certonly --standalone | No web server yet, or non-web services such as a mail server |
| DNS | certbot certonly --dns-... | Wildcards or servers not reachable on port 80 |
Examples
# Nginx with automatic config
sudo certbot --nginx -d example.com -d www.example.com
# Webroot, no config changes
sudo certbot certonly --webroot -w /var/www/html -d example.com -d www.example.com
# Standalone, needs port 80 free
sudo certbot certonly --standalone -d example.com
Files appear in /etc/letsencrypt/live/example.com/. Point your server at fullchain.pem and privkey.pem. Do not copy the files elsewhere, because the "live" entries are symlinks that Certbot updates at renewal.
Renew a free SSL certificate with Certbot
Packages normally install a systemd timer or cron entry. Check it with a dry run:
sudo certbot renew --dry-run
sudo certbot certificates
Let's Encrypt certificates last 90 days today, 64 days from 10 February 2027 and 45 days from 16 February 2028 (Let's Encrypt announcement). Certbot renews once less than a third of the lifetime is left, which is 30 days on a 90-day certificate, about 21 on a 64-day one and 15 on a 45-day one (Certbot docs). For deploy hooks, timers and monitoring, read how to renew a free SSL certificate automatically and how to renew SSL without downtime.
Common errors
| Message | Cause | Fix |
|---|---|---|
| Timeout during connect | Firewall blocks port 80 | Open port 80 |
| Unauthorized / 404 on the challenge | Wrong webroot path or a rewrite rule | Check -w path and allow /.well-known/ |
| DNS problem: NXDOMAIN | Name does not exist yet | Create the DNS record |
| Too many certificates | Rate limit hit | Wait, and test with --dry-run |
| Address already in use | Standalone cannot bind port 80 | Stop the web server or use webroot |
Verify
After installation, run the SSL checker to confirm the chain and expiry date, and the HTTPS redirect checker if you enabled the redirect. For a full server walkthrough, see the VPS SSL guide.
Related reading: fixing Certbot renewal errors, what the ACME protocol is and installing free SSL without cPanel.
Frequently Asked Questions
Is Certbot the only way to use Let's Encrypt?
No. Many ACME clients exist, and hosting panels often include their own. Certbot is the most common reference tool.
Can I get a certificate for an IP address or localhost?
Let's Encrypt can issue IP address certificates only through its shortlived profile, which lasts about 160 hours (Let's Encrypt profiles). The normal flow needs a real domain name, and localhost cannot get a public certificate.
How do I revoke or delete a certificate?
Use certbot revoke --cert-path ... to revoke and certbot delete to remove local files.
Does the first run need an email address?
Certbot asks for one as the account contact. Let's Encrypt stopped sending expiry notices on 4 June 2025 (Let's Encrypt announcement), so it does not replace an expiry alert.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.