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

How to Install Free SSL on Apache

How to Install Free SSL on Apache

Apache plus certbot is one of the smoothest free SSL setups that exists. Certbot's Apache plugin obtains a certificate from Let's Encrypt, rewrites your VirtualHost configuration and sets up automatic renewal. The whole process takes about five minutes on a working site.

Prerequisites

  • A domain whose DNS A record points at your server's public IP.
  • Apache serving that domain on port 80, since certbot validates over HTTP by default.
  • Ports 80 and 443 open in your firewall and any cloud security group.
  • sudo access on the server.

Step 1: Install certbot

On Ubuntu or Debian:

sudo apt update
sudo apt install certbot python3-certbot-apache

On RHEL-based systems like AlmaLinux or Rocky, enable the EPEL repository first, then install the same packages with dnf.

Free SSL on Apache, step 2: obtain and install the certificate

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

Certbot asks for an email (Let's Encrypt stopped sending expiry reminders on 4 June 2025, so do not rely on it for that), has you accept the terms of service, then obtains the certificate and updates your Apache configuration automatically. When asked whether to redirect HTTP to HTTPS, choose redirect so visitors always land on the secure version. Reload Apache if prompted:

sudo systemctl reload apache2

Free SSL on Apache, step 3: verify automatic renewal

Certbot installs a systemd timer that renews certificates before they expire, typically checking twice a day and renewing anything that is due. Since Certbot 4.0.0, that means less than a third of the lifetime is left, which is 30 days on a 90-day certificate (Certbot docs). Test the renewal path without actually renewing:

sudo certbot renew --dry-run

A success message means renewals will run unattended. For deeper automation options like deploy hooks, see how to automate SSL renewal with certbot.

Manual free SSL on Apache: configuring the VirtualHost yourself

If you obtained the certificate from another provider or another machine, configure Apache by hand. Enable the SSL module and your SSL site, then reload:

sudo a2enmod ssl
sudo a2ensite example-ssl
sudo systemctl reload apache2

A minimal SSL VirtualHost looks like this:

<VirtualHost *:443>
  ServerName example.com
  DocumentRoot /var/www/example
  SSLEngine on
  SSLCertificateFile /path/to/cert.pem
  SSLCertificateKeyFile /path/to/privkey.pem
  SSLCertificateChainFile /path/to/chain.pem
</VirtualHost>

Adjust the three paths to where your certificate files actually live; certbot-managed certificates sit under /etc/letsencrypt/live/example.com/. If browsers report chain or trust errors after a manual install, the ChainFile line is the first thing to check, and our guide to fixing SSL certificate chain errors covers the usual causes.

Test the result

Visit https://yourdomain.com and confirm the padlock with no warnings, then load the plain HTTP URL and confirm it redirects. Finally, check the full chain and expiry date with an external scanner rather than trusting your own browser cache. The same certbot workflow applies when Apache runs alongside nginx on a VPS; see installing free SSL on nginx and Apache VPS servers for that layout.

When certbot cannot edit your config

Highly customized Apache setups, such as many vhosts in one file or config generated by a panel, sometimes confuse the plugin. In that case run certbot with the certonly subcommand and the webroot or standalone authenticator, then wire the certificate into your VirtualHost by hand using the manual method above. You keep certbot's renewal automation while keeping full control of the config.

Checking your SSL grade

After everything works, scan the site with an external SSL test to see protocol and cipher strength. The defaults certbot writes are solid, but older Apache builds sometimes still allow TLS 1.0 or 1.1; disabling them is a two-line change and worth doing on any public site.

Keeping the config clean over time

Certbot writes its own SSL vhost file, usually named with le-ssl in the filename. Leave its certificate lines alone, because renewal updates the underlying files, not the config. If you reorganize your Apache configuration later, keep the three certificate paths pointing at /etc/letsencrypt/live/ so renewals keep flowing. Breaking that link is the most common way a previously healthy Apache site suddenly serves an expired certificate months later.

Related reading: installing free SSL on Nginx and installing free SSL on Ubuntu.

Frequently Asked Questions

What if Certbot cannot edit my Apache config?

Run certbot certonly with the webroot or standalone authenticator, then add the certificate paths to your VirtualHost by hand. You keep Certbot's renewal automation.

Do I need to reload Apache after renewal?

Yes. A renewed certificate does nothing until Apache reloads. A deploy hook that runs systemctl reload apache2 covers it.

How do I check that renewal will work?

Run sudo certbot renew --dry-run. Since Certbot 4.0.0, a certificate is renewed when less than a third of its 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