Home Blog How to Install a Free SSL Certificate with Let’s Encrypt and Certbot in 10 Minutes: Quick & Fail-Proof

How to Install a Free SSL Certificate with Let’s Encrypt and Certbot in 10 Minutes: Quick & Fail-Proof

ET
Editorial Team
The NodeGuard Editorial Team
November 7, 2026 14 min read Security
Free SSL certificate with Let's Encrypt and Certbot – padlock and HTTPS on an Ubuntu server

The first SSL certificate I ever bought cost me $49, took two days of back-and-forth emails to validate, and I still managed to install the wrong chain file. Today the same job costs nothing and takes about ten minutes. If you’ve been putting off HTTPS because it sounds fiddly, this guide shows you how to install a free SSL certificate on an Ubuntu server with Let’s Encrypt and Certbot, and how to make sure it renews itself so you never have to think about it again.

I’ll keep this practical. You’ll type maybe a dozen commands. Most of the ten minutes goes into checking a few things before you run them, and honestly, that’s where nearly everyone who gets stuck goes wrong.

Here’s what I’m assuming: Ubuntu 24.04 or 26.04, Nginx already serving your site over plain HTTP, and a domain you control. Running Apache instead? There’s a short section for you further down.

What an SSL Certificate Actually Does (and What It Doesn’t)

An SSL certificate does two jobs. First, it encrypts the traffic between a visitor’s browser and your server, so logins, form data and cookies can’t be read by someone on the same café Wi-Fi. Second, it proves that the server answering is really the one for your domain, not an impostor sitting in the middle.

Small pedantic note: the protocol has technically been TLS for years, not SSL. Everyone still says SSL, including your hosting panel and probably your clients, so I’ll stick with it.

Without a certificate, Chrome and Firefox show “Not secure” next to your address, and any page with a form gets an extra warning. Google has also used HTTPS as a ranking signal since 2014. It’s a small one, but there’s no good reason to give it away.

What an SSL certificate doesn’t do is make a site secure. The padlock means the connection is private. It says nothing about a weak admin password, an outdated plugin or a server with every port open. I’ve met plenty of people who treat the padlock as a security badge. It isn’t one, so keep it in perspective.

How Let’s Encrypt and Certbot Work Together

Let’s Encrypt is a free, nonprofit certificate authority run by the Internet Security Research Group (ISRG). Its certificates are trusted by every major browser and operating system, and it issues them automatically through a protocol called ACME. There’s no order form, no payment and no waiting for someone to approve you.

Certbot is the program on your server that talks to Let’s Encrypt for you. It’s built and maintained by the Electronic Frontier Foundation, and it handles the whole process:

  1. It asks Let’s Encrypt for a certificate covering your domain names.
  2. It proves you control those domains, usually by serving a temporary file that Let’s Encrypt fetches over port 80. This is called the HTTP-01 challenge.
  3. It saves the certificate and private key under /etc/letsencrypt/.
  4. With the Nginx plugin, it edits your server block so Nginx actually uses them.
  5. It sets up a timer that renews the certificate before it expires.

That last point is the one that matters most, and it matters more every year. I’ll explain why in the section on certificate lifetimes.

How to install a free SSL certificate – Certbot requests, validates and installs a Let's Encrypt certificate on Nginx
How Certbot gets a certificate from Let’s Encrypt and installs it on your server

Before You Start: What You Need

You don’t need much, but every item on this list matters:

  • An Ubuntu server with sudo access. If you’re starting from a blank machine, follow our guide on how to set up an Ubuntu VPS first. Any VPS with root access works, including a NodeGuard Cloud VPS.
  • Nginx serving your domain over HTTP. Our walkthrough on how to install Nginx on Ubuntu gets you there.
  • A domain whose DNS points at the server. That means an A record for the bare domain and for www, plus an AAAA record if you use IPv6.
  • Ports 80 and 443 open in your firewall.

A word on that last one. Port 80 has to stay open even after you switch everything to HTTPS, because Certbot renews over port 80. Close it to “tidy up” and nothing breaks today. It breaks two months later, quietly, on a Sunday. Ask me how I know.

How to Install a Free SSL Certificate on Ubuntu, Step by Step

