How to Install WordPress Locally on Windows/macOS/Linux using WAMP

You are currently viewing How to Install WordPress Locally on Windows/macOS/Linux using WAMP

In the first part of this tutorial on How to Install WordPress locally using WampServer (WAMP), we downloaded and installed WampServer. And in this second part, we will setup WordPress locally on WAMP. Moreover, I will also inform you about more methods to Install local WordPress in your system & will also provide you some brief information & resources regarding migrating your WordPress Installation to a live website.

But first, let’s get to the main point & get your local WordPress up & running. So, to Install WordPress locally on WAMP, you first need to create a database. If you have read our previous guide on installing WordPress, then you will be familiar with this process. The only difference is that you need to create a database in your localhost for setting up WordPress locally for WAMP. as opposed to creating a live website database.

So, without wasting any more of your time, let’s begin our guide on Installing WordPress locally.

Create a MySQL database and user to Install WordPress Locally

We will use phpMyAdmin to create the database and user to setup WordPress locally. You can access phpMyAdmin anytime when WampServer is running via http://localhost/phpmyadmin/ or by clicking the phpMyAdmin link on the WampServer welcome screen at http://localhost/. If it asks you for a user name add “root” in the login box and leave the password field empty.

Important: don’t copy the database name and username from this article. Use your own secure names instead. If you already installed WordPress on a live server, we recommend that you should use the same database name and user for your local instance.

Now when you open phpMyAdmin, select the Databases tab in the top menu, write your database name in the input field, and hit the Create button.

Create Database in phpMyAdmin

Your new database will now show up in the list of available databases. Click on the name of your database. This will open your database settings panel.

Add user in phpMyAdmin

Select the Privileges tab from the top menu and click on the Add user at the bottom of the page. A form will pop up with three fields:

  1. Add Login information
    Fill in a username and strong password. Make sure to copy all these details because you will need them in a minute for later use. In these settings, you need to set the host field to local. When starting WordPress locally, I recommend that you should skip adding the passwords for your database so you don’t end up getting locked out.
    Add user in phpMyAdmin - Login info
  2. Add Database for user
    Make sure to verify that your newly created database is selected before proceeding further.Add user in phpMyAdmin - database info
  3. Global privileges
    Don´t select any Global privileges – our user only needs access to the WordPress database.Add user in phpMyAdmin - Global privileges

When you are done making all the necessary changes, click Add user.

How to Install WordPress on Local Host?

On a live web server, websites usually have their own public_html directory where all website files and scripts are located. And you can usually Install WordPress manually by using this folder on a live site with the help of  FTP clients. Learn more about this specific procedure from our related guides that are mentioned in the intro.

Anyway, If you are hosting your WordPress site on a shared server, you will only get access to the public_html folder of your own website. For online WordPress Installation, most Web hosting nowadays offers an easy software installer that can easily set up everything for you. But even with this feature, there is one drawback of shared hosting, you are limited to your bought package features & can only create limited instances of WordPress without investment.

However, when you install WordPress locally on Windows, you will have a complete server at your disposal. You can create as many websites as we want and install as many instances of WordPress as necessary.

In a WampServer environment, each site is called a project. Creating a project is as simple as creating a new directory in the www folder. By default the directory is located in C: wamp

Browse to the www-folder and create a new directory using the name of your website.

Download WordPress and place all files in your newly created folder. The result will look like this:

WampServer directory structure

Add database information automatically or Edit wp-config-sample.php

There are two ways to add the database information for your local WordPress set up. The first is the automatic one, for which you only need to add information regarding your created database & the second one requires a manual edit of the wp-config.php file.

Note: Only use the second one, if you face any issues with the first method.

Looking for related articles? Here’s one we recommend: Cloudways vs Kinsta [Which is Better?]

Automatic Method

First, I will discuss the easy to understand automatic method for a local WordPress installation. So now that you have copied your website in the www folder in the wamp server, It’s time to open your local website & set it up. So open http://localhost/my_website/ in your browser (replace /my_website/ with the name of the folder you created) to set up WordPress locally. Once you open your localhost link,  you will be presented with the following page:

wp1

 

After choosing your preferred language, click on continue. Now WordPress will ask you if you want to create a configuration file. That sounds like a good idea. Click the Create a Configuration File button and proceed to the next step. But please note that in 2024, you will be presented with an information screen like this instead of the create a configuration file settings because now during WordPress installation, a configuration file gets created automatically:

wp2

Note: If you have manually created a wp-config.php file beforehand & added your database details to it. You might not get the same information screen as this one, so don’t get confused in case you don’t get this screen during localhost WordPress Install.

