The tools and plugins recommend in the site are the ones we use, have tried or tested ourselves and recommend to our readers. Marketing With WP is supported by readers like yourself. If you take an action (such as a purchase) we might earn an affiliate revenue at no extra cost to you.
How to Install WordPress on Local Drive?
If you’re new to WordPress, you might want to get familiar with the CMS by installing it on your local drive.
Installing WordPress on localhost gives you a testing environment on your own computer. You can also move it to a live server afterward.
If you already have WordPress installed on your hosting platform, you can skip the following altogether.
However, if you want to create a staging environment locally before pushing updates live, then using localhost as staging is a good idea.
Find out how to install WordPress on localhost below –
Operating System: Cross-platform
Web Server: Any of these suitable for your OS (Operating System)
- XAMPP – Available for all OS
- WAMP – For Windows
- MAMP – For Mac
- LAMP – For Linux
Database: MySQL 5.6 or greater recommended
PHP: PHP version 7.4 or greater recommended
Now, here are the steps –
How to Setup WordPress on Localhost
1. Download and Install XAMPP
XAMPP is popular open-source software that creates a virtual web hosting server on your local PC.
For downloading XAMPP, go to their official website and download the latest version. Then, install it on your PC.
The installation process is pretty straightforward. But, at one point you’ll have to remember to tick mark a few options.
Make sure that these options are ticked. Then, continue the rest of the installation normally.
After installation, you‘ll have a new folder ‘xampp’ containing other important folders and XAMPP files on your local C:\ drive.
2. Download WordPress and extract it to XAMPP > htdocs
Next, you’ll have to download WordPress from the WordPress.org website’s download page.
Now, copy the downloaded ZIP file to drive C > xampp > htdocs.
Now, extract the WordPress zip file, Then, rename the extracted folder to the name you want for your local site. Be sure you remember it’s going to be used in the URL.
Here, we renamed it to ‘testwebsite’. So, our website’s URL would be
You can then delete the zip folder.
3. Create Database
To create the database, you’ll have to get your local server running. So, locate and open XAMPP.
Then, start Apache and MySQL.
Now, go to the browser and type in localhost/phpmyadmin. This will open the phpMyAdmin dashboard for creating a local database.
So, go to Databases on the menu, add the database name, and click on the Create button.
Be sure you remember the database name. You’ll need it in the next step.
4. Install WordPress on XAMPP
Now, you can go ahead and install the WordPress website locally on XAMPP.
For that, go to the website URL. Now, if you go back, your website URL would be
‘localhost/’ + your website name
In our case, it’s – localhost/testwebsite
Now, the WordPress website installation begins. The installation is pretty straightforward. While some of the steps should be noticed. We’ll show them below.
It starts with selecting the preferred language.
After that, you’ll have to enter some information.
- Database: enter the database name which you created on phpMyAdmin. Example: db_testwebsite on our case.
- Username: enter ‘root’
- Password: leave blank
Leave others as they are and submit.
Next, you’ll have to enter your site name, username, and other information.
Finally, click on Install WordPress to complete the installation.
After that, you can log in to your WordPress CMS, which we will talk on the next lesson.