There are seven steps. Steps 1, 2 and 4 are checks, and skipping them causes most failed attempts, so please don’t.

Step 1: Make Sure Your Domain Points to This Server

Let’s Encrypt will connect to whatever IP address your DNS returns. If that isn’t your server, validation fails. Compare the two:

dig +short example.com A
dig +short www.example.com A
curl -4 icanhazip.com

The first two lines show what DNS says. The last one shows your server’s public IPv4 address. They should match. If you changed DNS records in the last hour, give them time to propagate before going further.

One trap catches a lot of people: an old AAAA record. When a domain has one, Let’s Encrypt prefers IPv6. If that AAAA record still points at your previous host, validation fails even though your A record is perfect. Check it with dig +short example.com AAAA, and either point it at this server or delete it.

Step 2: Open Ports 80 and 443 in the Firewall

If you use UFW, the Nginx package ships with an application profile that opens both ports at once:

sudo ufw allow 'Nginx Full'
sudo ufw status

You should see Nginx Full marked ALLOW. If you’re new to UFW, our guide on how to configure UFW firewall on Ubuntu covers it properly. Also check whether your provider runs a separate network firewall in its control panel. That one blocks traffic before it ever reaches UFW.

Step 3: Install Certbot

The EFF recommends installing Certbot as a snap. You get the newest version, and the snap sets up the renewal timer for you. If you installed Certbot with apt in the past, remove that copy first so the two don’t fight over the same command:

sudo apt remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
certbot --version

The symlink makes the certbot command available everywhere. Without it you’ll get “command not found” and wonder what you did wrong.

If you’d rather avoid snaps, Ubuntu’s own package works too:

sudo apt install certbot python3-certbot-nginx

The apt version can lag behind the latest release, but it’s perfectly fine for a normal site. Personally, I use the snap on servers so I never have to wonder which features my version supports. Just pick one method and don’t install both.

Step 4: Check Your Nginx server_name

Certbot’s Nginx plugin finds the right server block by matching the domain names you request against server_name. If that line still says _ or localhost, it won’t know where to put your certificate. Check it:

grep -R "server_name" /etc/nginx/sites-enabled/

You want to see something like:

server_name example.com www.example.com;

If you edited anything, test and reload:

sudo nginx -t && sudo systemctl reload nginx

Step 5: Get Your SSL Certificate with Certbot

This is the moment the whole guide has been building up to, and it’s one command:

sudo certbot --nginx -d example.com -d www.example.com

On the first run, Certbot asks for an email address and asks you to accept the Let’s Encrypt terms. The email is optional, but I’d give one. Let’s Encrypt stopped sending expiry reminder emails in June 2025, so don’t expect a warning from them if renewal ever fails. That’s why Step 7 exists.

Certbot then runs the challenge, fetches the certificate and edits your Nginx config. Recent versions add an HTTP-to-HTTPS redirect automatically. If yours asks, choose the redirect. When it finishes, you’ll see something like this:

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/example.com/privkey.pem

fullchain.pem is your certificate plus the intermediate chain that browsers need. privkey.pem is your private key. Never copy it into a ticket, a chat or a public repo. Ever.

If you’re scripting server builds, the same command runs without any prompts:

sudo certbot --nginx -d example.com -d www.example.com \
  --non-interactive --agree-tos -m you@example.com --redirect

Step 6: Test HTTPS from the Terminal and the Browser

Open https://example.com in a private window and look for the padlock. Then confirm from the terminal that plain HTTP redirects:

curl -I http://example.com
curl -I https://example.com

The first should return 301 Moved Permanently with a Location: https://... header. The second should return 200. To see who issued the certificate and when it expires:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
  | openssl x509 -noout -issuer -dates

For an outside opinion, run your domain through the SSL Labs server test. A default Certbot setup on a current Nginx usually lands an A, which is more than most sites manage.

Step 7: Confirm Automatic SSL Certificate Renewal Works

Here’s the step people skip, and it’s the one that bites. Run a renewal rehearsal against Let’s Encrypt’s test servers:

sudo certbot renew --dry-run

If it ends with “Congratulations, all simulated renewals succeeded”, you’re done. Then check that the timer exists and see what you’re managing:

