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).
Hey giles
Not sure if its the same problem I faced but try placing your site in (the whole shebang) in applications/mamp/htdocs/
workked for me. I use a G5 at work and could only get it to work that way. Funny thing is I use an intel Imac at home and it didnt have that problem. let me if that helps.
ocube
Giles, make sure that you changed the wp-config-sample file and make sure that you only have a (1) parent folder under htdocs structure should be like this:
mamp>htdocs>mytestsite>then all the extracted WP files
with WP 2.6.x “Update wp-config.php File” as a option, the install guide will do it.
Hi thx for the great tutorial. Anybody got any ideas how to acces the site from a PC in my LAN to check how IE works with my freshly created theme?
humm não é muito dificil estou tentando seguir as dicas acima veremos se consigo
Working on rebuilding my web store locally right now! Thanks!
Very goo Website.
Thank you
Roberto
This was a great help! Thanks so much. I love your site, keep up the good work :)
I already have a wordpress blog. how do i log into that? It seems that its creating a new site. im lost please help.
hey,
im trying to install wordpress locally but im having some problems. When i get part 5 where it says :
With your browser, go to http://localhost:8888/mysite/wp-admin/install.php and follow the instructions to install WordPress.
i get an error message. Can you tell me where im going wrong?
Thank you
Fahad make sure that the contents from the wordpress folder are directly in the mysite folder. applications/mamp/htdocs/mysite/(the contents from inside the wordpress folder). if you place the the whole wordpress folder inside it wont work. Hope that helps.
Thanks Aris:) it works now.
Does anyone know where i can download a plugin which allow users to rate a product and review my posts or products?
by the way this site is great!
thank you for you help guys
Hey,
I use Windows and istalled WAMPServer. The problem I have is with step 3: where actually should I unzip the WordPress content? The only ‘htdocs’ folder I have is inside ‘apache’ folder (wamp\bin\apache\Apache2.2.10\htdocs\).
Please help me.
Hi,
Thank you for the tutorial, it is great!
I have successfully set up WordPress on localhost, however I don’t know how to login to the admin panal of WordPress. I am a newbie, please pardon me if this sounds like a silly question. Thanks in advance!
I am totally in the dark…so grateful this site exists!
The “newbie” tutorial for installing WordPress locally was too complicated for me…but since the blog is already up…(hosted with Hostazar…I managed to get THAT accomplished)…my dilemma now is “Themes”…I desperately need help in uploading/installing themes.
I am very ashamed because I AM a (graphic) designer…but not technical enough for Web design…my expertise is marketing/branding/imaging and PR…I’ve taken a hiatus from all that to engage in Internet marketing…so my inability to make my sites look fabulous is embarrassing to say the least. Please help!
I just discovered this blog and I’m reading all the other posts here now…in the meantime, additional hand holding is highly appreciated.
Thanks ahead of time.
AlysynC
I’m a complete noob and didn’t know to turn web sharing on in order for MAMP to work properly. Hope this helps anyone else as incompetent as I am! Thanks for this post so much…
for those trying to install wordpress and use xampp (mac or PC) when editing the code DO NOT put in a password. above says root for username and root for password. dont put in a password. you might have to remove whatevers there first. you can keep your localhost as just localhost as well.
I’m stuck on Step 5. I tried that URL: http://localhost:8888/mysite/wp-admin/install.php and I get a “Failed to connect” error. I don’t know where I went wrong. I’m using WAMP server. I opened the HTML file in the wordpress htdocs folder and clicked the 5 minute install link which takes me to a page saying I already have wordpress installed. I never saw the install.php page. There were 2 blank text fields. There, I tried to name it and put my email address associated with the server. I don’t know what’s happening.
Also, What does the number 8888 and 8889 mean after “localhost:”? How do I know if I used the right number or if I need one at all?
MAMP saves me soooo much time. Amazed it’s free.
Super list. Thank you very much :)