Today I’ve got a reader-requested tutorial about how you can install WordPress on your Windows 7 computer (same applies for Windows XP & Vista). This is such an important part of my WordPress working life, and if you don’t know how to do it, now’s your chance to learn. But first…..
Why Would I Want to Install WordPress on my Computer?
Installing WordPress locally gives you a fantastic test environment. You can install as many WordPresses as you want on your computer. On mine I’ve got:
- Single-site
- Multisite
- Beta
- Plugins
- WordPress
This gives me all sorts of scope for testing stuff out, playing around – a WordPress playground right on my computer.
Let’s get started:
1. Download Xampp
Xampp is an Apache distribution containing MySQL, PHP and Perl. This makes it awesome for WordPress. You can download it from here.
There are a number of different distributions so make sure you select the distribution that’s correct for your operating system. For the purposes of this tutorial we want the Windows distribution.
Click on the distribution.
Click on the installer.

2. Install Xampp
Double click on the installer and choose your language.

Decide where you want to install xampp.

Click install.

Sit back, relax, wait for it to install.

3. Fire up Xampp
Start Xampp. Start Apache and MySQL.

You may get a warning from Windows. You want to make sure that Windows allows access.

You can check to see if your new local server is installed by visiting http://localhost

Nice!
4. Set up MySQL Database
On your Xampp control panel click the admin button beside MySQL.

In your browser you’ll be taken to the MySQL dashboard. You need to fill in the details for your new database:

- Set your MySQL connection collation: to utf8_unicode_ci
- Choose the name for your database. I’m naming this one singlesite – you can call it whatever you want.
Note: if you are doing a live installation on a server you must add a username and password. Do not use “root” ever on a live site. This isn’t necessary on a local installation.
5. Download and unzip WordPress
Download WordPress.
You need to unzip it to the correct folder on your computer. Find the Xampp folder and navigate to xampp>htdocs

Unzip WordPress there and rename the WordPress folder to whatever name you want. I usually match mine to my database name.
6. Configure WordPress
Open up wp-config-sample.php and find the MySQL settings.
Here is what you need to update the settings to:
/** The name of the database for WordPress */
define('DB_NAME', 'singlesite');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', '');
/** MySQL hostname */
define('DB_HOST', 'localhost');
Remember to replace singlesite with whatever you called your database.
Save the file in your root WordPress folder as wp-config.php

7. Install WordPress
Open up your browser and navigate to http://localhost/singlesite/
The familiar WordPress installation screen will appear.

Fill in your details and click “Install WordPress.”

There you go – WordPress is installed locally on your computer.

