Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To run WordPress locally with XAMPP, install XAMPP, start its Apache and MySQL/MariaDB services, put the WordPress files in XAMPP’s htdocs folder, create a database in phpMyAdmin, and open the site through a localhost URL. The procedure below is Windows-focused; Apache Friends provides separate instructions for macOS and Linux.

What XAMPP does—and what WordPress still needs

XAMPP is a local web-server package. It bundles Apache for serving web pages, PHP for running WordPress code, a MySQL-compatible database server, and phpMyAdmin for managing databases through a browser. WordPress itself is a separate download that you place inside XAMPP’s web root.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A local installation is useful for learning WordPress, testing themes and plugins, building a site before publishing it, or developing without an internet connection. It is not automatically a secure public hosting environment. A production server needs supported software versions, HTTPS, access controls, backups, and a hardened configuration.

Check requirements before installing

For current production compatibility, WordPress recommends PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.0 or greater, and HTTPS. Older combinations such as PHP 7.4 or later and MySQL 5.5.5 or later may still run some WordPress releases, but WordPress identifies those versions as end-of-life and warns that they can expose a site to security vulnerabilities.

For local work, also prepare:

  • A Windows account that can install applications and write to the chosen XAMPP directory.
  • A modern web browser.
  • A plain-text editor for editing configuration files.
  • Enough free disk space for XAMPP, WordPress, themes, plugins, uploads, and database backups.

FTP is not required when the site remains on the same computer. FTP becomes relevant only when you later upload files to a remote host.

Install XAMPP on Windows

Download the installer

Download the Windows package from the official Apache Friends distribution. Select the components that provide Apache, PHP, the MySQL-compatible database server, and phpMyAdmin. Record the installation directory; the web root is located inside it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a simple installation path

A short path such as C:xampp is easier to type and troubleshoot than a deeply nested or unusual directory. Windows permissions can complicate installations under protected system folders, so follow the installer’s guidance if it warns about a restricted location.

Finish the component installation

Allow the installer to complete the selected components. You do not need to install WordPress during this step; WordPress is downloaded and added separately in the next stage.

Start Apache and MySQL/MariaDB

Use the XAMPP Control Panel

  1. Open the XAMPP Control Panel from the Start menu or the installation directory.
  2. Click Start beside Apache.
  3. Click Start beside MySQL (the package may label the database service differently, such as MariaDB).
  4. Confirm that both services show a running or green state before opening the WordPress installer.

The Control Panel can manually start and stop Apache and MySQL, or install them as Windows services. Manual startup is usually simpler for a first project because the services run only when you need them. Installing them as services is optional and causes them to start according to your Windows service settings.

If Apache does not start

Apache commonly listens on HTTP port 80. Another web server, development tool, VPN component, or system service may already be using that port. Check the Apache log in the Control Panel to identify the reported port or binding error. Stop or reconfigure the competing service, then start Apache again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you intentionally change Apache to another port, use that port in every browser address. For example, a site that normally opens at http://localhost/my-site/ may require http://localhost:8080/my-site/ after a port change.

If MySQL or MariaDB does not start

Check whether another MySQL or MariaDB service is already running on Windows. Stop the competing service if it is not needed, then retry from the XAMPP Control Panel. If the failure continues, inspect the database log for the specific error instead of deleting database files or reinstalling blindly.

Download WordPress and put it in the XAMPP web root

Extract the WordPress package

Download the current WordPress package from WordPress.org and extract it. The extraction normally creates a directory named wordpress.

Copy the directory into htdocs

Move the complete directory into XAMPP’s web root, usually:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
C:xampphtdocswordpress

The exact path depends on where you installed XAMPP. The important relationship is that the WordPress folder is directly inside the htdocs directory, not beside it or inside an unrelated downloads folder.

Choose the local URL

The folder name becomes part of the local address:

Folder on disk Browser address
htdocswordpress http://localhost/wordpress/
htdocsmy-site http://localhost/my-site/

