Installing WordPress on XAMPP creates a disposable Windows-based site for theme work, plugin testing, content imports, and upgrade checks without touching a hosted server. A local stack is also the quickest way to confirm that the site can boot cleanly before files or database changes move elsewhere.
XAMPP bundles Apache, PHP, and a local database server, serves projects from \xampp\htdocs, and exposes the stack through the XAMPP Control Panel. Current Apache Friends documentation still uses http://localhost/ as the local health-check URL, keeps phpMyAdmin on the local host by default, and treats \xampp\htdocs as the main document root for web content.
XAMPP is a development stack, not a production deployment target. Current Windows guidance still favors installing it in a writable path such as C:\xampp instead of Program Files to avoid UAC friction while editing site files, and Apache must be able to bind to its configured HTTP port before the WordPress installer will load. A dedicated WordPress database user is safer than reusing the default database administrator account, even on a local lab.
Related: How to install WordPress on WampServer
Related: How to install WordPress on MAMP
Steps to install WordPress on XAMPP:
- Install XAMPP for Windows and keep the main path at C:\xampp.
If XAMPP is already installed, go straight to the XAMPP Control Panel and confirm the current install path before adding the WordPress files.
Installing under Program Files commonly adds avoidable write-permission problems for htdocs and site files.
- Open the XAMPP Control Panel.
- Start Apache and MySQL from the XAMPP Control Panel.
Current XAMPP builds ship MariaDB even though the database service is still labeled MySQL in the control panel.
If Apache fails to start, stop the existing port 80 listener first, especially IIS or the World Wide Web Publishing Service on Windows.
- Open the local XAMPP start page and confirm the stack responds.
http://localhost/
- Create a dedicated WordPress project directory under the XAMPP document root.
C:\xampp\htdocs\wordpress-xampp
Keeping the site in its own folder avoids replacing the default XAMPP landing page and keeps the local URL predictable.
- Download the current WordPress ZIP package from wordpress.org and extract it on the Windows host.
- Copy the extracted WordPress files into the project directory.
Move the contents of the extracted wordpress directory into wordpress-xampp so the final local URL stays at /wordpress-xampp/ instead of /wordpress/.
- Open phpMyAdmin from the local XAMPP stack and create the WordPress database.
http://localhost/phpmyadmin Database name: wordpress_xampp Collation: utf8mb4_general_ci
Current WordPress installation guidance still treats utf8mb4_general_ci as a safe default when a language-specific collation is not required.
- Create a dedicated database user and grant it all privileges on the new database.
Username: wordpress_xampp Host: localhost Password: choose-a-strong-password Privileges: ALL on wordpress_xampp
WordPress installation guidance still expects the host value to be localhost in the common single-machine setup.
- Browse to the new site URL to start the WordPress installer.
http://localhost/wordpress-xampp/
If the browser does not enter the setup wizard automatically, open http://localhost/wordpress-xampp/wp-admin/setup-config.php directly.
- Enter the database connection details from phpMyAdmin and continue the configuration.
Database Name: wordpress_xampp Username: wordpress_xampp Password: choose-a-strong-password Database Host: localhost Table Prefix: wp_
If WordPress cannot write wp-config.php automatically, copy wp-config-sample.php to wp-config.php inside C:\xampp\htdocs\wordpress-xampp, paste the same database values, and reload the installer.
- Complete the site information form and create the first WordPress administrator account.
Site Title: WordPress on XAMPP Username: localadmin Password: choose-a-strong-password Email: admin@example.test
Avoid the username admin on any install that might later be migrated or exposed outside the local machine.
- Sign in to wp-admin and confirm that the local dashboard loads.
Success here confirms that Apache, PHP, the database connection, and wp-config.php are all working together.
- Open Settings → Permalinks, select Post name, and save the change.
If WordPress shows rewrite rules instead of saving them automatically, copy the generated block into C:\xampp\htdocs\wordpress-xampp\.htaccess and save it.
- Open a sample post or page and confirm the local URL now uses a readable slug instead of ?p=123.
Examples: http://localhost/wordpress-xampp/hello-world/ http://localhost/wordpress-xampp/sample-page/
If those URLs return 404, recheck the permalink step and the local \.htaccess file before changing anything else.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
