Skip to content
WampServer logo WampServer
  • Home
  • What is
  • Features
  • Install
  • Compare
  • FAQs
  • Guide
Get WampServer

How to Enable HTTPS (SSL) on WampServer Localhost

enable HTTPS on WampServer localhost

WampServer sites usually run fine on plain http://localhost — until they do not. A payment gateway refuses to test in insecure mode, a plugin insists on HTTPS, or a browser API such as geolocation will not run on an insecure origin. That is when you need a working SSL certificate on WampServer.

The process has three parts: enable Apache's SSL module, create a self-signed certificate with OpenSSL, and tell Apache to use it. No purchase is needed — a self-signed certificate is valid for a machine only you use. If you are new to the stack, read what is WampServer first for how Apache, PHP, and MySQL fit together. If your site uses a local domain such as mysite.test, set that up first with create a virtual host in WampServer — you will issue the certificate for that exact hostname.

What You Need Before You Start

  • WampServer 3.x running, with the tray icon green.
  • Administrator access to edit Apache's configuration files.
  • About 20 minutes. One wrong path will stop Apache from starting, so back up first: copy C:\wamp64\bin\apache\apache2.4.x\conf\httpd.conf and the conf\extra folder somewhere safe. Restoring them gets Apache running again in seconds.

Self-Signed Certificate vs. Trusted Certificate on Localhost

TypeCostBrowser Warning?Best For
Self-signed (OpenSSL)FreeYes, unless you trust it manuallyLocal development and testing
Local CA (e.g., mkcert-style trust)FreeNo, once the local CA is trustedMultiple local sites, team testing
Public CA certificatePaid/freeNoLive, public servers only

A public authority will not issue a certificate for localhost or a .test domain, because you cannot prove public ownership of them — hence the self-signed route locally. The browser warning simply means it cannot verify who made the certificate; on your own machine, you know: you did.

How to Enable HTTPS on WampServer: Step-by-Step

Step 1: Enable the Apache SSL Module

  1. Left-click the WampServer tray icon.
  2. Go to Apache > Apache modules.
  3. Find ssl_module in the list and make sure it is ticked. If it is not, click it to enable it.
  4. WampServer will restart Apache. Wait for the tray icon to return to green.

Also check PHP > PHP extensions and confirm php_openssl is enabled — PHP applications often need OpenSSL too.

Step 2: Open a Command Prompt in the Apache bin Folder

Navigate to your Apache bin folder, for example C:\wamp64\bin\apache\apache2.4.x\bin. Click in the address bar, type cmd, and press Enter. The Command Prompt opens there, where openssl.exe lives.

Step 3: Generate a Private Key and Certificate

Run this command, replacing localhost with your virtual host name if you use one:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt

OpenSSL will ask a few questions. Most fields can be left blank, but set Common Name (CN) to exactly localhost — or your local domain, such as mysite.test. It must match the address you type in the browser. The command creates server.key (keep it private) and server.crt (your certificate) in the bin folder.

Step 4: Move the Key and Certificate Into the conf Folder

Move server.key and server.crt into:

C:\wamp64\bin\apache\apache2.4.x\conf\

Subfolders such as conf\ssl\ also work — just remember the exact paths for the next step.

Step 5: Enable the SSL Virtual Host in Apache

Now tell Apache to listen on port 443 and use your certificate.

  1. Open conf\httpd.conf and confirm these two lines are present and not commented out with a #:
    • - LoadModule ssl_module modules/mod_ssl.so
    • - Include conf/extra/httpd-ssl.conf
  2. Open conf\extra\httpd-ssl.conf and find the <VirtualHost _default_:443> block.
  3. Inside it, set these values to match your setup:
    • - ServerName localhost:443 (or your local domain)
    • - DocumentRoot "c:/wamp64/www" (or your site's folder)
    • - SSLCertificateFile "conf/server.crt" — your certificate path
    • - SSLCertificateKeyFile "conf/server.key" — your key path
  4. Save both files.

Also confirm httpd.conf contains Listen 443. If it is missing, add it on its own line near the existing Listen 80.

Step 6: Restart WampServer and Test HTTPS

Left-click the tray icon and choose Restart All Services. If the icon returns to green, Apache accepted the SSL configuration. Open your browser and visit https://localhost/ — note the https.

Your browser will warn "Your connection is not private." Click Advanced, then Proceed to localhost. That warning is expected for a self-signed certificate and is safe on your own machine. If the page loads, HTTPS is working.

How to Stop the Browser Warning (Optional)

To remove it, trust your certificate: open Windows Certificate Manager (certmgr.msc), go to Trusted Root Certification Authorities > Certificates, and import server.crt, then restart your browser. Chrome and Edge use the Windows store; Firefox has its own, so import it under Settings > Privacy & Security > Certificates there.

Troubleshooting: Apache Will Not Start After Enabling SSL

  • Icon stays orange or red: a path or typo in httpd-ssl.conf is the usual cause. Re-check that SSLCertificateFile and SSLCertificateKeyFile point to files that exist.
  • Check the error log: left-click the tray icon, go to Apache > Apache error log. The last lines name the exact file and line Apache failed on.
  • Port 443 already in use: another program may hold port 443. Close it, or check with netstat -ano | findstr :443 in Command Prompt.
  • Restore and retry: if you are stuck, restore your backed-up httpd.conf and extra folder, restart to green, and repeat the steps more slowly.

This is the same HTTPS protocol that protects banking and email on the public internet — only the certificate's trust chain differs on localhost.

Frequently Asked Questions

Is a self-signed certificate safe to use on localhost?

Yes, for local development. The encryption is exactly as strong as with any other certificate; the only difference is trust — no public authority vouches for it, which is irrelevant on a machine only you control. Never use one on a public, live server.

Will enabling HTTPS slow down my local site?

Not noticeably. The overhead is tiny on a modern PC, and your browser reuses the secure session after the first connection. If localhost feels slow, PHP or a heavy database query is a far more likely cause than SSL.

Do I need a separate certificate for each virtual host?

Ideally, yes — one certificate per hostname, with that hostname as the Common Name, and its own SSLCertificateFile entries per virtual host. One certificate can cover several names via Subject Alternative Names, but per-site certificates are simpler to manage.

My site loads over HTTPS but shows mixed content warnings. Why?

The page is secure, but something inside it — an image, stylesheet, or script — still loads over http://. In WordPress, update the Site URL to https:// and fix hard-coded http://localhost links. Once every resource loads over HTTPS, the warning disappears.

Conclusion

Enabling HTTPS on WampServer localhost is a one-time job: switch on ssl_module and php_openssl, generate a self-signed certificate with OpenSSL using your exact hostname as the Common Name, point httpd-ssl.conf at the certificate and key, and restart all services. Accept — or trust away — the expected warning, and payment testing, secure browser APIs, and pre-launch checks now work the way they will on the live server.

WampServer

WampServer simplifies local web development on Windows with essential resources for downloading, installation, configuration, server management, and troubleshooting to ensure a smooth development experience.

Navigation

  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 | WampServer | All Right Reserved

Disclaimer: Not affiliated with WampServer or any other third-party platforms