Coding Triumph

Helpful code snippets & tutorials

How to host multiple WordPress sites on XAMPP

XAMPP is used by many WordPress developers to set up a local WordPress site as a testing environment. If you are one of these developers, you may find yourself in a situation where you need to run multiple websites instead of just one with the same XAMPP installation. In this post, I’ll walk you through the steps of creating two local websites.


The steps:

These are the steps you need to follow in order to set up multiple WordPress sites on your local machine.

1. Inside the htdocs/ of your XAMPP installation directory, create two folders site1/ and site2/
2. Extract all WordPress files in each of the above folders
3. Go to http://localhost/phpmyadmin/ and create two databases: site1_db and site2_db
4. Inside the site_1/ folder, open the corresponding wp_config.php, add the database name, and save the file

/** Database name */
define( 'DB_NAME', 'site1_db' );
/** Database username */
define( 'DB_USER', 'root' );
/** Database password */
define( 'DB_PASSWORD', 'password' );

5. Do the same for site_2/
6. Finally, visit http://localhost/site_1/ and http://localhost/site_2/ to view your sites


You can now set up as many sites as you want using the same process.

If you like this post, please share
Notify of
Inline Feedbacks
View all comments