How To: Install WordPress on Windows

Howdy! It appears that you have come to this blog for the first time. In order to receive more useful posts like this, you can subscribe to RSS feed or receive latest articles to your email inbox. Thanks for visiting this blog, and have a good day.

When it comes to developing themes and plugins, you need the right tools to finish the job quickly and efficiently. There are a plethora of tools to choose from, and your selection can vary by personal taste. Some go for open-source tools like GIMP and Nvu, whereas others stick with trusted commercial applications like the omni-present Adobe Photoshop and Macromedia Dreamweaver. Whatever your choice maybe, it is essential that you like it and stick with it.

WordPress+XAMPP

Testing your themes and plugins can be a big head ache, as you have to reload the page every time, consuming bandwidth. Bandwidth is precious, unless you own a dedicated server at MediaTemple or something(!). Also, any edit has to be uploaded before previewing. This gets tiresome, and you would have wondered whether there is an easier way.

Linux users have the LAMPP(Linux, Apache, MySQL, PHP), which is easy, but Windows users are mostly unaware of a similar package. It is called XAMPP(XP, Apache, MySQL, PHP). Once you install it, you can setup WordPress locally, and test your plugins/themes/hacks offline. You save bandwidth, effort and time.

Here are the steps for installing WordPress locally:

  • Download the lite version of XAMPP, called XAMPPlite Choose the .exe version.
  • Install it at a partition of your choice. Here, we are using C drive.
  • Go to the install folder, that is C:\xampplite. Double-click the xampp-control.exe file, and start up MySQL and Apache services in the dialog box that follows.
  • Go to http://localhost/ in your browser. From the left column, choose your language.
  • Click on phpMyAdmin in the left column(see image below).

    XAMPP screen

  • In the “Create New Database” Field, enter “wordpress” (without quotes), and select utf8_unicode_ci in the drop down box in the next field. Click Create. XAMPP setup is now complete.
  • Download WordPress.
  • Unzip it to C:\xampplite\htdocs
    You should have a wordpress folder in htdocs. Go to it, and open up wp-config-sample.php.
  • You will see a list of default values. Change them to below(do not copy-paste this, just find the required info and update the file):
    define('DB_NAME', 'wordpress'); // The name of the database
    define(’DB_USER’, ‘root’); // Your MySQL username
    define(’DB_PASSWORD’, ”); // …and password (needs to be empty, just for local install)

    Rename the file as wp-config.php and save it.

  • Go to http://localhost/wordpress/wp-admin/install.php in your browser, and follow the steps.

You’re done. Now, use the wordpress folder as you would on your webserver, and upload the plugins, themes etc. to test. I recommend doing this before attempting a manual install in your server ( if it doesn’t have one-click installer). Now, go and test to your heart’s content :D I am having a great time testing, and the instant page loads of my dummy blog looks great.

