How to Enable Localhost HTTPS (SSL) on WAMP Server Guide

To enable HTTPS/SSL on your local WAMP server, follow these steps:

Prerequisites

  • WAMP Server installed (latest version)
  • Administrative access to your computer

Step-by-Step Guide

1. Enable SSL Module in Apache

  1. Left-click the WAMP icon in the system tray
  2. Go to Apache > Apache Modules
  3. Check ssl_module to enable it
  4. Wait for WAMP to restart automatically

2. Configure Apache for SSL

  1. Open httpd.conf (via WAMP menu: Apache > httpd.conf)
  2. Uncomment or add this line:
    Include conf/extra/httpd-ssl.conf
  3. Save the file

3. Create SSL Certificate

  1. Open command prompt as administrator
  2. Navigate to Apache’s bin directory (typically C:\wamp64\bin\apache\apache2.x.x\bin)
  3. Run these commands:CopyDownloadopenssl genrsa -out server.key 2048 openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

4. Configure SSL Virtual Host

  1. Open httpd-ssl.conf (in C:\wamp64\bin\apache\apache2.x.x\conf\extra)
  2. Update these directives:
    <VirtualHost _default_:443>
    DocumentRoot "C:/wamp64/www" ServerName localhost:443 SSLEngine on SSLCertificateFile "C:/wamp64/bin/apache/apache2.x.x/bin/server.crt" SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.x.x/bin/server.key"
    </VirtualHost>
  3. Save the file

5. Update Windows Hosts File

  1. Open C:\Windows\System32\drivers\etc\hosts as administrator
  2. Ensure this line exists:
    127.0.0.1 localhost

6. Restart WAMP Services

  1. Left-click WAMP icon
  2. Click “Restart All Services”

7. Test HTTPS

  1. Open browser and visit https://localhost
  2. You’ll see a security warning (this is normal for self-signed certificates)
  3. Proceed to the site (in Chrome: click “Advanced” then “Proceed to localhost”)

Troubleshooting

  • If port 443 is in use, check httpd-ssl.conf for the correct port
  • Ensure all paths in configuration files are correct
  • Check Apache error logs if HTTPS doesn’t work

Remember that this creates a self-signed certificate that browsers won’t trust by default. For development purposes, this is fine, but for production you’d need a certificate from a trusted Certificate Authority.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top