This screen informs you about the required information for creating a wp-config.php file.  So, click on “let’s go!” to get to the next page for creating and adding the database information.

After arriving at the next screen you will be asked to enter your database name, username, and password. Also, change the wp_ prefix. When you are done adding the information, click Submit and Run the install on the next screen.

WordPress installation panel

 

Manual Method

Now that you have successfully learned how to create & add information about the database automatically. As a bonus, I will inform you about the manual method as well to broaden your knowledge spectrum.  And another reason for including this information is to inform people about another method in case the automatic one is causing issues or confusion.

So for adding the information to your local website manually, you need to add the specific information about the database to your wp-config.php file to install WordPress locally on WAMP server. You can edit this file with the simple notepad, however, to avoid any issues I recommend using notepad++

Note: Please do not use Microsoft Word for this task because it can add invisible markups to your configuration which can end up causing you more issues.

First, you need to navigate to the local WordPress folder in the wamp server that you just extracted. Once you reach the directory of your local website, edit the wp.config.php. But as you will notice that there no wp-config.php file in this directory, but don’t worry. You just need to edit the wp-config-sample with all the relevant details about your previously created MySQL database & save it as wp-config.php.

So, right-click on wp-config-sample.php & click edit with notepad++ & add all the required information under my SQL settings. Add the correct information that you have added before while creating a database. And after you are done adding information, click on the file option of the top left corner of your editor & select save as, and save it as wp-config.php.

 

222222222

Looking for related articles? Here’s one we recommend: Cloudways vs Siteground [Which is Faster?]

Add Local WordPress Website Information

After you are all done with adding database information manually or automatically. Next, you will be presented with this screen to add information regarding your website. I recommend that you should use the exact titles & users for your planned live website to ease your migration process. As a reference, look at the picture below to get an idea about the information required:

wp

Now carefully add the required information & press Install WordPress, and you are all done. If you only want to use WordPress for local development, you can untick the “discourage search engines from indexing this site” option for a local install.

After you are done adding all the relevant information, there is not much left to do. You have successfully installed WordPress locally on your computer.  Now you will be able to run WordPress locally at http://localhost/my_website/ & access the admin panel, add /wp-admin at the end of your localhost URL. This here concludes my guide on the method to “Install Local WordPress using WAMP” on your computer.

But this is not the end of this article, as promised, now I will inform you about some other ways to Install WordPress locally. But before that, let’s overview the process of MAMP WordPress setup.

How to install WordPress on a MAC computer by using MAMP

As mentioned before in the first part of this guide, MAMP is a similar software to WAMP, but it is used for hosting a local server on a MAC. The overall method is more or less the same, but there are a few changes that a  newbie might find difficult to comprehend.

So keeping that in mind, I will inform you about the differences in setting up MAMP to help you run WordPress locally on Mac.

OK, let’s start with the first basic difference in both this software. Which is that the download link is different. Yea I know that this is not much of an issue or complication, but still, for your convenience here is the link to download MAMP.  The good thing about this local server software is that you can download both the Windows & Mac version of it.

Anyway, let’s get straight to the point

Setting up MAMP for local WordPress Installation.

The installation process is pretty straight forward & similar. Just download the MAMP software, open the setup, and follow the on-screen instructions to install it correctly.

After it is successfully installed, open it up & click on the top left corner of the app & select preferences. Click on ports, and set the apache port to 80, the reason for this change is to open your local website just by typing http://localhost. Without making this change, you will have to add the port at the end of localhost like this: http://localhost:8888.

wp5

If you don’t have an issue with adding a port at the end, you can skip this step, but I do recommend making this change before proceeding for convenience.

Now the next step is to set up a root folder, so navigate to the same preferences option again, and click on the webserver option. And now select your desired root folder for convenience.

beeeee

Although, MAMP does have a default location for the root folder. But I recommend that you should change it for ease of access. As a reference, the original root folder is located here:

Applications/MAMP/htdocs/

After making these changes, all you need to do is download WordPress, and extract it to your specified or default root folder.  Rename your extracted WordPress files to your website name.

Next, you need to open phpMyAdmin to create a database. To get to the PHPMyAdmin page, open up your MAMP software, and click on open Web page start. Now select tools & click on phpMyadmin. After that, you need to follow the same procedure as mentioned above in this article. To ease this process a bit, click here to directly navigate to the create a database procedure.

Now after you have successfully created a database, open http://localhost/mysite in your browser to start setting it up. Change mysite to your specified name if you have already changed it beforehand.

