How to Install and Set Up XAMPP on Windows: A Complete Guide

XAMPP is a free, open-source software stack that provides an easy way for web designers and developers to install the necessary components to run PHP-based software (like WordPress, Drupal, or Joomla) on their own local computer.

The acronym stands for:

  • X: Cross-platform

  • A: Apache (The web server)

  • M: MariaDB/MySQL (The database)

  • P: PHP (The scripting language)

  • P: Perl (A programming language)

By installing XAMPP, you turn your personal computer into a local server, allowing you to build and test websites offline before publishing them to the internet.


Step 1: Download XAMPP

  1. Open your web browser and navigate to the official Apache Friends website: https://www.apachefriends.org/index.html.

  2. On the homepage, you will see a download section for different operating systems. Click on XAMPP for Windows.

    • Note: Usually, there are multiple versions available based on the PHP version (e.g., PHP 8.0, 8.1, 8.2). If you are unsure which one to pick, download the version with the highest version number (the latest one).

  3. The download will start automatically. Save the .exe file to your computer.

Step 2: Run the Installer

  1. Navigate to your download folder and double-click the installer file (e.g., xampp-windows-x64...installer.exe).

  2. User Account Control (UAC): Windows may ask if you want to allow the app to make changes to your device. Click Yes.

  3. Important Warning: You might see a pop-up warning you about "User Account Control (UAC)" on your system.

    • It typically says that installing XAMPP to C:\Program Files might cause permission issues.

    • Do not worry. Simply click OK. We will install it in the default folder (C:\xampp) to avoid these issues.

Step 3: Installation Wizard

  • Welcome Screen: Click Next.

  • Select Components: You will see a list of tools to install.

    • By default, all options are checked.

    • Required: You definitely need ApacheMySQLPHP, and phpMyAdmin.

    • Optional: You can uncheck FileZilla FTP ServerMercury Mail Server, and Tomcat if you are just doing basic web development, but leaving them checked causes no harm.

    • Click Next.

  • Installation Folder:
    • The installer will ask where to install XAMPP.

    • Default: C:\xampp

    • Recommendation: Keep the default. Do not change this to "Program Files" to avoid permission headaches later.

    • Click Next.

  • Language: Select your preferred language (English or German) and click Next.
  • Bitnami: You may see a screen about "Bitnami for XAMPP." You can uncheck the "Learn more about Bitnami" box and click Next.

  • Ready to Install: Click Next to begin the installation.

    • This process may take a few minutes as it unpacks and installs the files.

  • Completing Installation: Once finished, leave the box checked that says "Do you want to start the Control Panel now?" and click Finish.

Step 4: Using the XAMPP Control Panel

The Control Panel is the command center where you turn your server on and off.

  1. When the Control Panel opens, you will see a list of modules (Apache, MySQL, FileZilla, etc.).

  2. To run a website, you typically need two modules running:

    • Apache: This is the web server that displays your files.

    • MySQL: This manages your databases.

  3. Click the Start button next to Apache.

    • Windows Firewall Prompt: If Windows Firewall pops up, click Allow Access.

  4. Click the Start button next to MySQL.

    • Windows Firewall Prompt: Click Allow Access here as well.

  5. Success: You will know they are working when the module names turn Green background.

Step 5: Verify the Installation

Let's make sure everything is working correctly.

  1. Open your web browser (Chrome, Firefox, Edge, etc.).

  2. In the address bar, type: http://localhost and press Enter.

  3. You should be taken to the Welcome to XAMPP dashboard.

    • If you see this page, your web server is running successfully!

Step 6: How to Create Your First Project

Now that the server is running, where do you put your files?

  1. Open File Explorer and go to your installation folder (usually C:\xampp).

  2. Find the folder named htdocs.

    • This is your "web" folder. Everything you put inside htdocs will be visible in your browser.

  3. Create a new folder inside htdocs for your project, for example: mywebsite.

  4. Create a test file:

    • Open Notepad.

    • Type the following code:

```<?php
echo "Hello! XAMPP is working.";
?>```

    • Save the file inside the C:\xampp\htdocs\mywebsite folder.

    • Name the file index.php (Make sure "Save as type" is set to All Files).

  1. View it in your browser:

    • Go to http://localhost/mywebsite.

    • You should see the text: "Hello! XAMPP is working."