systemctl list-timers | grep certbot
sudo certbot certificates

The snap’s timer runs twice a day. On each run Certbot asks whether any certificate is due, and only renews when it is. When the Nginx plugin renews a certificate, it reloads Nginx for you. If another service uses the same certificate, such as a mail server, add a deploy hook so it picks up the new files:

sudo certbot renew --deploy-hook "systemctl reload postfix"

That’s it. Seven steps, and your site now has a free SSL certificate that looks after itself.

Using Certbot with Apache Instead of Nginx

The process is almost identical. Install Certbot the same way, make sure your virtual host has the right ServerName and ServerAlias, then swap the plugin:

sudo certbot --apache -d example.com -d www.example.com

With the apt route, the plugin package is python3-certbot-apache instead of the Nginx one. Everything else in this guide, from DNS checks to the dry run, applies unchanged.

Free SSL When Certbot Can’t Edit Your Web Server

Sometimes you don’t want Certbot touching your config, or there’s no Nginx or Apache at all, say for a Node app or a mail server. Use certonly, which fetches the certificate and leaves installation to you.

The webroot method drops the challenge file into a folder your existing web server already serves:

sudo certbot certonly --webroot -w /var/www/example.com/html -d example.com -d www.example.com

The standalone method spins up its own temporary web server on port 80, so nothing else can be using that port while it runs:

sudo certbot certonly --standalone -d example.com

Either way, you then point your application at the files in /etc/letsencrypt/live/example.com/ yourself.

Wildcard SSL Certificates and the DNS Challenge

A wildcard certificate covers every subdomain, like *.example.com. Let’s Encrypt only issues wildcards through the DNS-01 challenge, where you prove control by creating a TXT record instead of serving a file.

You can do it by hand with --manual --preferred-challenges dns, but manual certificates can’t renew on their own, which defeats the point. For anything long-term, use a Certbot DNS plugin for your DNS provider so the TXT record is created and removed automatically. My honest take: most single sites don’t need a wildcard at all. Listing example.com and www.example.com covers 90% of cases, and you can add more names with extra -d flags.

Let's Encrypt certificate lifetimes shrinking from 90 days to 64 days in 2027 and 45 days in 2028, with Certbot auto-renewal
Let’s Encrypt certificate lifetimes are getting shorter, so automatic renewal is no longer optional

SSL Certificate Renewal: Let’s Encrypt Is Moving to 45-Day Certificates

For years, every Let’s Encrypt certificate lasted 90 days. That’s changing on a published schedule. The opt-in tlsserver profile began issuing 45-day certificates on 13 May 2026. On 10 February 2027 the default profile drops to 64 days, and on 16 February 2028 it drops to 45 days. The rest of the industry is heading the same way, with the CA/Browser Forum capping all public certificates at 47 days by March 2029.

The reasoning is sound. A shorter lifetime means a stolen or mis-issued certificate is useful to an attacker for a shorter time. The practical effect on you is that renewal happens more often, so it has to be automatic.

If you followed this guide, you’re already covered. Certbot’s timer doesn’t renew on a fixed calendar. Since version 4.0 it renews when about a third of the certificate’s lifetime remains, and since 4.1 it also supports ACME Renewal Information (ARI), which lets Let’s Encrypt tell it the best moment to renew. Whether a certificate lasts 90 days or 45, Certbot adapts.

Where people will get burned is homemade automation. A cron job written years ago to renew “every 60 days” works fine with 90-day certificates and fails badly with 45-day ones. If you inherited a server, run sudo crontab -l and check what’s in there.

And since the expiry emails are gone, add some monitoring of your own. Any uptime checker that alerts on certificate expiry will do, and Let’s Encrypt itself points people to free options such as Red Sift Certificates Lite.

Fixing the Most Common Certbot Errors

Most Certbot failures come down to the same handful of causes. Here’s what each error usually means.

“Challenge failed” or “unauthorized”

Let’s Encrypt couldn’t fetch the challenge file. Nine times out of ten it’s DNS pointing somewhere else, a stale AAAA record, or port 80 blocked by a firewall. Go back to Steps 1 and 2. The full error usually includes the IP address Let’s Encrypt tried, which tells you straight away whether DNS is the problem.

“Too many certificates already issued”

