September 22nd, 2008
Setting Up A Local WordPress Installation With SVN On Ubuntu
I have been playing around a bit today with my local WordPress installation and just set it up with SVN so that all I have to do is type in one command to upgrade it. It is pretty cool, so I though I would share my new found knowledge. Not only can you keep your local installation up to date with the latest stable release, you can also get the very latest version of WordPress that the developers are working on.
The following works with Linux, Mac and Windows although in this tutorial I will be using Ubuntu.
Firstly you need to have Apache, PHP and MySQL installed on your local machine. There are hundreds of tutorials which show you how to do this. Just do a Google for it.
Step 1:
Create a directory where WordPress will be installed. This should most likely be in your local www/ folder as we will be installing WordPress later and will need Apache to serve the installation. In Ubuntu the folder is located at /var/www/.
I created two directories. One called “wp-stable” and the other “wp-latest”. In these two directories I will put the latest developer version of WP and the other will have the latest stable version that everyone else is using.
Step 2:
Now it is time to checkout the WordPress source into these two directories (or just one if you wish). You need Subversion installed on your system. To install Subversion in Ubuntu type the following command into the terminal:
sudo apt-get install subversion
Subversion should now be setup on your system.
Step 3:
Now, navigate to the first directory “wp-stable” in the terminal. You will most likely use the following command:
cd /var/www/wp-stable/
Then, in the terminal type the following:
sudo svn co http://svn.automattic.com/wordpress/tags/2.6.2/ .
Replace 2.6.2 with the latest stable release of WordPress in the command above.
What this does is it takes the files of the latest stable release of WordPress from the repository and places them locally on your computer.
Do the same for the “wp-latest” folder but instead of /tags/2.6.2/ use /trunk/ in the above svn command. That will give you the latest developer release. (Be aware that plugins etc may not work with the latest release and it may be a little buggy).
Make sure you run the WordPress upgrade once you have finished updating via SVN.
Step 4:
You can now install your two WordPress installations locally by visiting localhost.com/wp-stable/ and localhost.com/wp-latest/. Make sure you setup your wp-config.php file though.
Step 5:
Now, to update your two local WordPress installations you just type the following two commands into the terminal:
cd /var/www/wp-stable/ sudo svn update
Replace /wp-stable/ with /wp-latest/ to update the other directory.
Additional Info:
You will probably have realized that when the next version of WordPress comes out, our directory which has the stable release in it, will still call from /tags/2.6.2/ even though we want to call from /tags/2.7/ etc. To fix this we have to do a SVN switch:
cd /var/www/wp-stable/ sudo svn switch http://svn.automattic.com/wordpress/tags/2.7/ .
And there you have it! You now have WordPress installed on your system locally and are able to update it with one command.

























Fantastic information,This is the first time i heard about this. keep it up this good works.
Thanks,
Micheal