41 Comments
  1. Great tutorial man. I’ve already set this up on my local PC and loaded contents from my hosted blog on to this.. so I can get the exact environment I need when I’ve to test plugins :D

  2. Linu said on September 13th, 2007

    I will try this…

  3. You missed one step…
    You have to rename wp-config-sample.php to wp-config.php

    BTW, I think LAMPP and XAMPP are one and the same, except L is for Linux and X is for XP. :)

  4. Post authorSumesh said on September 13th, 2007

    @Shankar: Thanks. And yes, this is for newbies. I expect most of you to have this already.

    @Linu: Do try - it’ll make developing themes easier.

    @Deepak: Thanks. I guess, I forgot it. Am editing it now.

  5. Great tutorial! I don’t use XAMPP. I use NetServer, but still I have XAMPP in my PC in case I mess up with NetServer.

  6. Post authorSumesh said on September 17th, 2007

    @Haris: Thanks, and glad you liked it - I feel happy and believe it is worth the time spent, only when I get comments rolling.

  7. Nice tutorial, especially if you want to test themes and plugins locally before installing on server.

  8. Andy said on September 18th, 2007

    Having trouble with establishing a connection with the database. After http://localhost/wordpress/wp-admin/install.php

    Have you missed out a step?
    define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    I have set up WP on a live server before so I haven’t miscalulated my ability to edit the config file, so any ideas what is missing? Any help is appreaciated, as I’m setting this up to learn how to create themes!
    Cheers

  9. Post authorSumesh said on September 18th, 2007

    @Nirmal: Thanks, hope you’re having a blast using it :D
    @Andy: No, localhost(which corresponds to http://127.000.001/) is the local IP of your computer. It does not have to be changed, unless of course, you are using a live server. As for ideas, well, try again :D Maybe you missed a step.

  10. [...] by Debasis Pradhan How To Track New RSS Subscribers Google Analytics in 3 Easy Steps by Rhys How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column [...]

  11. Great Tutorial Buddy . Currently i use EasyPHP for this purpose . It is a cool way to test your themes and plugins .

  12. [...] How To: Install WordPress locally(on PC) by Sumesh [...]

  13. I use Appserv. You can find installing wordpress on windows tutorial in my blog

  14. Wow! Never thought about or even realized that you could do this. What a great idea and well described. Will put it on my to do list after I have slimmed down all the junk on my hard drive.

  15. [...] How To: Install WordPress locally(on PC)by Sumesh [...]

  16. [...] by Madhur Kapoor Testing Lessons – Top 5 Secrets to Bug Hunting Success! by Debasis Pradhan How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column [...]

  17. Post authorSumesh said on September 21st, 2007

    @Myo: I saw your tut, though its a bit long. For now, I prefer XAMPP.

    @MDB: Thanks, and glad that this tut could be of help.

    @Madhur: Thanks.

  18. [...] Recently, Sarah from BlueJar.com had conducted a group writing project. The topic was HowTo. I participated with my entry How to Install WordPress on PC for better theme development. [...]

  19. if you want to do it the techie way (without xampp). check out my apache 2.2 installation guide

  20. Post authorSumesh said on September 22nd, 2007

    @Syahid: Thanks for the link - I went through it. Its nice for show-off and ego boosting, but for now I find this method the easiest - easier than EasyPHP/direct method.

  21. [...] How To: Install WordPress locally(on PC) by Sumesh [...]

  22. [...] by Madhur Kapoor Testing Lessons – Top 5 Secrets to Bug Hunting Success! by Debasis Pradhan How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column [...]

  23. Great post, I’ve often wondered why more bloggers don’t install locally to do testing, theme modifications, etc. I use WAMP and my only problem is finding the time to do more work/testing on my local install so that I can change my live site! ;)

  24. [...] by Debasis Pradhan How To Track New RSS Subscribers Google Analytics in 3 Easy Steps by Rhys How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column [...]

  25. Post authorSumesh said on September 25th, 2007

    @JoLynn: Yes, it is sensible to do testing in a local setup that is fast, and has no consequences when we mess it up. WAMP is cool - I read about installing it in a post by Ben Bleikamp(ProBlogger’s designer). As for not getting time, you’re not alone - count me in too!

  26. [...] How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column inch: How to advertise in a local newspaper by Angela How To Prepare For The Perfect Date by Shaun Low How To Ride a Bicycle in the City by Roger Green [...]

  27. [...] by Debasis Pradhan How To Track New RSS Subscribers Google Analytics in 3 Easy Steps by Rhys How To: Install WordPress locally(on PC) by Sumesh How To Pull In Quick Cash With a Myspace Resource Site by Levi What the hell is a column [...]

  28. [...] though I had read about Keith’s WPAU plugin, I decided to go the manual way. I had already set up a install of 2.3 on my PC(which was beta), and upgraded it for practice. The process was almost instant, and I was confident [...]

  29. Mitra said on October 6th, 2007

    Nice tut..Sumesh. I came across this one as I was looking for a more specific solution. I was able to do everything you have mentioned in the tut and wordpress was installed, up and running the first time. But once I shutdown the pc and restart it a while later, i was unable to logon via a login page i had bookmarked.

    I tried running the setup.bat once more and it kept saying:
    Sorry cannot find php.cli
    Must abort these process!

    When i open xampp_start: could not open default file - mysql\bin\my.cnf

    I am not sure whats wrong or how to fix it. Any pointers?

  30. Post authorSumesh said on October 6th, 2007

    @Mitra: That’s got me stumped. I’ve installed XAMPP+WP on two different computers, and nothing’s wrong. Are you sure you did not turn off any services?(Start>Run>msconfig, and click enter, you’ll get a window, click Services tab, and enable all services, restart and try again)

  31. [...] is a bit tricky, but play with it in a test blog installed locally on your PC, and once you get it right, upload it to your server. Feel free to leave a comment on any issues [...]

  32. [...] but were too intimidated to do so for the fear of breaking your blog, Sumesh shows you how to install Wordpress on your computer so you can easily make changes and at the same time, be sure that you won’t ruin your actual [...]

  33. Hi Sumesh,

    I also wasn’t aware that we can do this. And here I am trying to mess around while online. Oh …the silly me. :-) Bookmarked and stumbled!

    Thank you

    Monika

  34. Post authorSumesh said on October 19th, 2007

    @Monika: Don’t mess around online, and especially not on your live blog. This method is much better, and many use it for theme/plugin development. And thanks for the stumble.

  35. Monika @ The Writers Manifesto said on November 2nd, 2007

    Hi Sumesh,

    I have gotten as far as installing everything as instructed. :-) It wasn’t as hard as expected as I’m no tech geek. But now I’m stuck. How can I upload new themes and stuff via FTP? I don’t know the path and the user and password I need to use here.

    I’m only familiar with FTP and have no idea on how to use mySQL to upload stuff. Could you please point me in the right direction? Once I can figure out the right path with FTP (I use SmartFTP) I will be fine.

    Thanks
    Monika

  36. Post authorSumesh said on November 3rd, 2007

    @Monika: Its all easy, and you’d feel it funny that it has been under your nose all the while. Assuming that your wordpress folder is x(usually C)x:\xampplite\htdocs\wordpress\wp-content is the folder which contains plugins, themes and uploads folders. Then, just put the themes/plugins to their respective directories, like on the real server. No FTP, just Windows Explorer (or its Mac equivalent).

  37. Monika @ The Writers Manifesto said on November 5th, 2007

    Duh…LOL, it does make sense now you mentioned it. Naturally it is all stored locally so it would be there. Oh man, sometimes I don’t see the trees in the forest.

    Thanks Sumesh ;-)
    Monika

  38. Post authorSumesh said on November 5th, 2007

    @Monika: Glad you got it, no prob =>

  39. hi sumesh,
    i don’t know abc’s of s/w…i just wanted to have a new theme for my blog in wordpress.
    i did everything mentioned here and was able to look at the theme that i wanted locally, but i don’t have any clue how to have that theme in my wordpress blog.
    can u please help me? i know i am dumb…hope u help me.

    thanks,
    fazeetha.

  40. jojo said on March 18th, 2008

    Hello..
    I got an error…
    It says that Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress database.

    Anyone cah help me?

  41. Awesome instructions! I am so happy I can now test WP on my local machine now.

Leave a comment

  • Our network
  • India Technology Bloggers