You may rename wordpress to a project name such as my-site before installation. Use the renamed directory consistently in the URL and in any later migration instructions.

Create the WordPress database in phpMyAdmin

Open phpMyAdmin

  1. Make sure Apache and MySQL/MariaDB are running.
  2. Open a browser and go to http://localhost/phpmyadmin/.
  3. Choose the option to create a new database.
  4. Enter a project-specific name, such as wordpress_local.
  5. Create the database using the available default character-set and collation options unless your project has a documented requirement for another choice.

WordPress requires MySQL or MariaDB; other database engines are not supported for a normal WordPress installation. Do not delete XAMPP’s system databases while looking for your new project database. If several local sites will share one XAMPP installation, give each site its own database name.

Record the four connection values

During installation, WordPress asks for:

  • Database name: the name you created, such as wordpress_local.
  • Database user: the MySQL/MariaDB account configured in your XAMPP installation.
  • Database password: the password for that account. Do not assume it is blank; use the credentials actually configured on your computer.
  • Database host: usually localhost for a default local setup.

Run the WordPress installer

Open the installer

Visit the folder URL in your browser, for example http://localhost/wordpress/ or http://localhost/my-site/. If the services and files are in the expected locations, WordPress displays its setup screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enter the database details

  1. Select the installation language.
  2. Enter the database name created in phpMyAdmin.
  3. Enter the database user and its password.
  4. Enter localhost as the database host unless your XAMPP configuration uses another host.
  5. Leave the table-prefix value at its default unless you have a specific reason to change it.
  6. Submit the form and allow WordPress to create its tables.

A database connection error at this stage almost always means that the service is stopped or one of the four values does not match the account and database configured in phpMyAdmin.

Complete the administrator setup

Enter a site title, administrator username, a strong password, and an email address. Because this is a local site, you can use a development-only address, but keep the administrator password unique and do not publish real credentials in screenshots, tutorials, or shared project archives.

Configure wp-config.php manually when needed

Most installations create the configuration file through the browser. If the installer cannot write the file, WordPress provides the configuration contents for you to copy into a file named wp-config.php in the WordPress installation root—the same directory that contains folders such as wp-admin, wp-content, and wp-includes.

The core database fields look like this:

define('DB_NAME', 'wordpress_local');
define('DB_USER', 'root');
define('DB_PASSWORD', 'yourmysqlpassword');
define('DB_HOST', 'localhost');

Replace every example value with the credentials configured on your machine. The username may not be root, and the password may not be empty. Save the file with the exact .php extension, not as wp-config.php.txt, then reload the local URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the local site

Check both the front end and dashboard

After the installer finishes, open the site address and then sign in at the local administrator URL. Keep the browser address on localhost; this confirms that Apache is serving the site from your computer rather than from a public host.

Perform a small test

  1. Change the site title in the WordPress settings.
  2. Activate a theme.
  3. Create and publish a test page.
  4. Open the page in a separate browser tab and confirm that links and images load.
  5. Install only the themes and plugins needed for the development task.

When you finish working, stop Apache and MySQL/MariaDB in the XAMPP Control Panel if you do not need the local site running.

Troubleshoot the most common failures

Symptom Checks and corrective action
localhost does not load Confirm Apache is running in the Control Panel. Check the Apache log, verify its port, and use the matching port in the URL if it is not port 80.
Database connection error Confirm MySQL/MariaDB is running. Compare the database name, user, password, and host in the installer or wp-config.php with the account and database shown in phpMyAdmin.
404 at the project URL Verify that the WordPress directory is directly inside XAMPP’s htdocs web root and that the URL exactly matches the folder name, including capitalization where the filesystem requires it.
Blank page or PHP error Check that the PHP version bundled with XAMPP meets the WordPress requirement. Inspect the Apache and PHP error logs, and avoid accidentally running a separate system PHP instead of XAMPP’s PHP.
Port conflict Identify the other service using the HTTP port, stop or reconfigure it, or assign Apache another port and include that port in every local URL.
phpMyAdmin will not open Confirm Apache and MySQL/MariaDB are both running, then retry http://localhost/phpmyadmin/. A service that appears started but immediately stops requires checking its corresponding log.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Secure the XAMPP installation

