How To: Install WordPress on Windows

ADVERTISEMENT
To get our software and web/tips via email, sign up for daily email newsletter.
Subscribe to RSS feed or follow me on Twitter?

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(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:

ADVERTISEMENT

  • 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:xampplitehtdocs
    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.

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

    Shankar Ganesh
  2. I will try this…

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

    Deepak
  4. @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.

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

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

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

    Nirmal
  8. 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

    Andy
  9. @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.

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

    Madhur Kapoor
  11. I use Appserv. You can find installing wordpress on windows tutorial in my blog

    Myo Kyaw Htun
  12. 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.

    MDB
  13. @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.

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

    syahid ali
  15. @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.

    Sumesh
  16. 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! ;)

    JoLynn Braley
  17. @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!

    Sumesh
  18. 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?

    Mitra
  19. @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)

    Sumesh
  20. 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

    Monika @ The Writers Manifesto
  21. @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.

    Sumesh
  22. 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

    Monika @ The Writers Manifesto
  23. @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).

    Sumesh
  24. 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

    Monika @ The Writers Manifesto
  25. @Monika: Glad you got it, no prob =>

    Sumesh
  26. 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.

    fazeetha
  27. 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?

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

    Lisa Irby
  29. Read your tutorial and followed the steps. When inputting the link: http://localhost/wordpress/wp-admin/install.php all I get is a box with an error message “Error establishing a database connection and then a bunch of options of what it could be.
    I’ve been over the instructions with a fine tooth comb, xammp is running (I’m using the full version if that makes a difference), I can get into MySQL etc.etc.

    Any suggestions what the deal could be? Really appreciate your help.
    Thanks, Rennie

    Rennie
  30. @Rennie: The instructions here are for the smallest XAMPP package, that is XAMPPlite. Hence, these steps may not work for the full version of XAMPP.

    Sumesh
  31. Please allow me to share this video tutorial I created on how to Install WordPress Locally using Wamp with your audience.

    http://www.youtube.com/watch?v=biQWyBcYSX4
    Regards
    Shane

    Shane Swing
  32. I have installed XAMP on my pc.
    Sometimes its take a long time until the sites is open.
    Would you tell why this happen?

    Afiliasi
    • If you have external scripts (ads, for example) in the template, each page load would be delayed because of that.

      Sumesh
Leave a Reply

If you have a computer/web help question, click here to ask it on our forum for faster response.