Install and Configure XAMPP on Windows Server 2022 | Easy Steps
In this guide from the Orcacore website, we want to teach you How To Install and Configure XAMPP on Windows Server 2022.
XAMPP stands for X-operating system, Apache, Mysql, Php, Perl. It is an open resource platform that is readily available for free downloading. It includes attributes like supporting Perl, Mercury Mail, and Filezilla, and so on. And it is multiplatform and is supported through many operating systems such as Windows, macOS, and Linux. Also, it is supported using many report codecs that add to its robustness. It is easy to install and configure.
In this guide, you will learn to set up XAMPP on your Windows server. To complete this guide, follow the steps below. Let’s explore how to Install and Configure XAMPP on Windows Server 2022.
1. Download XAMPP For Windows
First, you need to visit the Apache Friends Downloads page and download XAMPP from it. You can choose your XAMPP version and download it to your Windows server. Here we download PHP 8.1.

Then, you need to open your downloaded file, and the installation wizard will open.
2. XAMPP Setup Steps on Windows Server 2022
On the welcome screen, click Next.

Next, you need to choose the XAMPP components that you want to install. Here we install all the components. Select them all and click Next.

After that, in the Installation Folder, you need to choose the directory where to install XAMPP on your Windows server 2022. Accept the default location and click Next.

At this point, you need to choose the XAMPP language that you want to use and click Next.

On the next screen, just click Next.

Now your setup is ready to install XAMPP on your Windows server, click Next.

This will take some time to complete. Then, click Finish to complete your XAMPP installation.

3. Access XAMPP Control Panel
When your installation is completed, you will see your XAMPP control panel on Windows Server 2022.

How To Work With XAMPP?
As you can see, you can perform the following tasks from the XAMPP control panel on your Windows server:
- Start and stop Apache, MySQL, FileZilla, and Mercury services.
- Access the Admin panel for each module.
- Configure settings for each module.
- View logs for each module.
Also, you will see the other buttons that you can perform the tasks:
- Start: This button starts the selected module.
- Stop: This button stops the selected module.
- Admin: This button opens the administration panel for the selected module.
- Config: This button opens the configuration file for the selected module.
- Logs: This button opens the log file for the selected module.
- Shell: Opens a command prompt window.
- Explorer: Opens the XAMPP installation directory in Windows Explorer.
You can use the start button to start the XAMPP modules and their services on the Windows server. When the module starts successfully, the background color of the Module name changes, and the assigned Process ID and Port are displayed under PID(s) and port(s) columns.

