XAMPP on Windows

Author: JJustis | Published: 2025-10-21 03:38:37
Article Image 1
How to Install and Use XAMPP on Windows for a Public-Facing Server

XAMPP is a free, easy-to-install Apache distribution containing MySQL (MariaDB), PHP, and Perl. This guide will show you how to install XAMPP on Windows, start your web server, and configure port forwarding to allow public access.
Step 1: Download XAMPP
  • Go to the official Apache Friends website: https://www.apachefriends.org
  • Select the latest Windows version of XAMPP and download the installer.
  • Save the installer to a location on your computer.
  • Step 2: Install XAMPP
  • Run the downloaded installer as Administrator.
  • Select the components you want to install (for a basic server, select Apache, MySQL, PHP, and phpMyAdmin).
  • Choose the installation directory (default is C:\xampp).
  • Click Next and follow the prompts to complete the installation.
  • Step 3: Start Apache and MySQL
  • Open the XAMPP Control Panel.
  • Click Start next to Apache and MySQL.
  • If successful, the status should turn green indicating the servers are running.
  • Test locally by opening your browser and visiting http://localhost.
  • Step 4: Configure Port Forwarding on Your Router
  • Access your router’s admin page (usually 192.168.0.1 or 192.168.1.1).
  • Locate the Port Forwarding or Virtual Server section.
  • Forward external port 80 (HTTP) and 443 (HTTPS) to the internal IP of your Windows machine running XAMPP.
  • For security, optionally forward MySQL port 3306 only if needed, but avoid exposing it publicly.
  • Save changes and reboot your router if necessary.
  • Step 5: Configure Windows Firewall
  • Open Windows Defender Firewall settings.
  • Create a new inbound rule to allow connections on TCP port 80 and 443.
  • Ensure the firewall allows Apache to accept connections on these ports.
  • Step 6: Test Your Public Server
  • Find your public IP address by visiting https://whatismyipaddress.com.
  • From an external network, open a browser and enter your public IP (e.g., http://123.45.67.89).
  • If correctly configured, your XAMPP homepage or hosted site should appear.
  • For a more user-friendly URL, you can use dynamic DNS services like No-IP or Dynu.
  • Step 7: Hosting Your Website
  • Place your website files inside the XAMPP htdocs folder (usually C:\xampp\htdocs).
  • Access your site locally via http://localhost/yourfolder.
  • Access your site externally via your public IP or dynamic DNS address.
  • Step 8: Security Considerations
  • Never expose sensitive services like phpMyAdmin or MySQL publicly without strong authentication.
  • Use strong passwords for MySQL users.
  • Regularly update XAMPP and PHP to patch security vulnerabilities.
  • Optionally, set up SSL using Let’s Encrypt or self-signed certificates for HTTPS.
  • Example Port Forwarding Table
    External Port Internal IP Internal Port Protocol
    80 192.168.1.100 80 TCP
    443 192.168.1.100 443 TCP
    3306 (optional) 192.168.1.100 3306 TCP
    Conclusion
    Installing XAMPP on Windows and configuring port forwarding allows you to host a public-facing server for testing, development, or small websites. Always follow security best practices to protect your system while making it accessible online.