Note: If you cannot open up your website by adding the above-mentioned link, please re-check if your MAMP server is running & try again. However, if you still can't open it. Open up your MAMP, then click web start & my website & so on.

Other than this, follow the same method as a Windows device and start local WordPress development on Mac.

Other methods to Setup WordPress locally

If you are one of those people who are wondering how to build a WordPress website offline then WAMP/MAMP is your answer. By reading this guide, you will understand that Installing WordPress locally on WAMP or MAMP is easy enough, but if you are still looking for an easier & more convenient alternative. I recommend using the Bitnami WordPress Software.

If you want to skip all the hassle of creating a database, and setting up your personal WordPress website on your computer. Simply head over to the Bitnami WordPress website & download your desired Installers.

The good thing about this software is that it has a variant for any OS. The most popular ones being Windows, MAC, and Linux. After you have downloaded this software, you just need to open the installer & start clicking next.

You will be asked to enter some information, but the required information is already mentioned in this article. So, add your specific information & you are all done.

bitnami 3

Note: You do need to log in with Facebook, Google, GitHub, Microsoft, or Bitnami account to download this free software.

After the setup completes, you will automatically be taken to a localhost page. Just click access webpage and there you have it. Your localhost/WordPress installation is complete.

Other than this software, the last one that works somewhat similarly is XAMPP. However, since the method is completely similar to WAMP & MAMP, I am not going to write an extensive guide on XAMPP. But I thought that I should mention it just in case you face any issues with the other mentioned software in this list.

So, now after overviewing all the options in this Install local WordPress tutorial by using WAMP. As promised, I will now shed light on how to migrate your local server to a live website.

Migrating your Local Server to a Live Website

It does not matter how far you develop your WordPress website locally, sooner or later you will have to migrate your website to a live server for the World to see. Local WordPress is great for newbies & professionals both to beta test plugins, themes, or new updates before implementing them on their live site. Or to practice the initial usage/building of your website.

For migration, the first pre-requisite is of course a web server. Which you will need to get a subscription for because there are a very limited number of free web hosting available. And most of them are not easily compatible with all the WordPress requirements.

The second one is to use your desired method for this migration. There are essentially two methods for migration, one being the automatic one by using a plugin  & the second being the manual one.

For the sake of convenience for beginners,  I will overview the plugin method in the guide briefly. You can get detailed information about it from our Install WordPress article.

Plugins for Migration

To migrate your local WordPress to a live server, we recommend the following plugins:

  1. Duplicator – WordPress Migration Plugin
  2. All-in-one WP Migration Plugin
  3. WPVivid Plugin

Out of these three, We found WPVivid to be one of the best free ones so far. So for your convenience here is a video resource for the WPVivid plugin:

 

Conclusion

That’s all folks, this concludes part two of the “Install WordPress locally using Wampserver (WAMP)” guide. In this guide, I tried my best to provide you all the information under one resource. And I realize that there is still some detailed information missing, but sooner or later you will find all your desired & accurate information on this website.

Moreover, I know that with constant updates some of these procedures will change with time. But I plan to keep this source of information updated according to the latest information available. And in case of any confusion or issues, feel free to comment down below to get more help from my side.

I hope that you found this information resource helpful & easy to understand. But before your go, check out the relevant query box at the end of this article to get some more information regarding frequent confusions.

Some Relevant Queries

How is Installing WordPress on WAMP server beneficial?

The main benefit you get after you run & install WordPress in a localhost environment instead of an online host is the capability of beta testing. When you install local WordPress, you can easily test your new plugins, themes & the overall functionality of your website before it goes live. As mentioned before, it is more of a test environment to develop WordPress locally for developers & provides a learning opportunity for newbies.

Any Disadvantages of local hosting?

The main disadvantage of a locally hosted WordPress is that it utilizes your computer resources to work. If you want to run multiple instances of WordPress on your computer, you might require a hardware upgrade. Secondly, you have to put in extra effort to host & migrate your websites to live ones. Which is great for testing & safety in the long run, but still time-consuming.

How many websites can you host on your local server?

If we talk about WAMP, you can host multiple instances. All you need to do is create a new database & website folder in the www folder and add your new websites to it. For running multiple websites, first, make sure that your hardware is capable of handling all of it.

How to use the WAMP server & solve issues?

If you are just using the WAMP server to setup WordPress locally, then all you need to do is follow the exact method mentioned in this guide. However, WAMP is not only limited to WordPress, To get more information about WAMP, refer to the first part of this guide. I have included detailed information regarding WAMP set up & issues in the first part.