How to Install WordPress on Your Windows PC using XAMPP

So you want to use WordPress on your local Computer? Follow this step by step guide (with images) to install WordPress on your Windows computer using XAMPP.

Unlike many blogging platforms, WordPress gives you the freedom to use it locally. All you need to do is set up a local server using MAMP (for Mac) or XAMPP (for Windows) and then you can install WordPress on your computer.

Right now, you must be thinking – why should I install WordPress on my local computer?

In order to use WordPress, you need to buy a hosting account. So it is better to get a feel of the CMS on your local computer first, and then buy a hosting account based on your needs.

Not only that – before using a new theme or a plugin on your existing website, it is always recommended to use them on a staging site or on your local WordPress installation. Why? The new theme or plugin may conflict with the core files or the existing plugins and this will break your live website.

Also, a locally installed WordPress site helps theme and plugin developers to test and tweak their codes on their computer. They don’t have to depend on any internet connection and a remote server. This speeds up the overall development process and saves a lot of time.

Now that you know the advantages, it is time to get started with the actual process of installing WordPress on your Windows computer using XAMPP.

So, what do we need?

  1. Local server – We will use XAMPP to create a local server environment on our PC
  2. WordPress software – You can download the latest version from WordPress.org

Alternatively, you can also use DevKinsta – the free local WordPress development tool which is available for macOS, Windows, and Ubuntu.

Install XAMPP

XAMPP is a web server solution that allows you to run PHP and MySQL codes. Since WordPress runs using PHP and needs MySQL to store data, hence we will use XAMPP as our local server.

So head over to Apache Friends website and download the latest version of XAMPP for Windows. Once done, let’s install it on our computer by starting the setup process.

XAMPP Setup Process

XAMPP can be installed just like any other software. However, there are some important things which I’ll share with you.

When asked to select components, you should check MySQL and phpMyAdmin. Apache and PHP will be installed by default. These four components are important for us. You may uncheck the rest.

XAMPP Select Components

Next step is to select the folder on which you want XAMPP to be installed. In my case, I have installed it on C: drive. However, you can install it on any folder you like.

XAMPP Setup Folder

In the next step, you will be given information about Bitnami for XAMPP application modules. You don’t have to install any such module as we will install WordPress manually. So uncheck the Learn more about Bitnami for XAMPP option and proceed to the next step.

Rest of the process is simple. Just follow the steps and the software will be installed without any problem. Once installed, let us open the XAMPP Control Panel. You will see a window like the following:

XAMPP Setup Folder

Time to test whether our local server is working properly or not!

Start Apache and MySQL using the XAMPP Control Panel – this will start our server. Now open your web browser and go to http://localhost. If you see the XAMPP start page just like the following, your local server is working perfectly.

XAMPP Start Page

Create Database

The second step is to create a database which will store important data like posts, categories, tags, and other details.

Open your web browser and go to http://localhost/phpmyadmin. Make sure you have started the services Apache and MySQL from the XAMPP control panel before opening the mentioned address.

localhost phpMyAdmin

You will find the existing databases on the left side of this page.

Let us now create the database for our local WordPress installation. Click on Database and a new page will open up:

localhost phpMyAdmin create database

You will find a text box asking for the new database name. You can name it as per your wish. But make sure you remember it.

Let me name it wordpress and click on Create. That’s it, the database has been created. Simple, isn’t it?

However, our database is empty. We have to connect it with WordPress, which we will do in the next step.

Install WordPress

As you know, WordPress is an open source software. So visit WordPress.org to download the latest version of the software. Once you have downloaded it, open the zip folder and copy the WordPress folder inside C:/xampp/htdocs/.

It’s time to start the installation process. You can do this using any one of the following methods:

  1. Without editing wp-config.php file (Recommended for non-programmers)
  2. wp-config.php file

Without Editing wp-config.php file

This method is best for those who find it difficult to deal with codes. Just follow the steps and install WordPress on your local computer.

