When building a new website in WordPress, it best practice to first create the site locally on your computer and then later FTP the files and upload the database to a live server. By building your site locally, you can test functionality and design before going live. If you are making a site for a client, it is also better to set it up locally before releasing the finished product on the live server. Creating a site locally is also a great way to just mess around and learn WordPress. Moreover, if you have an established WordPress site, having a local, offline version allows you test changes to the site before implementing those live. If you are using a PC, then the best way to turn your machine into a local server is using Wamp. If you are using a Mac, then it is best to use XAMPP. This article provides a tutorial for setting up WordPress locally on your PC with Wamp.
1. Download the latest Wamp server
Click here to go to the Wamp server website. Once there you can scroll down to the downloads section and select either the 64-bit or 32-bit version.
Clicking either option will give you a popup. Here you want to click “download directly”.This will bring you to a sourceforge page where you will click “Download Latest Version” in order to begin downloading the software.
2. Install the Wamp server software
Once it has completed downloading run the software to begin installation. When the setup wizards begins select the language you want install the server in and on the next page select “I accept the agreement” in order to use these services. The setup wizard will then prompt you with “Select Destination Location”. I would recommend leaving the default destination folder as we will be adding files to this folder later on, but you can change it to whatever folder you want just remember where you put it.
The next page will is about creating a start menu shortcut, leave the default entry and click “Next”. When it says “Ready to Install” click “Install” and wait for the installation to finish.When that is done the setup wizard will ask if you want to change the default browser used by Wamp. By default Wamp uses Internet Explorer so you can change it to your preferred web browser if you want (I changed mine to Chrome whose destination file will normally be found here: C:\Program Files (x86)\Google\Chrome\Application and select chrome.exe). Then, it will ask you if you want to change the default text editor which is notepad and follows the same method as changing your web browser. Once the installation is complete you can launch the program.
3. Create a User Account and Database
After running Wamp an icon with a green “W” should appear in your windows toolbar (bottom right of the taskbar).
Left-click that icon then click on “phpMyAdmin” to launch a login screen.
In order to login use the username root and leave the password field blank and click “Go”. You should now have access to the Wamp server environment. Next, click “User accounts” on the top toolbar to create a new account for yourself.
Then, click “Add user account”. Fill in the fields for the username and password (you can have the software generate a password for you by clicking “Generate” next to “Generate password”) and for host name change the drop down box to “Local” and the field to the right of it should auto-populate with “localhost”. Give yourself which ever privileges you want. For setup purposes I would give myself all privileges by checking the check all box next to “Global privileges” and modify my privileges later if necessary.
Then you will create the database by clicking “Databases” on the top toolbar where you found “User accounts”. Then, in the “Database name” field under “Create databases” type the name you wish to use to create your WordPress database then click “Create”.
Now your database is created.
4. Import WordPress into Wamp
Click here to go to the official WordPress site and download the WordPress package by clicking on “Download WordPress X.X.X” and your browser will begin downloading a zip file.Once the download is complete unzip the file by right-clicking it and clicking “Extract Here”. After the file has been extracted go to the file location where Wamp was installed (should be C:\wamp64 if you left the default location alone) and open the “www” folder. Copy the newly extracted folder into the “www” folder. You are going to want to rename the “wordpress” folder once it is copied over because the website is going to use that folder name as part of the URL. For example, I named my copied folder “testsite” and the URL I will type into my web browser will be http://localhost/testsite/.
If going to this site works you can skip to step 5, if not then continue with these steps.Go into the wordpress folder you just copied over and open the wp-config-sample.php file in your text editor of choice. In the text file change the “database_name_here”, “username_here”, and “password_here” sections to the name of your database and the user name and password of the account you created in step 3.Save the file and close it making sure not to modify anything else within that text file as it is vital for running your WordPress site.
Once that is done you should be able to access your site by typing the URL given earlier and you may proceed to step 6.
5. Setup WordPress to Communicate with your Wamp Server
You should come to a page with the WordPress logo on the top and a list of languages. Select the language of your choice.On the next page it is going to tell you what you need to setup and you will click “Let’s go!” Here you are going to enter the name of the database you created on the Wamp server and the username and password you used when you created the user account on the Wamp server and leave the last two fields as the appear.
6. Finish Setting Up WordPress
You should be at a welcome page that is asking for some information. Enter the “Site Title”, “Username”, “Password”, and “Your Email” then click “Install WordPress”. You will then get a success page where you will click “Log In”. On the next page you will enter your login credentials and from there you will be put to the WordPress dashboard and your local website is all setup and ready to be modified!