You’ve hit a rate limit. Let’s Encrypt allows 50 certificates per registered domain per week, and only 5 duplicate certificates for exactly the same set of names. People usually hit the second one by deleting and re-requesting the same certificate while debugging. While you experiment, add --test-cert to use the staging environment, which has much looser limits, and switch back once everything works.

“Could not automatically find a matching server block”

Your server_name doesn’t match the names you passed with -d. Fix the server block, reload Nginx and run Certbot again.

Nginx won’t reload after Certbot runs

Run sudo nginx -t. It names the exact file and line that’s wrong. This mostly happens on heavily customised configs. Certbot keeps its changes small, so the culprit is often an include that conflicts with the new listen 443 ssl lines.

The padlock is missing or shows a warning

That’s usually mixed content: the page loads over HTTPS but pulls images, scripts or fonts over http://. Open the browser console and you’ll see each offending URL listed. On WordPress, also make sure the WordPress Address and Site Address settings both start with https://. Our guide on how to install WordPress on an Ubuntu VPS with Nginx shows where those live.

Free SSL vs Paid SSL: Is Free SSL Good Enough?

For almost every website, yes. A free SSL certificate from Let’s Encrypt uses the same encryption as a paid one. Browsers show the same padlock, and visitors can’t tell the difference.

Paid certificates still make sense in a few cases. You might need organisation validation (OV), where the certificate names your company, or a vendor’s compliance checklist might require a particular authority. Some paid certificates also come with a warranty and phone support. Extended validation (EV) certificates used to show a green company name in the address bar, but browsers dropped that years ago, which removed most of the reason to pay for them.

There’s also one argument for paid certificates that no longer holds: renewing less often. Industry rules cut maximum lifetimes for every public certificate to 200 days in March 2026, and they keep falling. Paid or free, you need automation now. Let’s Encrypt and Certbot just give it to you at no cost.

Frequently Asked Questions

Is a Let’s Encrypt SSL certificate really free?

Yes. Let’s Encrypt is a nonprofit funded by sponsors and donations. There’s no trial period, no upsell and no limit on how long you can keep using it.

How long does a free SSL certificate last?

Currently 90 days on the default profile. That falls to 64 days in February 2027 and 45 days in February 2028. With Certbot’s timer in place, renewal happens automatically and you won’t notice the change.

Do I need to renew my SSL certificate manually?

No. Certbot checks twice a day and renews when it’s due. Run sudo certbot renew --dry-run once after setup to confirm renewal works, and keep port 80 open.

Can one certificate cover several domains?

Yes. Add each name with its own -d flag. A single Let’s Encrypt certificate can hold up to 100 names, though separate certificates per site are easier to manage if the sites are unrelated.

Does Certbot work on Debian, AlmaLinux or Rocky Linux?

Yes. On Debian, the steps in this guide work as they are. On AlmaLinux and Rocky Linux, install Certbot with snap, or with dnf from the EPEL repository, then use the same certbot --nginx command.

Does a free SSL certificate help SEO?

HTTPS is a light ranking signal, so it helps a little. The bigger win is trust. Visitors who see “Not secure” tend to leave, and that hurts you more than any ranking factor.

Final Thoughts

That’s really all there is to it. Point your DNS, open two ports, install Certbot, run one command and test the renewal. Now you know how to install a free SSL certificate in about ten minutes, and you’ll never pay for a basic certificate again.

If you remember only one thing from this guide, make it the dry run. Lifetimes are getting shorter, the reminder emails are gone, and a renewal that silently fails is the one SSL problem visitors will actually see.

Need a server to practise on? A NodeGuard Cloud VPS gives you full root access on Ubuntu, so you can follow every step here and have HTTPS running before your coffee gets cold.

Further reading:


ET

Editorial Team

The NodeGuard Editorial Team creates practical, informative, and easy-to-follow guides on VPS hosting, Linux, server administration, cybersecurity, web hosting, and cloud infrastructure. Our goal is to help developers, businesses, and technology enthusiasts make informed decisions, improve their technical knowledge, and manage their online infrastructure with confidence. Through tutorials, explainers, and in-depth guides, we make complex technical topics accessible to everyone.

Leave a comment

Related articles