This is the first chapter of the Complete WordPress Theme Guide series. In this chapter, you will learn how to install WordPress on a local computer. By doing so, it will save you time from updating and previewing files (so, you don't have to frequently upload files on every change). You can also use the local version to test new plugins, themes, and upgrades. This tutorial is intended for beginners who want to learn how to run WordPress locally.
Quick Summary
If you have some technical background, you can skip the detailed steps in this tutorial. Here are the simplified steps on how to install WordPress on a local computer:
-
Create a new database.
-
Download WordPress from wordpress.org and extract the files to a new folder under the htdocs folder.
-
Rename the wp-config-sample.php file to wp-config.php and update the database details according to your local server.
-
Run wp-admin/install.php and follow the instructions to install WordPress.
-
Done!
Let's Begin...
Before you start, let's look at the requirements to run WordPress:
- PHP 4.3+
- MySQL 4+ Database Server
1. Install a Local Server

In order to run any PHP/database application on a local computer, you need a local host (ie. Apache + MySQL). For Mac, use MAMP. For PC, use XAMPP or WAMP.
I'm using Mac here, so I'm going to install MAMP. Go to mamp.info, download and install MAMP.
2. Create a New Database
After you've installed MAMP, run it and it should take you to the start page. Now click on phpMyAdmin. In the phpMyAdmin page, create a new database (eg. wordpress).

3. Download WordPress
Go to wordpress.org and download the latest build of WordPress. Go to the htdocs folder (where you installed the MAMP), extract the wordpress.zip to a new folder (eg. mysite).

4. Update wp-config.php File
In the folder, rename the wp-config-sample.php to wp-config.php. Open wp-config.php and update the database details (db_name, user, password, host) according to your local server.

5. Run install.php
With your browser, go to http://localhost:8888/mysite/wp-admin/install.php and follow the instructions to install WordPress.

What's Next...
In the next chapter, I'm going to show you how to create a custom WordPress theme in designer way (no PHP skill is required).
So I’m using XAMPP and I did everything I was supposed to do but then when I insert http://localhost:8888/mysite/wp-admin/install.php through my web browser (Firefox) it says, “Problem loading page.” I think there may be something wrong with XAMPP but is there anyone that can help me?
Ellada, try to put just http://localhost/mysite/wp-admin/install.php . Worked here and i’m using xampp too! :)
I’ve been having the same problem when I entered the url. A page with the following message “Error establishing a database connection” prompted.
However, after tried a bunch of solutions, I managed to get it to work. In the wp-config.php, where you enter the password, I just left nothing between the apostrophes. It works now!
However, after tried a bunch of solutions, I managed to get it to work. In the wp-config.php, where you enter the password, I just left nothing between the apostrophes.
Nice tutorial!
jkl;
I have executed 1 to 4 and when I am executing step 5th with command line:
http://localhost/mysite/wp-admin/install.php
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
Try with browser and please check your database configuration file.
I tried repeatedly…I uninstalled the WAMP and reinstalled it. There was no htdoc folder, but I put the WordPress folder in the www folder….nothing seems to work for me.
I created the wordpress database in phpmyAdmin….but it never asked me to set a password…I’m SOOOOO confused. Help would be appreciated.
Am using WAMP in windows and am unable to run wp-admin/install.php.pls help me on how to go about it at step 5
Am using WAMP in windows and am unable to run wp-admin/install.php on a local pc.please help me on how to go about it at step 5
how to use and install word press sir
what is module in word press
Hey man, thanks for the straight forward steps. Nice n easy. Cheers!
downloaded WAMP for my PC — near end of install, said could not locate msvcr100.dll did two installs (used windows uninstall program) reinstall again…same problem.
I have installed on my remote server mySql db & wordpress successfully but unable to do this on my “localhost” pc HELP!
Great tutorial!! Thank’s! :)
blah blah blah
I’m gonna start with this.
Thanks a lot :)
Nice quick setup guide.
One thing to note is that adding the port number on the end of the localhost DB setting (step4) in wp-config.php doesnt always need to be added, simply ‘localhost’ will suffiece.
You can also use the computer’s IP followed by the port to access MAMP etc.
Great tutorial
Thanks for posting
hi
how to install wordpress website server to localhost…
plz reply
who can see my blog if i install it in my pc…………?
Hello! I know this is kind of off topic but I was wondering which blog platform are you using for this website?
I’m getting tired of WordPress because I’ve had
problems with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.