First of all, you need to open your web browser and type the following URL in the address bar. This will open the language selection page. Again, make sure Apache and MySQL are running. If not, start them from the XAMPP control panel.

http://localhost/wordpress

WordPress Setup Language

WordPress is available in many languages. You can select any language of your choice. Let me choose English (United States) and click on Continue.

A welcome page will open up and will inform that you need some information like database name, username, password and hostname on the next page. These are required for connecting the database to your WordPress installation.

Don’t worry! We have all the information we need. So, click on Let’s go.

WordPress Setup Get Started

Now you need to enter the following database details on this page:

1. Database Name – wordpress. If you have named it something other than wordpress, please enter that name.

2. Username – root. The default username is root unless you have changed it.

3. Password – The default password is set as blank.

4. Database Host – localhost

5. Table Prefix – wp_

Once you have entered the above details, please click on Submit and proceed to the next page.

WordPress Setup Database Details

Now click on Run the install and wait for WordPress to communicate with the database.

Remember – if the information provided in the database details page are not correct, you will get some errors.

WordPress Setup Run Installation

WordPress will now connect to the database successfully and a page will open up asking you to enter blog details like site name, username, password and email. Make sure you remember your username and password as you will need them to log in to your WordPress Dashboard.

Once you are done, click on Install WordPress.

WordPress Welcome Screen

This will take maximum 5 minutes to install the software on your computer. Once complete, a success page will open up.

Now click on Log in to go to the login page.

WordPress Installation Success

Enter your username and password and click on Log in. This will take you to the WordPress Dashboard.

WordPress Login Screen

That’s it. You have successfully installed WordPress on your local computer.

WordPress Dashboard

wpconfig.php file

This method is for those who have some programming knowledge. If you don’t have any coding experience, better follow the above method.

WordPress folder comes with a file called wp-config-sample.php. This file contains the code that can communicate with the database. We will edit this file and will save it as wpconfig.php.

WordPress Folder

So go to C:/xampp/htdocs/wordpress and open wp-config-sample.php file. You can open the file using Notepad that comes with Windows. You can also use any text editor like Notepad++ or Sublime Text.

Let me use Notepad++ to open the wp-config-sample.php file.

wp config file

Now find the following code:

/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

And replace it with the following:

/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

If your database name is anything other than wordpress, please edit the above code with that name. The database username is root, the password should be kept blank, and the hostname should be localhost.

Once done, save the file as wp-config.php.

wp config file edited

Now open your browser and go to http://localhost/wordpress. If the details provided in the wpconfig.php file are correct, then the language selection page will open up and will ask you to select your preferred language.

In the next page, you will be asked to enter blog details like website name, username, password, and email.

WordPress Welcome Screen

After filling the required details, click on Install WordPress. Once the process is complete, you will be redirected to a success page.

Congrats! You have installed WordPress locally using the wpconfig.php method.

Endnote

What are you waiting for? Try to install WordPress on your Windows computer using XAMPP. If you face any problem, let me know using the comment section and I will solve it for you.

If you liked this article, please share it on your favorite social media profile 😉

Sandipan Mukherjee
Sandipan Mukherjee
Sandipan Mukherjee is the founder of WPHour. He is also a WordPress Developer and a freelance writer for hire. You can connect with him on Twitter.

Consider sharing this post so others can find it:

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on telegram
Share on whatsapp
Share on pocket
Share on email

Join thousands of people receiving real-world, genuine evaluations of WordPress products and services just like this one every week.

3 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

The Beginner’s Handbook
From an introduction on how WordPress works to our recommendations on products and services.
👋 Hey there! We're Gaby and Mark
Every week we share tutorials and genuine reviews of WordPress products and services in our newsletter.
Thousands of people read it!
We’d love for you to join.
We’d love for you to join. Here’s what you’ll be getting:

A single weekly email directly to your inbox.