The very first question that may come into your mind is – what is the need of setting up & run WordPress locally?. Right. For me or anyone who wants to start a WordPress blog. This is the very first thing you should do because of two main reasons :
(1) We are living in the era of “Try before Buy” so before purchasing any premium theme you can try it on your PC and can get accustomed to it, and (2) as soon as we go online we should avoid making any changes directly to our live website as a minor mistake can break your site.
So it would be the best practice to first make changes to your locally installed WordPress site and see the result. If everything is good then you can apply these changes to your live website.
Install and Run WordPress Locally on PC
Now, we will see a complete step by step guide for setting up WordPress locally on your PC using the Xampp server. We can divide this process into four simple steps.
Step 1: Making Changes to User Account Control (UAC) Settings in Windows
If you want to install Xampp in the C directory of your pc, then you must change the User Account Control settings first. If you don’t do that you may get a “write permission” error in the future.
So if you wish to install on C drive, Change the UAC by heading to Control Panel > View By: Large icon > User Accounts > Change User Account Control Settings > Drag the slider to the bottom and press OK. Now restart your PC and you are ready to go.
If you are not comfortable with the above-mentioned method, simply avoid installing Xampp on C directory and install it on D/ E or any other drive (select drive during installation).
Step 2 : Installing Xampp and Running it
Download the latest version of Xampp from www.apachefriends.org and also download the latest WordPress version from wordpress.org/download/.
Now install Xampp simply by following on-screen instructions. You may get an antivirus warning don’t worry, just press ‘Yes’ after successful completion run Xampp from the desktop shortcut.
If you did not find the shortcut on the desktop, simply head to C drive or any other drive where you have installed Xampp. Open the Xampp folder and look for xampp-control.exe, Right-click on it, and select Send to “Desktop”. Now you have a shortcut on the desktop, just run it by double-clicking it. You will get a screen like this:
Now, look for Apache and MySQL on-screen options and press the start button presented in parallel with these two. Now your Xampp server is up and running.
Step 3 : Creating DataBase(DB) for Wordpress
Now, we need to create a DB for our WordPress where it’s going to put all of your website Data. Open your browser and type http://localhost/ press enter, you will greet with a screen like this:
Click on “phpMyAdmin” and it will fetch a phpMyAdmin page.
Now look on the left-hand side of your screen you will get an option “New” just click it, a new window will appear asking for DB name just give any name of your choice and leave the rest fields as it is. Finally, click on the “Create” button, you have successfully created your DB.
Step 4 : Setting Up and Installing WordPress
4.1: Extract the Downloaded WordPress Zip file, you will get a folder named WordPress, copy it to the C or D or E drive ( installation drive) > Xampp > htdocs (past here).
4.2: Now, we are ready to install WordPress. Open your browser and type http://localhost/wordpress/ press enter. You will get a screen like this :
Click on Let’s go!.
On the next screen, you need to enter the Database Name, User Name, and Password. Here your Data name will be one you have created earlier in Step 3, your User Name will be root and finally left the password field blank.
For example, My Database Name is “mywordpressdemo” UserName “root” (for all users) and left the password field blank. Do not touch any other field just click on submit.
If all the information entered by you is correct, you will get a screen like this:
Click on Run the installation and you will get a screen like this:
This is the final step to install WordPress just Fill the onscreen details like site title of your choice, the username (whatever you like), password of your choice, and finally your email id. Now, Click on Install WordPress and wait for 2-3 minutes, you will get a success screen.
Congratulations, you have successfully installed WordPress on your PC. You can now login to your WordPress by typing http://localhost/wordpress/wp-admin/ in your browser and giving the username and password you have created on the previous screen (Don’t give your database username and password here).
Now click on the login and you have a WordPress dashboard just play around it.
I tried to keep this article as simple as possible if you still have some doubts, watch my video on “How To Install and Run WordPress Locally on PC” embedded below.
Recommended Reading: How to Start A Successful Blog With WordPress