How to Setup WordPress Locally [Easy Method]

In this blog article we’ll learn how to setup WordPress locally.

Whether you’re a WordPress theme developer or wanted to try your theme out before showing to your viewers, installing WordPress locally is the best option because you’re doing everything locally so means your WordPress website will run faster & this will save you a lot of time customizing or developing your WordPress site.

There are many applications that you can use to create a local server for WordPress but, I think XAMPP is the best software because it is effortless to use & this is exactly I will show you here step by step how easy it is to use this software.

Step 1: Download & Install XAMPP

Visit XAMPP website to download the application from this link.

xampp home page

I’m using the Windows operating system so I’ll down the Windows version as shown below.

xampp windows

Install XAMPP software in your Windows drive, in my case that is C Drive.

install xampp locally

Step 2: Download WordPress

Now visit WordPress.org & download the WordPress files as shown below.

download wordpress org

WordPress files will be downloaded in a ZIP folder, you can extract the files using any compression software as shown below. I’m using WinRAR which you can download from here.

extract zip files

Now you have to copy all the files from the extracted folder which you have to paste it under XAMPP folder later.

wordpress file unzip

Now go to XAMPP folder which in my case is under drive C.

xampp folder c drive

Now open the htdocs folder which is under the XAMPP folder as shown below.

xampp htdocs folder

Create a new folder under htdocs folder & name it anything you like. For this example, I’m creating a website on Cats so I’ll call my folder Cat as shown below.

htdocs xampp folder

Now paste the copied WordPress files in the Cats folder as shown below.

xampp htdocs location

Step 3: Setting up WordPress & Database

Now we have to setup the WordPress & the database so the WordPress can communicate with XAMPP.

Rename the file name ‘wp-config-sample‘ to ‘wp-config‘ as shown below.

wp-config-rename

Now I have to create a database name in local server using XAMPP.

Open the XAMPP control panel if it is not as shown below.

xampp control panel

Click on ‘Start‘ to start ‘Apache‘ & ‘MySQL‘ as shown below.

start apache mysql

The green color indicates that ‘Apache‘ & ‘MySQL‘ are running fine as shown below.

apache mysql green

Now it’s time to access the apache server to create a database using any web browser.

Open your web browser & type in the address bar ‘localhost‘ & press enter as shown below.

apache localhost

Now you will be presented with ‘Apache Welcome Page‘ as shown below.

apache welcome page

To create a ‘database name‘ you have to access the phpMyAdmin area by clicking on the phpMyAdmin link as shown below.

phpmyadmin menu link

Now you will be presented with phpMyAdmin dashboard as shown below.

phpmyadmin dashboard

To create a new database click on New as shown below.

create new database

You’ll be presented with all the databases you currently have as shown below.

phpmyadmin databases

Now type a database name of your choice & click Create. For this example, I’ll use ‘Cats‘ as shown below.

database name php

You can see the created database name on your left as shown below.

database phpmyadmin

Now to make WordPress communicate with the database, we’ve to edit a WordPress file called ‘wp-config‘ which we renamed earlier under the cats folder as shown below.

edit wp-config

Right-click on the ‘wp-config‘ file & open the file using any text editor of your choice. You can choose any free text editor. Here is the list of few text editors which are totally free.

For this example I’ll be using Brackets which is my favourite text editor.

open coded files

This is how ‘wp-config‘ file code looks like as shown below.

wp config file code

Don’t worry if you don’t know coding & in fact you don’t need to know coding at all to finish this process.

Pay attention to these three lines as shown below.

wp config file edit

Now change ‘database_name_here‘ to your database name the one you created earlier. In my case, it was ‘cats‘ so I’ll change my database name to cats as shown below.

xampp database name

Change ‘Username_here‘ to ‘root‘ as this is the XAMPP apache’s default username as shown below.

root xampp

Password will be none so remove ‘password_here‘ & leave the commas empty as shown below.

xampp php password

Now save the file.

save file brackets

Now to access the local site, you’ve to type ‘localhost‘ in your browser along with the folder name which you have created under ‘htdocs‘ in my case which is ‘cats‘ so I will type ‘localhost/cats‘ as shown below & press enter.

localhost address

If you followed all the steps above then you will be presented with a welcome screen by WordPress as shown below.

wordpress welcome screen

I hope you’ve successfully installed WordPress locally by following this guide but if you face any issues then please let me know in the comment form below.

Now you can create your site title, password & install themes as you normally do on your web hosting.

I hope this article was helpful. Please don’t forget to share this article on social media & with your friends. See you soon with another article.

Spread the love