How to Install SSL on XAMPP Self-Hosted Website

Abstract: Resolve SSL configuration errors in XAMPP by generating self-signed certificates and updating Apache settings for local HTTPS access.

Created: 2026-09-03 by
To install SSL on a self-hosted XAMPP website, you must generate a self-signed certificate using OpenSSL and configure Apache to use it. This process involves editing the httpd-ssl.conf file and ensuring the ssl module is loaded in your main configuration. By following these steps, you enable HTTPS for local development or private network access, securing data transmission between your browser and the server.

Prerequisites and Environment Setup

Before configuring SSL, ensure that your XAMPP installation includes the necessary tools. Most standard XAMPP packages for Windows, Linux, and macOS come bundled with OpenSSL, which is required to generate the certificate keys. You should verify that the Apache service is stopped before making any configuration changes to prevent port conflicts or file locking issues. First, navigate to your XAMPP installation directory. On Windows, this is typically C:\xampp. On Linux or macOS, it might be located at /opt/lampp or /Applications/XAMPP. Open the command prompt or terminal and change directories to where OpenSSL is installed within your XAMPP folder. For example, on Windows, the path is often \xampp\openssl\bin. It is crucial to understand that a self-signed certificate will trigger security warnings in modern web browsers like Chrome or Firefox because it is not signed by a trusted Certificate Authority (CA). These warnings are normal for local development environments. If you need a certificate trusted by all devices on your LAN without warnings, you would need to set up a local CA, but for most single-machine testing, a self-signed cert suffices. For more complex TLS issues, refer to our guide on Client Fails TLS Handshake: Troubleshooting Guide if you encounter connection errors later.

Generating the Self-Signed Certificate

The first technical step is creating the key pair and the certificate file. Open your terminal or command prompt and execute the OpenSSL command to generate a private key and a certificate request simultaneously. Use the following command structure, replacing your_domain with a placeholder name like localhost or myserver.local, as this name does not need to match a real DNS entry for local testing.
openssl req -newkey rsa:2048 -nodes -keyout your_domain.key -x509 -days 365 -out your_domain.crt
You will be prompted to enter several pieces of information. The most important field is "Common Name" (CN), which should match the hostname you plan to type in your browser's address bar. If you intend to access your site via https://localhost, set the Common Name to localhost. If you use a custom domain like mysite.test, set it accordingly. Ensure you remember the location where these files are saved, as you will need to reference them in the Apache configuration. Move the generated .key and .crt files into the \xampp\apache\conf\ssl.crt and \xampp\apache\conf\ssl.key directories respectively. This keeps your SSL assets organized and separate from other Apache configurations.

Configuring Apache for SSL

Apache uses a specific configuration file to handle SSL connections. Locate the file named httpd-ssl.conf inside the \xampp\apache\conf\extra directory. Open this file in a text editor with administrative privileges. First, search for the line that loads the SSL engine. It should look like this: LoadModule ssl_module modules/mod_ssl.so Ensure this line is not commented out (i.e., there is no # at the beginning). If it is commented, remove the hash symbol. Next, scroll down to the VirtualHost definition. It usually starts with <VirtualHost _default_:443>. Inside this block, you must point to the certificate files you created earlier. Update the following directives:
  • SSLCertificateFile: Set this to the full path of your .crt file.
  • SSLCertificateKeyFile: Set this to the full path of your .key file.
For example, on Windows, it might look like: SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/localhost.crt" SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/localhost.key" After saving these changes, open the main Apache configuration file, httpd.conf, located in \xampp\apache\conf. Search for the line that includes the extra configuration files. It typically reads: # Include conf/extra/httpd-ssl.conf Remove the # to uncomment this line, allowing Apache to read your new SSL settings. Finally, restart the Apache service through the XAMPP control panel.

Testing the Connection

Once Apache has restarted successfully, open your web browser and navigate to https://localhost (or whatever domain you specified). You will likely see a warning page stating that the connection is not private because the certificate is not trusted. Click "Advanced" and then "Proceed to localhost (unsafe)" to bypass the warning. If the page loads correctly and shows your XAMPP dashboard or website content over HTTPS, the installation was successful. Verify that the padlock icon appears next to the URL, even if it indicates an insecure connection due to the self-signed nature. For users experiencing certificate verification failures during automated tests, check resources like SSL: CERTIFICATE_VERIFY_FAILED when calling Azure library in docker container and in VS code running locally for debugging tips.

Frequently Asked Questions

Why do I get a security warning when accessing my XAMPP site?

This happens because self-signed certificates are not issued by a recognized Certificate Authority, so browsers cannot verify their authenticity. This is expected behavior for local development environments. You can safely proceed by accepting the risk manually in your browser settings.

Can I make the SSL certificate trusted by all devices on my LAN?

Not easily with a simple self-signed certificate. To achieve this, you must create a local Certificate Authority and sign your certificate with it, then install that CA's root certificate into the trust store of every device on your network. Without this step, each device will show its own security warning.

What should I put in the Common Name field when generating the certificate?

The Common Name should match exactly how you plan to access the site in your browser's address bar. If you access the site via IP address, use the IP. If you use a domain name like dev.local, use that exact string. Mismatches here will cause browser errors regarding the certificate identity.

How do I fix "SSL handshake failed" errors after configuration?

Check your Apache error logs in the \xampp\apache\logs directory for specific details. Common causes include incorrect file paths in httpd-ssl.conf or permission issues preventing Apache from reading the private key. Ensure the private key file is not encrypted and that the paths are absolute.

Does XAMPP support Let's Encrypt for local sites?

XAMPP itself does not have a built-in one-click Let's Encrypt installer. However, you can use Certbot to obtain a free certificate and then manually configure Apache to point to those files. Note that Let's Encrypt requires public DNS resolution and port 80/443 accessibility, which is difficult on a purely local home network.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More