How to Install XAMPP on Windows Server 2022

Install XAMPP on Windows Server 2022 with Apache, MariaDB, PHP, firewall rules, a working test page, security tips, and common fixes for new VPS admins.
A glowing Windows-style web server panel sits beside an Apache tower and database cylinder in a dark blue data center.

To install XAMPP on Windows Server 2022, use the official Windows installer, start Apache and MariaDB from the control panel, and test a PHP page. You can finish the basic setup in about ten minutes, then decide whether the site should remain private or be exposed through a firewall and domain.

Prerequisites

  • A patched, 64-bit Windows Server 2022 installation with at least 2 GB of free disk space for XAMPP and your test files.
  • An RDP session with a local administrator account that can approve UAC prompts and run elevated PowerShell.
  • Outbound HTTPS access to download the installer from the official Apache Friends XAMPP page.
  • A domain is not required for a local test. For a public website, prepare YOUR_DOMAIN and a TLS certificate before sending real traffic to the server.
  • A VPSLake Windows RDP server if you need a Windows environment with administrator access.

Step 1: Confirm Windows Server 2022 and the architecture

Checking the OS first prevents you from troubleshooting an installer on an unsupported or incorrectly provisioned machine.

Open Start → Windows PowerShell, then run:

Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, OSArchitecture

Expected output resembles:

Caption                         Version        OSArchitecture
-------                         -------        --------------
Microsoft Windows Server 2022  10.0.20348    64-bit

Continue only when the caption identifies Windows Server 2022 and the architecture is 64-bit. The exact build number can differ after Windows updates.

Step 2: Download the current XAMPP installer

Getting the installer from Apache Friends ensures that the package and its version information come from the project’s official download page.

In the RDP session, open the Apache Friends download page, find XAMPP for Windows, and select the current Windows installer. Save the executable in C:\Users\Administrator\Downloads or another folder you control. Do not use an installer copied from an unknown software site.

The current XAMPP page identifies the bundle as Apache, MariaDB, PHP, and Perl. Although the control panel uses a MySQL label for the database module, modern XAMPP releases ship MariaDB; their commands and client tools are compatible for the basic checks in this guide.

Step 3: Install XAMPP outside Program Files

Installing into a short top-level folder avoids Windows’ protected Program Files permissions when you edit web files or configuration files.

Open the downloaded installer, approve the administrator prompt, and complete the wizard as follows:

  1. Keep Apache, PHP, MySQL, and phpMyAdmin selected. Leave FileZilla, Mercury, Tomcat, and other optional components unselected unless your application specifically needs them.
  2. Set the installation folder to C:\xampp. Do not lower or disable User Account Control; accept the normal UAC prompt when an administrative operation requires it.
  3. Keep the language and remaining defaults, select Next, and wait for the files to finish copying.
  4. Leave Launch XAMPP Control Panel selected and choose Finish.

The official XAMPP Windows FAQ documents the installer, the control panel, the C:\xampp\htdocs document root, and the bundled MariaDB terminology.

Step 4: Start Apache and MariaDB

The control panel starts the two services independently, so you can keep the database stopped when a particular project does not need it.

If the panel is not open, right-click Start → XAMPP Control Panel and select Run as administrator. In the panel, select Start next to Apache, then select Start next to MySQL. The rows should turn green and show Running; the MySQL row starts the bundled MariaDB server.

For a first test, do not select Svc to install either module as a Windows service. Manual starts make it clear which components are running. If you later need automatic startup, install only the services you understand and manage them from Server Manager → Tools → Services.

Step 5: Create a local PHP test page

A small page in the XAMPP document root proves that Apache can serve files and that its PHP handler is working.

Open an elevated PowerShell window and run:

