SKDBLOG

DevOps

Getting Free SSL Certificates with Certbot - The No-Stress Guide! πŸ”’

Secure your website with free SSL certificates using Certbot on Ubuntu & Nginx. A simple step-by-step guide with troubleshooting tips. Perfect for beginners! [2024]

Shashikant Dwivedi
3 min read
Getting Free SSL Certificates with Certbot - The No-Stress Guide! πŸ”’
DevOps03 MIN

Hey there! Tired of that annoying "Not Secure" warning on your website? Let's fix that! I'll show you how to get free SSL certificates using Certbot on Ubuntu. Trust me, it's way easier than it sounds!

Before you run Certbot

Your domain’s DNS A/AAAA records must point at this server, and something must answer on port 80 (usually Nginx) so Let’s Encrypt can complete HTTP validation.

What We're Gonna Do 🎯

  • Get that sweet HTTPS working
  • Set up auto-renewal (because who wants to do this manually?)
  • Make your site secure and professional-looking

Before We Start... 🏁

Make sure you've got:

  • Ubuntu server (duh!)
  • Nginx is up and running
  • A domain pointing to your server
  • 5 minutes of free time

Let's Do This! πŸš€

1. Installing Certbot

First, let's get the tools we need. Copy-paste these commands (I'll explain what they do):

bash
# Update your system
sudo apt update

# Install Certbot and its Nginx plugin
sudo apt install certbot python3-certbot-nginx

2. Getting Your Certificate πŸŽ‰

Here comes the fun part! Just run:

bash
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Replace yourdomain.com with your actual domain (I know, obvious, but had to say it! πŸ˜…)

Certbot will ask you some questions:

  • Email address? (for renewal notifications - they won't spam you)
  • Agree to terms? (just type 'A' for agree)
  • Share email? (up to you - I usually say no)
  • Redirect HTTP to HTTPS? (definitely, yes! Type 2)

3. Testing It Out πŸ§ͺ

Visit your site with https:// - you should see that lovely padlock! πŸ”’

Auto-Renewal (The Set-It-and-Forget-It Part) ⏰

Certbot sets up auto-renewal by default (neat, right?). But let's make sure it's working:

bash
sudo certbot renew --dry-run

If you see no errors, you're golden! Certificates will auto-renew when they're about to expire.

Troubleshooting (When Things Go South) πŸ˜…

Having issues? Don't panic! Here are some common hiccups:

"Something went wrong."

  • Check if Nginx is running: sudo systemctl status nginx
  • Make sure your domain points to your server
  • Check Nginx config: sudo nginx -t

"Unable to bind to port 80."

  • Something's probably using port 80
  • Check with: sudo lsof -i :80
  • Stop whatever's hogging it

Pro Tips! πŸ’‘

  • Keep your email address updated (so you don't miss renewal notifications)
  • Don't mess with the renewal scripts (they know what they're doing)
  • Test renewal monthly if you're paranoid (like me!)

You're All Set! 🎊

Congrats! You've just:

  • Secured your site
  • Made it look professional
  • Improved your SEO (Google loves HTTPS!)
  • Probably learned something new!

Need More Help? πŸ†˜

If something's not working:

  • Check Certbot logs: sudo certbot --logs
  • Visit Certbot's official docs
  • Or drop a comment below - I'll try to help!

Remember: Everyone struggles with SSL at first. If something goes wrong, take a deep breath, grab a coffee β˜•, and try again!

P.S. If this helped you out, share it with other devs! Sharing is caring! πŸ€—

Written by Shashikant Dwivedi

Engineer, occasional writer, full-time noticer. Based in Prayagraj, India. New essays land roughly twice a month.

Keep reading

Adjacent essays.

All writing β†’

The newsletter

New articles in your inbox.

Occasional articles on engineering, tooling, and software development practices. No marketing, no fluff β€” just the article, when it's ready.

Unsubscribe with one click. Your email never leaves the list.