How to Install XAMPP on Windows 11

You’re starting a PHP project and want a web server and database running on your own Windows 11 PC before anything goes online. To install XAMPP on Windows 11, download the Windows installer from apachefriends.org, run it, install to C:\xampp rather than Program Files, allow Apache through the firewall on private networks, then start Apache and MySQL in the XAMPP Control Panel and open http://localhost in a browser.

XAMPP is for local development only, not for hosting a live site.

What XAMPP Installs and What It’s For

Apache Friends, the project behind XAMPP, describes it as an easy to install Apache distribution containing MariaDB, PHP and Perl. In practice that gives you:

  • Apache, the web server that answers requests to http://localhost.
  • MariaDB, the database. The Control Panel still labels this module MySQL, and PHP code written for MySQL generally works with it.
  • PHP, plus phpMyAdmin for managing databases in a browser.
  • Extras you can leave out in the installer: FileZilla FTP Server, Mercury Mail, Tomcat and the bundled Strawberry Perl.

Security note: the Apache Friends Windows FAQ says XAMPP is not meant for production use but only for development environments. Out of the box the database administrator account (root) has no password. That’s convenient on your own PC and a real risk anywhere else, so never expose a default XAMPP install to the internet.

Download XAMPP From Apache Friends

Download XAMPP only from the official Apache Friends download page. Copies on other download sites may be outdated or bundled with extra software.

  1. Open the download page and find the XAMPP for Windows section.
  2. Pick a version. Each one is named after the PHP version it includes. When checked in November 2026 the page listed PHP 8.5.12, 8.4.27 and 8.3.36, all as 64-bit installers of about 190 MB.
Apache Friends download page listing XAMPP for Windows versions
Each XAMPP build is named after the PHP version it includes. (Recreated interface)
  1. Select Download (64 bit) and save the .exe file.

Which PHP version? Match the one your project or hosting provider uses. If a course or framework says it needs PHP 8.3, install that build. For a new project with no constraint, the newest PHP version on the page is a sensible pick. The page lists Windows 11 among the supported systems, and there’s no separate 32-bit download, so you don’t need to choose an architecture.

Run the Installer

  1. Double-click the downloaded file. Select Yes when User Account Control asks whether to allow the app to make changes.
  2. If a warning mentions User Account Control and installing to Program Files, select OK. This is why the next steps install elsewhere.
  3. On the component screen, keep Apache, MySQL, PHP and phpMyAdmin checked. Clear the extras you won’t use, such as Mercury Mail or Tomcat; you can always reinstall later.
XAMPP installer component selection screen
Keep the server, database, PHP and phpMyAdmin components. (Recreated interface)
  1. For the installation folder, keep C:\xampp.
  2. Choose a language, select Next through the remaining screens, and wait while files are copied.
  3. On the last screen, leave the option to start the Control Panel checked and select Finish.

Why not Program Files? The Apache Friends FAQ notes that you don’t have full write privileges in C:\Program Files, even as an administrator. XAMPP writes to its own folders constantly (logs, databases, config files), so installing to C:\xampp avoids permission errors. Don’t turn off User Account Control to work around the warning; the install folder fixes it.

If Microsoft Defender SmartScreen blocks the installer, confirm the file came from apachefriends.org before choosing to run it. SmartScreen is controlled from Windows Security under App & browser control.

Start Apache and MySQL in the Control Panel

The XAMPP Control Panel is the program at C:\xampp\xampp-control.exe. If it didn’t open after setup, search for XAMPP Control Panel from Start.

  1. Find the Apache row and select Start.
  2. If Windows Security asks about Apache HTTP Server, allow incoming access on private networks only if another device on your trusted local network needs to reach it. Leave public networks unchecked.
Example Windows Firewall choices for Apache with private access only if needed
Settings guide. If Apache needs incoming access on a trusted private network, leave Public unchecked.
  1. Select Start on the MySQL row and handle its firewall prompt the same way if one appears.
  2. Check that both module names turn green and that port numbers appear beside them (80 and 443 for Apache, 3306 for MySQL by default).
XAMPP Control Panel with Apache and MySQL running
Green module names and port numbers mean both servers are running. (Recreated interface)

