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

How to Install Free SSL on XAMPP

How to Install Free SSL on XAMPP

To install free SSL on XAMPP, get a certificate for localhost or for your public domain, then point Apache at the certificate and key and restart it.

Case A: HTTPS for local development

For a site only you use, a locally trusted certificate is enough. The simplest option is mkcert, which creates a small local certificate authority that your browser trusts automatically. Install mkcert, then run:

mkcert -install
mkcert localhost 127.0.0.1 ::1

This creates two files, a certificate and a key, in the current folder. The alternative is a plain self-signed certificate made with OpenSSL; that path is covered step by step in how to generate an SSL certificate using OpenSSL, and if you need a certificate signing request for any tooling, our key and CSR guide explains the format.

Case B: a free certificate for a public domain

If XAMPP hosts a live site with a real domain, you need a certificate from a public certificate authority. Let's Encrypt is the standard free option. On Windows, the easiest clients are win-acme and Certbot. With win-acme, download the release, run wacs.exe as administrator, and follow the prompts for your domain. The client proves control of the domain over port 80, so that port must be reachable and the DNS record must point at this machine. Certificates from Let's Encrypt are valid for 90 days, and both clients can schedule automatic renewal, so enable that during the first run rather than later.

Install free SSL on XAMPP: Apache config

Open xampp/apache/conf/extra/httpd-ssl.conf and set the paths inside the default virtual host:

SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"

Also check conf/httpd.conf: the lines LoadModule ssl_module modules/mod_ssl.so and Include conf/extra/httpd-ssl.conf must not be commented out. Restart Apache from the XAMPP control panel when you are done.

Install free SSL on XAMPP: test it

Browse to https://localhost or to your domain. A padlock with no warning means Apache found the certificate and key. If Apache fails to start after the edit, check the Apache error log first; a wrong path or a key that does not match the certificate is the usual cause. Our local HTTPS guide for XAMPP and WAMP covers the common startup errors in more detail.

Common pitfalls

SymptomLikely cause
Apache will not startBad certificate path in httpd-ssl.conf
Browser warning on localhostSelf-signed cert not in trust store
Let's Encrypt validation failsPort 80 blocked or DNS not pointing here

If you later move the certificate to a Windows server or IIS, the tooling usually wants a single PFX bundle; our note on the OpenSSL PEM to PFX legacy flag covers that conversion and the version quirk that trips people up.

Redirect HTTP to HTTPS

Once the certificate works, send visitors to the secure version. On XAMPP, the cleanest place is the .htaccess file in your site root, or the main Apache config:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Apache needs the rewrite module enabled for this: the LoadModule rewrite_module line in httpd.conf must be uncommented. The background on these rules is in our .htaccess HTTPS redirect guide.

Should XAMPP host a public site at all?

XAMPP is built for development, and its defaults are intentionally permissive: a well-known database password, an open control panel, and verbose error pages. Before pointing a public domain at it, run its security script, change every default password, and block remote access to the dashboard. For anything beyond a hobby project, a small VPS with nginx or Apache gives you the same stack with saner defaults. For local development, none of this applies, and the mkcert setup above is all you need.

Related reading: HTTPS on a local XAMPP or WAMP stack, generating the key and CSR and installing on Windows Server.

Frequently Asked Questions

Should I use a self-signed certificate for local work?

Yes, for localhost only. Browsers will warn until you trust the certificate on that machine, and the warning is the correct behaviour for a certificate no authority signed.

Why does Apache fail to start after I add the certificate?

Usually a wrong path or a missing passphrase. Read the Apache error log: it names the file it could not open, and on Windows a backslash in the path is a common culprit.

Can I use a Let's Encrypt certificate for a local site?

Only if the name is public and the authority can reach it for validation. For a name that resolves to 127.0.0.1, use a locally trusted certificate instead.

🔒 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