XAMPP Modules
The Admin buttons open various tools used to manage the XAMPP modules.
-Apache Module. It opens a sample webpage that contains links to view the version of PHP and PhpMyAdmin.
-MySQL/Maria DB. It opens the PhpMyAdmin web console.
-FileZilla. When we click on the Admin button of FileZilla, it opens another dialog box, where you must specify the connection parameters.
-Mercury. The admin buttons open a console that is used to manage the SMTP server.
-Tomcat. To run the Tomcat services, we must install JDK or JRE on the computer. When we click on the admin button, it opens a web-based console to manage the Tomcat application.
With the Config buttons, you can edit the configuration files of XAMPP modules.
And the Log buttons will open log files containing details of various events, warnings, and errors. Each module of XAMPP has its own set of log files.
Conclusion
At this point, you learn to Install and Configure XAMPP on Windows Server 2022. The purpose of using XAMPP on Windows Server 2022 is to create a local web server environment for developing, testing, and deploying PHP-based web applications. It includes Apache, MySQL/MariaDB, PHP, and other tools, making it easy to manage and run web projects without setting up each component manually. Understanding how to Install and Configure XAMPP on Windows Server 2022 is vital for web development.
Hope you enjoy it. You may also like these articles:
Set up WordPress on Windows Server 2019
Set up PostgreSQL on Windows Server 2019
Change Time Zone on Windows Server 2019
Set up an NFS server on Windows Server 2019
Alternative Solutions for Setting Up a Local Web Server on Windows Server 2022
While XAMPP provides a convenient all-in-one solution, alternative methods exist for setting up a local web server environment on Windows Server 2022. These alternatives often provide greater flexibility and control over the individual components. Here are two such methods:
1. Using Docker Containers
Docker allows you to containerize applications, including web servers, databases, and PHP interpreters. This approach offers excellent isolation and portability.
Explanation:
Instead of installing Apache, MySQL, and PHP directly on the Windows Server, you can use Docker to run each component in separate containers. Docker uses images as blueprints for creating containers. Docker images are available for Apache, MySQL (or MariaDB), PHP, and other necessary tools. You define how these containers interact using a docker-compose.yml
file.
Steps:
- Install Docker Desktop on Windows Server 2022: Ensure you enable Hyper-V and Container features during installation.
- Create a
docker-compose.yml
file: This file defines the services (Apache, MySQL, PHP) and their configurations. - Define the services: Configure each service (e.g., Apache, MySQL) using appropriate Docker images from Docker Hub.
- Start the containers: Use the
docker-compose up
command to start all the containers defined in thedocker-compose.yml
file.
Example docker-compose.yml
file:
version: "3.8"
services:
web:
image: httpd:latest
ports:
- "80:80"
volumes:
- ./html:/usr/local/apache2/htdocs/
depends_on:
- db
db:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: your_root_password
MYSQL_DATABASE: your_database
volumes:
- db_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
environment:
PMA_HOST: db
PMA_PORT: 3306
depends_on:
- db
volumes:
db_data:
Explanation of the docker-compose.yml
:
version
: Specifies the version of the Docker Compose file format.services
: Defines the different services that make up the application.web
: This service runs the Apache web server.image
: Specifies the Docker image to use for the service (in this case, the latest version of Apache HTTPD).ports
: Maps port 80 on the host machine to port 80 in the container.volumes
: Mounts the./html
directory on the host machine to the/usr/local/apache2/htdocs/
directory in the container, allowing you to serve files from your local file system.depends_on
: Specifies that this service depends on thedb
service, ensuring that the database is started before the web server.
db
: This service runs the MariaDB database.image
: Specifies the Docker image to use for the service (in this case, the latest version of MariaDB).environment
: Sets environment variables for the database, including the root password and the database name.volumes
: Creates a named volumedb_data
to persist the database data across container restarts.
phpmyadmin
: This service runs the phpMyAdmin interface for managing the MariaDB database.image
: Specifies the Docker image to use for the service.ports
: Maps port 8080 on the host machine to port 80 in the container.environment
: Sets environment variables to configure phpMyAdmin, including the host and port of the database.depends_on
: Specifies that this service depends on thedb
service.
volumes
: Defines the named volumedb_data
used by thedb
service.
This alternative provides a cleaner and more isolated environment compared to XAMPP, making it easier to manage dependencies and deploy applications.
2. Using Windows Subsystem for Linux (WSL)
WSL allows you to run a Linux environment directly on Windows. You can then install a LAMP stack (Linux, Apache, MySQL, PHP) within the WSL environment.
Explanation:
WSL provides a Linux kernel interface, enabling you to run Linux distributions like Ubuntu, Debian, or Fedora directly on Windows. Within this Linux environment, you can install a traditional LAMP stack using the distribution’s package manager (e.g., apt
for Ubuntu). This keeps your development environment separate from the Windows host, reducing potential conflicts.
Steps:
- Enable WSL: Open PowerShell as administrator and run
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Install a Linux distribution: From the Microsoft Store, install a Linux distribution like Ubuntu.
- Update and upgrade packages: Open the installed Linux distribution and run
sudo apt update && sudo apt upgrade
- Install Apache, MySQL, and PHP: Use the
apt
package manager to install the required components:sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql
- Configure Apache: Configure Apache to serve your PHP files.
Example configuration commands (Ubuntu):
sudo a2enmod php7.4 # Replace 7.4 with your PHP version
sudo systemctl restart apache2
Create a directory for your website files:
sudo mkdir /var/www/your_website
sudo chown -R $USER:$USER /var/www/your_website
Create a simple PHP file (e.g., index.php
) in /var/www/your_website
:
<?php
echo "Hello from WSL!";
?>
Configure a VirtualHost in Apache (e.g., /etc/apache2/sites-available/your_website.conf
):
<VirtualHost *:80>
ServerName your_website.local
DocumentRoot /var/www/your_website
<Directory /var/www/your_website>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable the site and restart Apache:
sudo a2ensite your_website.conf
sudo systemctl restart apache2
Add the following line to your Windows hosts
file (located at C:WindowsSystem32driversetchosts
):
127.0.0.1 your_website.local
Now, you can access your website by opening your_website.local
in your web browser. This method allows you to leverage the Linux ecosystem while still working within Windows, offering a robust and flexible development environment. Using WSL to Install and Configure XAMPP on Windows Server 2022 is not a direct path, it offers a similar and in many ways superior alternative.