XAMPP is intended for local development. Do not expose its default control panel, phpMyAdmin, or an un-hardened database server to the public internet. On a shared development computer, follow the XAMPP security guidance to set a MySQL password and protect the XAMPP web panel.

  • Use a nontrivial database password rather than relying on an assumed blank password.
  • Keep the local services bound to the computer or trusted development network.
  • Do not place production secrets, customer data, or private backups in a casually shared XAMPP directory.
  • Remove test administrator accounts and unused plugins before exporting a site.

Moving from local development to production

A working localhost site is not a production deployment. Before publishing, re-check the current WordPress baseline: PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.0 or greater, web-server support such as Apache or Nginx, and HTTPS. Confirm that the host supports the required PHP extensions and lets you apply security updates.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A migration also requires more than copying the visible files. You must transfer the database, copy the wp-content directory and other required files, update the site and home URLs, review serialized data, configure HTTPS redirects, test permalinks, and verify file permissions. Keep the local installation as a backup source until the public site has been tested.

XAMPP compared with other local WordPress approaches

XAMPP is a general-purpose Apache/PHP/database bundle. Other local stacks can be better for particular workflows, but the right choice depends on how much control you need over versions and deployment parity.

Option Operating-system coverage and setup Version and service control Multiple-site workflow Production similarity and migration
XAMPP Packages are available for Windows, macOS, and Linux; the walkthrough above uses Windows and a graphical Control Panel. Services are started and stopped in a GUI; the bundled versions depend on the downloaded package. Works well when each project has a separate folder and database, but you manage those names and settings yourself. Convenient for Apache/PHP/MySQL-style development, though you must deliberately match production versions and migrate files and databases.
Local Designed around a graphical WordPress workflow; installation and site creation are generally more guided. Usually emphasizes per-site environments and easier switching, with less manual service administration. Often convenient for creating and switching among several WordPress sites. Useful when you want WordPress-specific import/export tools; verify that its PHP and database versions match the intended host.
MAMP Commonly selected by macOS users and also available for Windows; setup is GUI-oriented. Provides a managed local stack with version choices that depend on the edition and package. Supports multiple document roots, but projects may require more manual configuration than a WordPress-specific tool. Can mirror Apache/PHP/database hosting, provided you select compatible versions.
WAMP Focused on Windows and installed as a Windows web stack. Offers GUI service controls and version management according to the package. Suitable for several virtual hosts, but setup is more hands-on. Useful for Apache/PHP/MySQL parity; migration steps remain your responsibility.
Docker Runs through containers on supported desktop operating systems; initial setup is more technical. Strong control over exact PHP, database, and web-server versions through configuration files. Excellent for repeatable, isolated projects, although each site needs its own container configuration. Often closest to a containerized production architecture; requires comfort with command-line workflows, volumes, networking, and backups.

Choose XAMPP when you want a straightforward, visible Apache/PHP/database stack and are comfortable managing folders and databases yourself. Choose a more specialized or containerized workflow when per-site version isolation, repeatability, or production parity matters more than the simplest first installation.

Quick completion checklist

  • XAMPP is installed in a known directory.
  • Apache is running without a port conflict.
  • MySQL or MariaDB is running.
  • WordPress is inside the XAMPP htdocs directory.
  • A dedicated database exists in phpMyAdmin.
  • The database name, user, password, and host match the installer or wp-config.php.
  • The site opens through the correct localhost URL.
  • A test page, theme, and administrator login work.
  • Local services are not exposed publicly, and production requirements have been reviewed before deployment.