ssl-guides 2026-12-02 ⏱ 4 min read

How to Install Free SSL on Ubuntu

How to Install Free SSL on Ubuntu

To install free SSL on Ubuntu, install Certbot with the plugin for Nginx or Apache, run one command to get a Let's Encrypt certificate, and check that renewal works. From a fresh server to a trusted, auto-renewing certificate takes about five commands and ten minutes.

Prerequisites

  • A current Ubuntu release, such as 22.04 or 24.04, with sudo access.
  • A domain with an A record pointing at your server's public IP, fully propagated.
  • A web server (nginx or Apache) already serving the domain on port 80.

Step 1: Open the firewall

If you use ufw, allow both HTTP and HTTPS:

sudo ufw allow 'Nginx Full'
sudo ufw status

For Apache, use the 'Apache Full' profile instead. Also open ports 80 and 443 in any cloud provider security group or network firewall; that second layer is the most commonly forgotten one.

Install free SSL on Ubuntu, step 2: install certbot

Install certbot with the plugin matching your web server:

sudo apt update
sudo apt install certbot python3-certbot-nginx

For Apache, install python3-certbot-apache instead. The snap-packaged certbot is the alternative the certbot team recommends on some releases; either works, but do not mix both.

Free SSL on Ubuntu, step 3: obtain the certificate

For nginx:

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

For Apache:

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

Certbot validates the domain, writes the certificate files under /etc/letsencrypt/live/example.com/ and updates your web server config to serve HTTPS. Choose the redirect option so HTTP requests move to HTTPS automatically.

Free SSL on Ubuntu, step 4: verify auto-renewal

sudo systemctl status certbot.timer
sudo certbot renew --dry-run

The timer runs twice daily and renews any certificate that is due: since Certbot 4.0.0, one with less than a third of its lifetime left, which is 30 days on a 90-day certificate and about 21 on a 64-day one (Certbot docs). The dry run proves the renewal path works without touching your live certificate. The complete renewal lifecycle, including failure notifications, is covered in how to renew a Let's Encrypt certificate.

Running on a cloud VM?

The steps are identical on DigitalOcean, Linode, Hetzner, AWS EC2 or any other provider; just remember the provider's firewall or security group is a second firewall to open. Provider-specific notes are in installing free SSL on a DigitalOcean droplet running Ubuntu and free SSL on EC2, Lightsail and CloudFront.

Troubleshooting

  • Failed authorization: DNS has not propagated, or port 80 is blocked somewhere. Certbot must reach your server over HTTP for the default challenge.
  • Rate limited: Let's Encrypt allows 5 authorization failures per identifier per account per hour (rate limits). Use the --dry-run flag while testing so failures cost nothing.
  • Padlock missing after install: run nginx -t or apachectl configtest, confirm you reloaded the service, and check that your site URL itself uses https.
  • IPv6 issues: if your domain has an AAAA record pointing somewhere else, validation follows it. Fix or remove the record.

Finish by loading your site over HTTPS and running an external SSL check to confirm the chain and expiry date. From here, Ubuntu keeps the certificate renewed indefinitely with no further work from you.

Other certbot plugins worth knowing

The nginx and Apache plugins cover most setups, but certbot also supports a standalone mode that spins up a temporary web server, and DNS plugins for providers like Cloudflare that enable wildcard certificates. The DNS route is the one to learn once you manage several subdomains, since one wildcard certificate replaces a growing list of individual names.

After the install

With the certificate live, spend two more minutes on durability. Force HTTP to HTTPS at the server level if you skipped the redirect option, add your domain to an external uptime or SSL monitor, and keep the certbot package updated through apt. Those three habits catch essentially every way a healthy setup degrades: a lapsed renewal, a broken redirect or an outdated client with a deprecated protocol.

That is the entire lifecycle: install, issue, verify renewal, and let the timer do its job. Ubuntu plus certbot remains the reference setup for free SSL precisely because there is so little to get wrong, and everything that can go wrong fails loudly during the dry run rather than quietly at expiry.

Related reading: installing free SSL on Nginx, installing free SSL on Apache and choosing an SSL certificate for a VPS.

Frequently Asked Questions

Which web server plugin do I need?

Install python3-certbot-nginx for Nginx or python3-certbot-apache for Apache, then run Certbot with --nginx or --apache.

Why did Certbot fail authorization?

Usually DNS has not propagated, or port 80 is blocked in the firewall or the cloud provider's security group. Certbot must reach your server over HTTP for the default challenge.

How do I confirm renewal works?

Run sudo certbot renew --dry-run and check systemctl status certbot.timer. Since Certbot 4.0.0, renewal starts when less than a third of the lifetime is left (Certbot docs).

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ 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 www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant