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:

  1. Install a local server (Mac: MAMP, PC:XAMPP or WAMP).

  2. Create a new database.

  3. Download WordPress from wordpress.org and extract the files to a new folder under the htdocs folder.

  4. Rename the wp-config-sample.php file to wp-config.php and update the database details according to your local server.

  5. Run wp-admin/install.php and follow the instructions to install WordPress.

  6. 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

local servers

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).

phpMyAdmin

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).

Extract WordPress Zip

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.

Update wp-config.php

5. Run install.php

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

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).

304 Comments

1 13 14 15
  1. Ellada
    Aug 14, 2012 @ 10:33 pm

    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?

    Reply

  2. Georgiana
    Aug 17, 2012 @ 3:34 pm

    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!

    Reply

  3. Alquiler yates Ibiza
    Aug 18, 2012 @ 4:16 am

    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.

    Reply

  4. Wordpress Family
    Aug 22, 2012 @ 2:12 am

    Nice tutorial!

    Reply

  5. kl;;;;;;;;;;;;;;;;
    Aug 28, 2012 @ 8:12 am

    jkl;

    Reply

  6. Surendar
    Sep 4, 2012 @ 5:23 pm

    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.

    Reply

  7. Rosemary
    Oct 4, 2012 @ 8:00 pm

    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.

    Reply

  8. Peter
    Oct 8, 2012 @ 10:04 am

    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

    Reply

  9. Peter
    Oct 8, 2012 @ 10:05 am

    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

    Reply

  10. blah
    Nov 22, 2012 @ 9:11 am

    blah blah blah

    Reply

  11. Muhammed Athimannil
    Nov 23, 2012 @ 8:37 pm

    I’m gonna start with this.

    Thanks a lot :)

    Reply

1 13 14 15

Leave a Reply