Allowing private networks only means other devices on your home network can reach the server if you choose, but nothing on a café or airport network can. Turning off the firewall isn’t necessary; allowing the app keeps protection on for everything else. If you missed the prompt, you can add Apache later with Allow an app through firewall, as described in the Windows 11 firewall settings walkthrough.

Test the Server and Add Your First File

  1. Open a browser and go to http://localhost/. You should see the XAMPP start page.
  2. Open File Explorer and go to C:\xampp\htdocs. This is where your site’s files go.
  3. Create a folder for your project, such as recipe-box.
  4. Inside it, create a text file named index.php containing <?php phpinfo(); ?> and save it. Make sure the name doesn’t end in .txt.
  5. Go to http://localhost/recipe-box/. A long PHP information page means PHP is working.
  6. Go to http://localhost/phpmyadmin/ to open phpMyAdmin and create a database for the project.

Delete the phpinfo test file when you’re done with it, since it shows details about your setup. If you’d rather write your back end in Python instead of PHP, installing Python on Windows 11 is a separate setup that can sit alongside XAMPP.

Fix Apache When It Won’t Start

If Apache turns red, starts and stops at once, or the log in the bottom of the Control Panel mentions a port being blocked or in use, another program is already listening on port 80 or 443.

Find What Is Using the Port

  1. Open Start, type cmd, and open Command Prompt.
  2. Run netstat -ano | findstr :80 and look for a local address ending exactly in :80 (for example 0.0.0.0:80) with the state LISTENING. The last number on that line is the process ID (PID).
  3. Open Task Manager, go to the Details page, and find that PID to see which program owns the port.

Microsoft’s netstat reference explains the switches: -a shows listening ports, -n shows numbers instead of names, and -o adds the owning process ID.

Common Culprits

  • IIS. Windows’ own web server uses port 80. Apache Friends notes that when IIS is running, the World Wide Web Publishing Service takes the same default port as Apache. If you set up IIS earlier using the IIS install steps for Windows 11, stop that service in the Services app or remove IIS from Windows Features if you no longer need it.
  • Another local server. A second Apache, another PHP stack or a developer tool can hold port 80. Close it before starting XAMPP.

Or Move Apache to Another Port

  1. In the Control Panel, select Config on the Apache row and open httpd.conf.
  2. Change the line Listen 80 to Listen 8081, and change ServerName localhost:80 to localhost:8081 if that line is present (Tomcat, if installed, already uses 8080).
  3. Save the file and start Apache again.
  4. Use http://localhost:8081/ from now on.

If the conflict is on 443 instead, the HTTPS port is set in a separate SSL config file in the same Config menu. MySQL problems on port 3306 usually mean another database server is installed; stop it or change the port in the MySQL config file.

Run XAMPP as a Service, Update or Uninstall

Start automatically. Apache Friends says each server can be installed as a Windows service, and doing that from the Control Panel requires administrator rights. Open the Control Panel with Run as administrator, then use the service checkbox beside Apache or MySQL. Most people working on one project at a time are fine starting modules by hand instead.

Set a database password. If other devices on your network can reach this PC, give the MariaDB root account a password in phpMyAdmin under User accounts.

Update. Moving to a newer XAMPP build generally means installing it fresh. Before you do, copy your project folders out of htdocs and export your databases from phpMyAdmin.

Uninstall. Stop all modules and close the Control Panel. Back up anything in htdocs and your databases, then run the XAMPP uninstaller (from Settings > Apps > Installed apps or the uninstall program in C:\xampp). Apache Friends says the uninstaller removes XAMPP’s registry entries and the services it installed.

XAMPP Setup Problems

localhost loads a different page than the XAMPP start page

Something else answered on port 80, usually IIS. Run the netstat check above and stop the other server.

My PHP file downloads or shows as plain text

Make sure you opened it through http://localhost/ rather than double-clicking it in File Explorer, and that the file name really ends in .php.

phpMyAdmin says access denied

If you set a root password, phpMyAdmin needs that password too. Check that MySQL is green in the Control Panel first.

Can I put a live website on XAMPP?

No. Apache Friends says it’s for development. When the project is ready, move the files and database to a proper web host.

Once Apache and MySQL are green and your test page loads, copy your project into htdocs and start building.