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).
For anyone using WAMP (and possibly XAMPP, have not tested) who has any issues related to Step 3-5, here is your solution:
With WAMP installed (or XAMPP) your Step 3, 4 and 5 will look different then, our gracious host has suggested, with a MAMP install.
Step 3.) Go to wamp / www, in whatever directory or location that wamp was installed. Extract latest (or any version) of wordpress-X.X.zip to a folder (mysite) with only the content of the wordpress folder dumped directly into (mysite). New file structure will be wamp / www / mysite / etc..
Step4.)Unless you’ve changed the db username, password or host name then the db_name is whatever you created in Step 2, the username is root, enter nothing between the ‘..’, and host is localhost.
Step5.)With your browser go to http://localhost/mysite/wp-admin-install.php.
Hope that helps!
Thanks again, Nick!
PS. If you’re having a problem getting your WAMP or XAMPP server online, that’s a whole ‘nother issue, but check to make sure you’re not using IIS; infact disable IIS if possible.
Okeif,
Having endless problems with the install and have tried both Nicks and your directions. Using XAMPP. No luck on either front, as constant “The requested URL was not found on this server” errors.
Have tried all combos:
http://localhost/xampp/www/wordpress/wp-admin-install.php.
http://localhost/wordpress/wp-admin-install.php.
http://localhost:8889/wordpress/wp-admin-install.php. (get “IE cannot display this webpage” error on this one. wp-config localhost changed)
http://localhost:8888/wordpress/wp-admin-install.php. (get “IE cannot display this webpage” error on this one. wp-config localhost changed)
Some questions about your post:
1. In “Step 3″, you say ” Go to wamp / www”… This directory does not exist. Do you have to create it?
2. In “Step 4″, you say “…… the username is root, enter nothing between the ‘..’, and host……” What is the “enter nothing between the ‘…’ referring to? The password?
3. In “Step 5″, you say “With your browser go to http://localhost/mysite/wp-admin-install.php”
Should this be:http://localhost/wamp/www/mysite/wp-admin-install.php?
Thanks so much for your assistance!
I’ve finally got a local WordPress install setup on my Mac thanks to your tutorial. Great for testing new versions and making changes to existing sites without editing live content. Thanks.
Wow, what a difference this makes!
Excellent. works well. Thankyou! :)
Hello,
I am pretty new to all of this, but eager to learn how to set up my own blog. What is the advantage of installing WordPress locally?
I’d like to thank Okeif who posted the life-saving tips (comment 101) that are needed to get the install working on a PC. Moved the whole thing from super-frustrating to super-satisfying. Whew…
Brilliant, thank you!
What a great idea for working on your design without constant ftping.
Really useful, thanks. In fact, I substituted IIS for Apache on Windows XP, because that’s my usual development environment. All works a treat with PHP and mySQL.
AWESOME! Thank you! This will be VERY VERY usseful from now on. thanks a lot.
Wow, thank you!
IS this lesson inteded for a Paid WordPress account? or this can also apply to a free WordPress Acount.. ?????
Hi, i keep getting 404 Not found for http://localhost:8888/mysite/wp-admin/install.php
Hi, Brilliant site, brilliant post!!!
I had mega problems getting the XAMPP Server working locally [Windows XP], so I decided to try the WAMP. It works a treat.
This is how I did it – and it has been commented here before so this really is following on the instructions of other users on this post, [Okeif and otheres], anyways… This is for Windows XP,
Download and Instal WAMP,
then
1) create a folder, say ‘mysite’ to your c:\wamp/www/ folder. 2) download WP and unzip it to c:wamp/www /mysite, alternatively just unzip it to your desk top and then copy all of the wp files to c:wamp/www/mysite Make sure you do not a)copy the ‘wordpress’ file in there, just the content and b)don’t copy the wp file content into www. It needs to go to c:wamp/www/mysite !
3) go to phpmyadmin, which can be found on the little icon at the right bottom of the desktop. Create a data base for e.g mysitelocal or what ever.. Just make a note of it.
4)Go to your wp-config-sample file and rename it to wp-config , also set your DB_name as ‘mysitelocal’ or whatever else you chose, DB_user as ‘root DB_password as ” or if you have set a password then use it, and finally DB_host as ‘localhost’ – then save it!
5) next type in http://localhost/mysite or alternatively just write http://localhost and then choose from ‘Your Projects’ the mysite folder and you should be on your way. I hope this helps..
Again Brilliant resource site!! Thanks for all of your help past, present and future.
JUST AS A HEADS UP!!! Sometimes the password is not root at all for a local host! In my case it was supposed to be left blank. Caused me hours of issues! Silly me.
Sorry,
do you think is possible keep both IIS on local (window 2003 server) and apache…
In this way I can test my sites that working in ASP and my sites that working in php…
Thank you very much
#danilo
Thanks! Fantastic site! And thanks Tomas L. who saved me from giving up with your tips for the Windows installation. It works on Vista too. Yeh!
Thanks for sharing it, Its so easy !!
Thanks again
There is also a good article on how to install wordpress at http://www.madanrevoor.com/?p=9
Do check it out.
Thanks Alot .. it helped me in setting it up locally, only problem is of simulating .htacess file in the windows xp machine, it would be great help if that could be provided.