How to Install WordPress Multi-Site in Localhost (Using XAMPP)

So you want to install a WordPress Multi-site Network on your local computer using XAMPP, huh? (you like that HTML Goodies throwback?)

Well, in this article, and the accompanying video I will go through the process to make that happen. I will be using XAMPP to run a “web server” on my local machine allowing me to host web sites. PHP and MySQL are included making it work easily for WordPress and WordPress Multi-site. While I am using XAMPP in this example, I might suggest USBWebServer to run a local site web server as the process is much simpler and quicker. Beyond that though I am not sure of the advantages or disadvantages of either.

If you want to install WordPress multi-site on a live server then check this tutorial.

WordPress Multi-site Setup on XAMPP

WP Multi-site Setup Video Tutorial

First, Download and Install XAMPP and Start the Services

  1. Do a Google search for “XAMPP” or head right to https://www.apachefriends.org/xampp.html
  2. In the video I demonstrated using XAMPP for Windows because I have a Windows machine. Those files are found here.
  3. I downloaded the “Installer” package which is an executable that you can just double-click immediately after downloading.
  4. During setup I allowed all the defaults. I gave the software permission to go through the firewall, and let everything install to the default folder on my machine.
  5. After installation you will be asked to launch the Control Panel. Go ahead and launch it. Don’t expect anything exciting, it just creates an icon in the system tray.
  6. Right-click the tray icon for the XAMPP Control Panel and start Apache and MySQL.
  7. Next, visit http://localhost/phpmyadmin
  8. Click on the Databases tab across the top.
  9. Below the Create database box type in a name for your WordPress database (and make note of it) and click the Create button.
  10. You can add a new user for the database, or just use “root.”
  11. Visit http://localhost/security/xamppsecurity.php to set a password for the “root” user.
  12. Right-click the tray icon for the XAMPP Control Panel and stop, and then start, MySQL after changing the “root” password.

Now, Let’s Install the Latest Version of WordPress

In this next part, we go through a typical installation of WordPress with one small change.

1) First, grab the latest installation package from WordPress.org.

2) Extract the files to your computer.

3) Rename wp-config-sample.php to wp-config.php.

4) Modify the wp-config.php file in a text editor and enter in the database name, and database user name and password. Unless you created a new user, the user will be “root” and the password will be whatever you changed the “root” user’s password to be in the steps above. See below for where to add the database info:

define('DB_NAME', 'wp');
define('DB_USER', 'root');
define('DB_PASSWORD', 'password');

5) Now, in the wp-config.php file just below the line that says “define(‘WP_DEBUG’, false);” and above the line that says “That’s all, stop editing” place the following line to activate WordPress Network capabilities.

define('WP_ALLOW_MULTISITE', true);

6) Visit the folder where you installed XAMPP to. If you left everything at the defaults, look for c:\xampp. In there will be a folder called “htdocs.” Empty that folder and move the WordPress files into it.

7) Finish the WordPress installation process by going to http://localhost in your web browser.

Now, Setup the WordPress Network

After following the above steps we are at the point where we got WordPress working on a local machine using XAMPP. And we have “turned on” the ability to have a WordPress Multisite by modifying the WordPress config file. Now, let’s setup the Network by adding some more lines to the wp-config.php and .htaccess files.

1) Login to your WordPress dashboard, which you will be prompted to do after installation.

2) Click Tools >> Network Setup.

3) Give the Network a title, and verify the Network admin email address.

4) Click the Install button.

5) Now you will be presented with two blocks of code. The code in the top box is to be placed into the WordPress config file (the same one where we turned on the ability to have a WordPress Network). Copy the lines and paste them over the “define(‘WP_ALLOW_MULTISITE’, true);” line in wp-config.php. In other words, overwrite that line as it’s no longer needed.

6) Copy the lines from the second box and paste them in the .htaccess file found in the “htdocs” folder. Overwrite all other lines in there that were created by WordPress.

7) Log out, then log back into your WordPress dashboard.

Now, WordPress Multi-site (or Network) is setup on your localhost. In the Network Dashboard you can “network activate” themes and plugins making them available to other “sites” on the network. You can also create/edit sites from within the dashboard.

Comments (7 responses)

  1. Alexander says:

    Thankyou for sharing these amazing tricks to install WordPress using localhost XAMPP. I have really found your post and the other post on WpBlog regarding wordpress installation on localhost helpful for me.

  2. admin says:

    @Jenny, Glad to hear that the tutorial was helpful for you.

  3. Jenny says:

    Thank you so much for your excellent and detailed tutorial!
    I was not able to make it work on my existing installation (which bitnami had placed under apps in xampp) but I was successful after re-installing wp directly under htdocs. In case it’s helpful to anyone, I had to create a new folder with “wordpress” as a subfolder (wp2/wordpress) to keep from launching the old wordpress files.
    I checked several forums and guidelines but yours was the only one that helped me get this done! Brilliant.

  4. Anika says:

    Hi!
    I am using xampp and followed a tutorial to install multisites. Everything fine until I have to relogin. After logging in I see my blog as if I am a user. No admin panel to be seen. When I am typing the direct link to wp-admin into the browser nothing happens.
    Do you have an idea what happened?

  5. Sandra says:

    Hi Keith,

    Thank you for this “tipsandtricks” tutorial. It was very helpful and easy to follow.

    Thanks,

    Sandra

  6. Roland Everaert says:

    Hi,

    I have installed xampp and wordpress using bitnami on windows 7. I have followed your instructions except I have not setup an admin password for mysql and bitnami created the db and users for me. Now I can’t connect to the administrative part of the blog. I have, a few weeks ago, installed wordpress on a linux fedora machine (using fedora packages), and enable multisite without any problem. I controlled the configuration of both wordpress, and they are identical, so I don’t understand what is happening in the case of windows.

    Do you think it could be a problem with some rewrite rules or a problem with xampp configuration?

    Thanks for your help,

    Roland.

Speak Your Mind

*