How to enable SSL in Wamp Server?

How to enable SSL in Wamp Server?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

How to enable SSL in Wamp Server?

Enabling SSL in Wamp Server isn't a single click; it requires generating certificates, configuring Apache, and handling port conflicts. The confusion often stems from mixing up self-signed certificates with Let's Encrypt or forgetting that Wamp uses the standard httpd.conf structure rather than modern web server management tools. To get a secure connection on your local development environment, you need to understand where Apache looks for its SSL configuration files and how to generate a valid certificate authority chain that browsers will accept without constant warnings.

The process begins with generating the necessary certificates. Since you are likely developing locally, you do not need a commercial domain validation. You can use OpenSSL to create a self-signed certificate. Open your command prompt or terminal and navigate to the Wamp installation directory, typically C:\wamp64\. Run the following command to generate a private key and a certificate:

openssl req -x509 -newkey rsa:2048 -keyout wamppubkey.pem -out wampcert.pem -days 365 -nodes

This command creates two files: wamppubkey.pem (the private key) and wampcert.pem (the public certificate). The -nodes flag ensures the private key is not encrypted with a passphrase, which is crucial for Wamp's automated services to restart without manual password entry. You will be prompted for details like your organization name; these are metadata fields used by browser address bars but do not affect functionality in a local context.

Next, you must point Apache to these new files. Locate the httpd.conf file inside the apache\conf\ directory within your Wamp installation. You need to ensure the SSL modules are loaded. Look for lines containing LoadModule ssl_module and LoadModule socache_shmcb_module. If they are commented out with a semicolon, remove the semicolon.

Once the modules are active, create or edit the ssl.conf file located in apache\conf\extra\. Paste the following configuration block at the end of the file:

<VirtualHost_:443>
    ServerName localhost
    DocumentRoot "C:/wamp64/www"
    
    SSLEngine on
    SSLCertificateFile "C:/wamp64/apache/conf/extra/wampcert.pem"
    SSLCertificateKeyFile "C:/wamp64/apache/conf/extra/wamppubkey.pem"
    
    # Optional: Redirect HTTP to HTTPS for security
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>

This configuration enables the SSL engine and specifies the paths to your generated certificate files. Note that the DocumentRoot points to your standard Wamp web root. If you want all traffic to be secured, the RewriteRule forces any HTTP request (port 80) to redirect to HTTPS (port 443).

A common pitfall in local development is the browser flagging self-signed certificates as "Not Secure." This is expected behavior for self-signed keys. To test your site properly, you must click "Advanced" on the browser warning and proceed anyway, or install the certificate into your system's trusted store. For Wamp specifically, you can use the Wamp tray icon to set the SSL status to "On," which automatically switches Apache from port 80 to 443 and restarts the service.

If you are building a Laravel application, ensure your .env file reflects these changes. Set APP_URL to https://localhost and update your database connection strings if they rely on localhost URLs that might change due to the redirect. If you encounter issues with mixed content errors (where an HTTPS page tries to load an HTTP asset), review your asset compilation settings or ensure your CSS/JS files are served from the HTTPS root.

For more robust local development setups involving multiple domains, consider using Docker Compose with traefik instead of Wamp's native SSL support, as it handles certificate rotation and domain mapping more gracefully. However, for standard PHP/Laravel stacks running directly on Windows, the OpenSSL approach described here remains the most reliable method to secure your local environment without external dependencies.

Our network