Installing a local version of Wordpress
April 26th, 2008
This tutorial could probably be found anywhere on the net but seen as I’ve been through the process myself I thought I would put up some of the information I’ve found.
note: This is a tutorial based on Windows XP. If you are using Windows XP Pro and have IIS running on your machine you will have to stop it before running XAMPP. Mac users should check the extra information section at the bottom of this post for some links I’ve found for doing all this stuff on a Mac.
On with the tutorial.
1) Install a localhost.
First of all you need a localhost. I use XAMPP which can be downloaded from http://www.apachefriends.org/en/xampp-windows.html. There are alternatives to XAMPP which I’m sure are just as good but I use XAMPP so that’s what I’m going to describe.
When you arrive at the page above you will be able to either select XAMPP or XAMPP Lite. I’ve seen a fair few tutorials explaining how to install Wordpress on XAMPP Lite but it seems more fussy than just using XAMPP (XAMPP Lite does of course contain less stuff so just have a look at which version you want because I’ll stick up a link to a tutorial for XAMPP Lite).
Download the XAMPP installer. Once you have this saved to your computer give it the usual double click and let it do it’s business. It’s default install location is the root of the C drive. I’ve left it there but you could put it where you want (this might cause problems when navigating to your localhost in a browser – I’m not sure).
You will end up with a folder in you list of programs called Apache Friends. Inside here should be an application called ‘XAMPP Control Panel Application’. Get that running.

Above you can see a screen shot of the ‘XAMPP Control Panel Application’. To start XAMPP you need to click the start buttons next to ‘Apache’ and ‘My Sql’. Once you have done this your control panel should look something like the screen shot below.

You can then use your browser to navigate to the localhost by typing just localhost into the address bar.
So that’s the XAMPP install sorted, you still need to set-up a database but first we’ll move onto installing Wordpress.
2) Install Wordpress locally.
Ok the first thing I’ll say here is don’t go copying all your Wordpress files from your web host into XAMPP because you will still have to go through the Wordpress install process again (I did this the first time).
So go to http://wordpress.org/ and download the latest version of Wordpress. I would probably download it straight into the ‘htdocs’ folder within your ‘xampp’ folder. Unzip the download of Wordpress.
You will probably end up with a folder named something like ‘wordpress-2.5.1′ (that’s the latest version at the time of writing). Inside that folder will be the ‘wordpress’ folder. I would COPY the ‘wordpress’ folder into the ‘htdocs’ folder so that you can keep an original, un-modified copy of Wordpress for a back-up.
Now, you first need to set-up a database for Wordpress to use. You need to navigate to the XAMPP home page in your browser (just type localhost into the address bar). Then find the link to ‘phpMyAdmin’. Once here you should be able to see the area that allows you to create a new database. It should look something like the screen shot below.
![]()
For ease copy what you see in the screen shot when setting up your database in phpMyAdmin (you should be able to set up multiple databases to be used with different copies of Wordpress but this is beyond the tutorial).
Now get back to the ‘htdocs’ folder within your ‘xampp’ folder. Then open the ‘wordpress’ folder and you should see a file named ‘wp-config-sample.php’. Open this file in your desired editor and make sure that the values match the screen shot below.

Save the ‘wp-config-sample.php’ file as ‘wp-config.php’. This allows Wordpress to see this file. The reason that ‘DB-USER’ is ‘root’ and ‘DB-PASSWORD’ is empty is because these are the defualt access rights for phpMyAdmin. Now you’re access to the database is set-up.
Next you need to get back into your browser and copy the following into the address bar ‘http://localhost/wordpress/wp-admin/install.php’. This will then begin the local set-up of your blog. You will be asked for a blog name and an email address. Make sure you make a note of the password you’re given because it’s totally random and I know that I wouldn’t remember it!
Another thing you may need to do is to make sure that permalinks work. This can be done by navigating through the following folders. xampp > apache > conf and then opening the file named ‘httpd.conf’ in your desired editor. You should then search for ‘rewrite’. You will see this line ‘#LoadModule rewrite_module modules/mod_rewrite.so’. Remove the # from the start of the line so that its reads ‘LoadModule rewrite_module modules/mod_rewrite.so’.
So that’s it. You should now be able to run a blog on your localhost. This, in my opinion makes for much faster customisation and theme development because there is no need to upload edited files from your local copy of Wordpress to your web host via ftp or use the in-built Wordpress editor. Just open the files you want to edit straight from your local wordpress directory and then save them straight back in there and all changes are immediately apparent.
3) Importing / Exporting posts
If you have installed a local copy of Wordpress but have a live version up and running on a web host you may want to bring all of your posts from your live version and add them into your local version. This is very simple and is done by logging into your Wordpress admin area, clicking on ‘manage’ and then either clicking ‘import’ or ‘export’ depending on what you want to do. So if you export from one version of Wordpress you can then use import to add those exported posts into another version of Wordpress.
4) Extra information
This website was very useful to me and tells you most of the information regarding setting up a database and installing Wordpress that I have described in this post, but it has the added extra that it explains how to set-up XAMPP Lite which some users may want to do. http://www.tamba2.org.uk/wordpress/xampp/
Another useful place to go for help with these topics are the Wordpress forums. This link is a thread that I posted on when I was first trying to install Wordpress locally. I got a very fast and useful response everytime I posted.
http://wordpress.org/support/topic/128462?replies=16
That thread also describes using SVN. This is subverion for Wordpress which I have yet to look into but it can be very useful if you are going to be modifying a local copy of Wordpress and then transferring files to a live version because it keeps track of the changes you have made. http://wordpress.org/download/svn/
Mac users check these links out. They might be good, they might be crap. Don’t blame me if they are crap.
http://maczealots.com/tutorials/wordpress/
http://allforces.com/2005/08/22/wordpress-on-mac-phpandmysql/
http://www.freemacblog.com/mac-server-series-install-wordpress-on-your-mac-using-mamp/
http://michaeldoig.net/4/installing-mamp-and-wordpress.htm
So that’s it. A local server with Wordpress installed and ready to use. I hope this has helped anyone who has read it or at least pointed you to some useful info. If I’ve missed anything or you have any questions just post a comment and I’ll get back to you.
Tags: Development, Localhost, Wordpress, XAMPP
June 13th, 2008 at 4:25 pm
How can additional Wordpress versions be added to Xampp?
June 13th, 2008 at 11:44 pm
If I want to add other versions of Wordpress, at what point in the process do I start from?
June 17th, 2008 at 10:20 pm
Hi George.
I’m assuming you mean numerous copies of Wordpress – not actual different versions (although it’s pretty much the same thing)?
I think what you would need to do is keep them in separate folders/directories within the root of your Xampp server. You could then set up separate databases for each install of Wordpress.
The only problem I can imagine, but don’t know if it will happen, is that the paths within your install of Wordpress may need altering to include the new folder/directory.
You should just give it a try and see – i’m sure containing each copy of Wordpress in a separate folder will work fine.
Let me know.
Cheers.
June 17th, 2008 at 10:24 pm
George.
A quick look on the Wordpress codex site came up with these tutorials:
http://codex.wordpress.org/Installing_Multiple_Blogs
http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
They may be of some help to you.
Thanks.