Have fun!
Why not just use WP as mentioned previously on this blog?
Are there any advantages to the xampp route instantWP?
Cause it sure is slick to have it cooking with one click and be able to move the whole WP install around or copy it by just moving or copying one folder.
Sorry, posting from my phone- I meant why not use InstantWP?
http://www.instantwp.com/
Good question. I’m going to do a comparison of the two next week :)
DesktopServer is XAMPP with a twist. Installs WordPress sites in a click. Mac & Windows and features ‘virtual hosts’ servers, with a ficticious top-level domain .dev, that can make transitioning to a .com real server easier. No host files or database to mess with either. It configures it all. Just supply the fake domain names, like http://www.test-some-plugins.dev, http://www.example.dev, etc. http://serverpress.com/products/desktopserver
I’ve used both, Roger, and I prefer Xampp. Xampp lets you host directly from the root, whereas Instant WordPress always hosts you in a subdir (/wordpress). I haven’t found a way around this in InstantWP; maybe they’ll fix it in a later version.
I also like using Xampp to test out other platforms and technologies alongside WordPress. InstantWP is perfect if you don’t do much development outside of WP.
Siobhan – GREAT tutorial!
+ Jay
It’s the right thing to do as alt to “cowboy programming”. :-)
If you’re doing a comparison you could take a look at Bitnami. I have used this and seems similar to Xampp. InstantWP seems easiest though.
One aspect worth testing is how each it is to import from your live WP system, dev / test locally and move back.
Great tutorial! I’ve spent many a Friday evening at home with a glass of wine and XAMPP fired up. ;)
I’ve used both – XAMPP and Instant WP and IWP is the one I like more. I don’t know for you guys, but on my PC xampp doesn’t work when I am signed in Skype. Need to close Skype in order to use xampp…
Stefan,
The problem is a port conflict as Skype by default use port 80, which XAMPP wants to use as well. Here is an easy solution:
http://kodegeek.wordpress.com/2009/07/20/xampp-and-skype-port-conflict-issue/
Cheers,
Martin
I like the way you explained that things. Permission for saving :)
Hi Siobhan, your tutorial looks quite straight forward and well presented but i am having problems with step 4. When i click ‘Admin’ next to the mySQL button nothing happens? Ive tried it on windows 7 and XP systems. Ive also asked someone else to test it out on their computer and they are getting the same result. Do you have any idea what the problem could be? Im using Xampp control panel version 2.5 (9. May 2007)
Also i noticed in your tutorial the Xampp control panel is different in step 4 from the one in step 3. Is there a reason for this?
Thanks – Dave
Hi Dave,
Did you ever resolve this issue? I’m having exactly the same issue! Please let me know.
Charma :)
No i never resolved this issue. Siobhan didnt reply to my question so i went with a portable Word Press package called “Instant Word Press” which worked great for me first time :)
http://www.instantwp.com/
If anyone still has this problem, try stopping mysql, opening c:\xampp\mysql\bin\my.ini, search the file for “bind-address” and remove the “#” from the beginning of the line. Save & restart mysql. Click admin and refresh the page. Worked for me when I got stuck at this step
I had the same issue; I was using an older version of XAMPP that I had installed a few years back for some JOOMLA sites.
Solution: you can find the MySQL admin yourself by typing http://localhost/phpmyadmin.
As someone who is on the go at nearly all hours of the day, is there a way to manage my wordpress using a mobile version of this? I’ve asked around even called a technical staffing firm, and from what I hear theres only a viewing app from WP but thats it..
Thanks for this awesome tutorial, Siobhan. I’m gonna check out Xamp. By the way how do we install phpMyAdmin (or anything similar) to manage our local WordPress database?
Hi Kevin.
No XAMPP includes phpmyadmin already and can be reached from the xampp webpage on your localhost.
Uh…who’s awesome? Siobhan McKeown is!
Thank you for this article – most helpful. If I want to set up and test multiple WordPress sites, do I follow these steps as written? What would I do next, or instead, to create and connect to the multiple sites? Two are sites that are created that I would like to have also in a local testing environment as we are making updates (it is a free wordpress site), and two are new sites that will be developed and then loaded via hosting (not free versions but hosted WP).
Thank you!
~ Caprice
Siobhan – awesone post and easy to follow. I am having the same issue as Dave 28.aug.2011.
I have changed the skype port (thanks Stephan) and tried to run Aampp again with no luck. It just keeps running.
a
Thanks for the tutorial! I am, however, having one trouble spot:
After several attempts and double checking that I am following the steps correctly, I cannot get past step 6. After saving the wp-config.php file with the proper edits, I try to launch the page at http://localhost/singlesite and get an Error 404 – Not Found.
I’m not really sure what I’m doing wrong here…any help?
(I did purposefully name mine “singlesite” as well, for reference.)
Hey Shawn:
I had the same issue. Try putting this in your browser:
http://localhost/wordpress/wp-admin/install.php
This assumes the files are installed in a directory called ‘wordpress’. It launched the install page and seems to work.
Thanks, Will!
I tried http://localhost/singlesite and http://localhost/wordpress/wp-admin/install.php. I received a Error 404 – Not Found and Error establishing a database connection. I checked the config file for the database and user name which are correct. The XAMPP Control Panel does show Apache and MySql running.
Thanks in advance for any assitance to what I can check.
Have you tried: http://localhost/singlesite/wp-admin/install.php
I am having the exact same problem!Here’s what I get:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
12/18/11 10:19:41
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
Thanks for any help!
Hey,
I just wanted to share with you our easy online wordpress installer, it is absolutely free to use.
Here is the link: http://www.freewpinstaller.com
Thank you
Thanks for this wonderful document, for me everything worked fine except last step. But I think, being new to web technology, I’m not keeping my unziped wordpress folder in proper directory. Will you explain where I need to keep my wordpress folder?
Thanks in advance.
Unzip all of the files and folders in the wordpress folder into htdocs/singlesite (i.e. they shouldn’t be in the WordPress folder anymore)
Or you can unzip the WordPress folder to /htdocs/ in which case your address for your WP site would be localhost/wordpress/
I was having the same error message. The way I fixed my problem was by moving the contents of the wordpress folder into one called singlesite (same as above), after that it didn’t recognize the database I had previously created. I dropped the database, and then created another one (named the same thing)and voila!! worked like a charm.
I used new AMPPS stack to install my WordPress. It was damn easy. Also it allows me install other 230+ open-source scripts. :D
http://www.ampps.com
hey thanks Siobhan !! It was a great tutorial !!
Nicely done, except that your instructions are unclear at a couple of points.
Under #4, you leave out a couple of steps/screens that appear at least on my Win7, XAMPP/PHPadmin installation: I need to select MySql. Several databases appear already to have been created, included on called “test.” When I get to “create database,” there is no connection option. I get a log-in screen with the user field blank. I used “root,” but it’s not clear to me whether I could have named any user.
Under #5, you instruct us to “navigate to htdocs,” and advise us to download/unzip WordPress… but you don’t specify where. In the htdocs directory, in a new directory under the desired name of the installation… if you do that, WordPress will download into yet another subdirectory…
The correct choices for the above will no doubt appear obvious to an experienced user, but will create uncertainty and confusion for a first-timer. The choices would easily and simply be clarified with just a couple of small additions, for instance by showing full paths in the example images.
Hey great Tutorial. I noticed you had a multisite directory in your htdocs, I’m going to guess for this site you enabled the wordpress multisite feature. I’ve actually been trying to do this for some time and I’ve been running into a few problems. It would be great if you could point me in the right direction as to how I would go about doing this properly. I’m OK on enabling the multisite options, most of my problems lie in the configuration of the server and the hosts file.
Happy New Year!
Just wanted let everyone know that a new version of DesktopServer v3.3 is now out. It automates all of this for free. The premium version does multisite and more.
http://serverpress.com/news/getting-started-with-wordpress-multisite/
Also had the same issue in Step 7, with http://localhost/singlesite error!
Went back to step 6 and inserted my MySql Database password in the MySql Settings section in wp-config.php
eg…
/** MySQL database password */
define(‘DB_PASSWORD’, ‘mypassword’);
Then accessed WP Setup via url:
http://localhost/wordpress/wp-admin/install.php
So far, so good, although I am currently downloading Instant WordPress too as I like the idea of being able to run WordPress off a Flash Drive (which means I can take demo-sites to clients)
One other thing… once installed, the WordPress Dashboard is accessible via URL: http://localhost/wordpress/wp-admin
Very useful post as i am new in WordPress this post might help me to install WordPress locally.
Thanks
Very useful blog. This post might helpful to those who want to install worpress locally.
Thanks for sharing.
http://touchwebsitesolutions.com
A very useful article, for WordPress beginners, for creating test environments. Thanks a lot for such useful article & for sharing this article.. Thanks!
Thanks, very useful guide, though had some problems with step 7, install wordpress where is says ‘Open up your browser and navigate to http://localhost/singlesite/'- actually turns out needed to navigate to http://localhost/wordpress/‘ to get to the wordpress installation page- help this helps others
very helpful! guided me till the end :)
thank you very much.
Hi,
Am at step 3 but when I start apache – it stops after a few seconds. Am stuck at step 3. Help:) Anyone:)
Gr8 tutorial….awesome work….Very easy to install… Thumbs Up :)
Amazing tutorial!!! Thanks!!
great tutorial its help me a lot and after reading this all stuff i m able to easily install WordPress on my computer
thanks
Thx for sharing great tutorial about xaamp…
http://gresik.co/
Dear sir
i unable to install wordpress asking username password how to create database in local
Nice tutorial, worth noting that when using MAMP on Mac you will need to set the Database password to ‘root’ aswel as the username.
http://www.mathewporter.co.uk
Siobhan,
Thank you so much for a simple & straightforward install process for windows.
Regards,
Amir
Siobhan,
Thanks so much for this. I was frustrated because I couldn’t figure out WHERE to put the wordpress folder. You told me! Quick and easy after much troubles elsewhere.
-dan
I installed xampp and dropped wordpress files into the htdocs directory. When clicking on index.php the browser tries to download the file father than run the php code.
Any ideas as to what I have done wrong?
I followed all your steps but when i run localhost/wordpress, I am getting
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required ‘C:/xampp/htdocs/wordpress/index.php’ (include_path=’.;\xampp\php\PEAR’) in Unknown on line 0
How shuld i solve thsi? please help me
I did exactly all your direction in the post but still having problems.When i want to view the http://localhost/singlesite/ in my browser this the error message i am get “Error establishing a database connection” Kindly help me resolve this.
I did exactly all your direction in the post but still having problems.When i want to view the http://localhost/singlesite/ in my browser this the error message i am get “Error establishing a database connection” Kindly help me resolve this.