@'
<?php
echo "XAMPP on Windows Server 2022 is working";
?>
'@ | Set-Content -Path C:\xampp\htdocs\health.php -Encoding ascii
(Invoke-WebRequest -UseBasicParsing http://127.0.0.1/health.php).Content.Trim()

Expected output:

XAMPP on Windows Server 2022 is working

Keep the page only while testing. After verification, remove it or replace it with your application’s real entry point:

Remove-Item C:\xampp\htdocs\health.php

Step 6: Allow public HTTP only when needed

Localhost does not require an inbound firewall exception. If this server must serve a public HTTP site, allow TCP port 80 in Windows Firewall and in any VPS provider firewall, while leaving database port 3306 closed.

In Administrator PowerShell, run:

New-NetFirewallRule -DisplayName "XAMPP Apache HTTP (TCP 80)" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 80 -Profile Domain,Private,Public
Get-NetFirewallRule -DisplayName "XAMPP Apache HTTP (TCP 80)" | Select-Object DisplayName, Enabled, Direction, Action

Expected rule output includes:

DisplayName                 Enabled Direction Action
-----------                 ------- -------- ------
XAMPP Apache HTTP (TCP 80)  True    Inbound  Allow

Do not open TCP 3306, phpMyAdmin, FTP, or mail ports to the internet. Do not add an HTTPS rule until Apache has a valid certificate and TLS virtual host configured; a plain XAMPP install is not automatically an HTTPS deployment. If you use a domain, point its DNS A record to SERVER_IP, then browse to http://YOUR_DOMAIN/ after Apache is running.

Verify XAMPP on Windows Server 2022

Run these checks from the server to verify the web server, PHP CLI, database client, and listening port:

Get-NetTCPConnection -LocalPort 80 -State Listen | Select-Object LocalAddress, LocalPort, State
C:\xampp\php\php.exe -v
C:\xampp\mysql\bin\mysql.exe --version
curl.exe -I http://127.0.0.1/

Successful output is similar to:

LocalAddress LocalPort State
------------ --------- -----
0.0.0.0    80        Listen

PHP 8.2.x (cli) ...
mysql  Ver 15.1 Distrib 10.4.x-MariaDB ...
HTTP/1.1 200 OK

From another computer, replace the loopback address with SERVER_IP and request http://SERVER_IP/. You should see the XAMPP dashboard or your site. If the local request succeeds but the remote request fails, work through the firewall checks below.

Troubleshooting

make_sock: could not bind to address 0.0.0.0:80

Another program already owns port 80, commonly IIS’s World Wide Web Publishing Service. Find the process with:

Get-NetTCPConnection -LocalPort 80 -State Listen | ForEach-Object { Get-Process -Id $_.OwningProcess }

If it is IIS and you do not need IIS, stop it from Server Manager → Tools → Services → World Wide Web Publishing Service, or run Stop-Service W3SVC in an elevated shell. Otherwise change Apache’s Listen and ServerName ports in C:\xampp\apache\conf\httpd.conf, then browse to the new port.

http://127.0.0.1/ works, but http://SERVER_IP/ times out

Apache is running locally, but Windows Firewall, the provider’s network firewall, or a missing public IP route is blocking the request. Confirm the TCP 80 rule above, allow TCP 80 in the VPS control panel if it has a separate firewall, and test by IP before troubleshooting DNS. Do not disable the firewall to solve this.

Windows denies edits under the XAMPP folder

This usually means XAMPP was installed under C:\Program Files, where standard users cannot freely modify application files. Reinstall it under C:\xampp or edit from an elevated account; do not grant broad write access to the entire disk.

MySQL will not start or port 3306 is already in use

An existing MySQL or MariaDB service may already be listening on the database port. Check with:

Get-NetTCPConnection -LocalPort 3306 -State Listen -ErrorAction SilentlyContinue
Get-Service | Where-Object { $_.Name -match 'mysql|maria' }

Stop the other database only if you know it is unused, or keep it and do not start XAMPP’s database module. Never delete C:\xampp\mysql\data as a first fix; that can destroy databases.

Hardening

  • Treat XAMPP as a development bundle, not a production security baseline. The project’s FAQ warns that the default configuration is intentionally open and may leave the database administrator without a password.
  • Set a strong MariaDB root password from the local XAMPP security page at http://127.0.0.1/security/, and keep phpMyAdmin restricted to localhost. Never publish phpMyAdmin as a general internet endpoint.
  • Leave FileZilla, Mercury, Tomcat, and port 3306 stopped unless your project needs them. Create a separate database user for each application instead of using root in application code.
  • Keep Windows Server 2022 patched, back up C:\xampp\htdocs and database data, and configure TLS before collecting credentials or serving a public login page.

FAQ

Is XAMPP the same as installing MySQL on Windows Server 2022?

No. XAMPP is a bundled development environment that includes Apache, PHP, Perl, and MariaDB, along with a control panel and optional tools. The panel may call the database row “MySQL,” but the bundled server is MariaDB in current XAMPP releases.

Can I use XAMPP for a production website?

The software can serve a site, but Apache Friends describes XAMPP as a development environment and warns that its defaults are too open for production. For a public service, harden every component, use TLS, restrict administration, separate database credentials, and consider deploying a production-focused stack instead.

Do I need a domain name to install XAMPP?

No. http://127.0.0.1/ tests the server locally, and http://SERVER_IP/ works for a basic remote test once the firewall allows port 80. A domain becomes useful when you need stable URLs, DNS, and a trusted TLS certificate.

Why does XAMPP use MariaDB instead of MySQL?

XAMPP has shipped MariaDB in place of MySQL for many years, while retaining compatible command-line tools and the familiar control-panel label. Applications that require a specific database engine or version should be checked against that requirement before deployment.

Samrat Ghosh
Written by

Samrat Ghosh

Founder & Infrastructure Engineer

Samrat Ghosh is the founder of VPSLake, where he builds and runs the remote desktop and VPS hosting infrastructure the company is built on. He writes hands-on guides about RDP, Windows Server, VPS management and secure remote access - the practical documentation he wishes had…

Previous Article

How to Install Windows via 1-Click Reinstaller

Next Article

How to Open a Port on Windows Server 2022

Write a Comment

Leave a Comment

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

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