Mark Kirby - Mobile Developer

How to install wordpress using ssh and svn

This tutorial will allow you to install wordpress on a remote server that has ssh access, or on your own local machine, using svn. This will allow you to do the following:

  • install Wordpress with a single line of code
  • update Wordpress with a single line of code, from then on

This could save you hours of work if you manage several wordpress sites and don’t use WordpressMU.

What you will need

If you are installing this on a mac, and you have set up a webserver you are ready to go!

If you are are installing this on windows you will need to install svn on windows first. Seek out the Win32 package. You will also need a webserver - you can follow my post on how to install wordpress on a local machine to figure that one out.

If you are installing this on a remote server, perhaps your webhost, you will need ssh access.

If you understand everything so far, your going to find the next step very easy. If not, you should probably read my post on SVN first. Then read on.

Step 1 - Getting to the place you want to install Wordpress

Firstly you need to get to the position on your server, be it on Windows, Mac or a remote server, where you want to install your Wordpress software. Once you reach that point, its the same wherever you are.

On WIndows

Go to start -> click Run type ‘cmd’ and click OK - this loads up the command line.

Figure out where you want the wordpress installation to go, on my machine I use WAMP so for me its C:\wamp\www

Type the following into the command line window (and press enter after):

cd C:\wamp\www

Where ‘C:\wamp\www’ is the path you want to use.

Type:

mkdir directoryname

Where directoryname is the name of the folder you want the Wordpress installation to go into.

Type:

cd directoryname

Where directoryname is the name of the folder you just created.

You’re ready for step 2.

On Mac

Open up terminal

Figure out where you want the wordpress installation to go, I use my Sites folder.

Type the following into terminal:

cd Sites

Where ‘Sites’ is the path you want to use.

Type:

mkdir directoryname

Where directoryname is the name of the folder you want the Wordpress installation to go into.

Type:

cd directoryname

Where directoryname is the name of the folder you just created.

You’re ready for step 2.

On a remote server

You will need the following details:

  • Your ssh username
  • Your ssh password
  • Your IP Address

You may need to ask your host for some of these details, and they may not give them to you either.

Connecting to your host using Windows

First install PuTTY (go for the installation that just says PuTTY) and start the software.

Under Host name or IP address, enter the host name or IP address of your web server.

Once connected, enter your login name.

Then enter the password.

Skip the Mac section and continue.

Connecting to your host using a mac

Log in to your remote server using the command

ssh username@192.168.0.100

Where username is the username you have that allows ssh access, and 192.168.0.100 is the IP address of the server you want to log in to.

Navigating to your folder

ow navigate to the folder you want to install wordpress in.

cd /username/www

Where ‘/username/www’ is the path to the place where your websites are all stored on your remote server.

Type:

mkdir directoryname

Where directoryname is the name of the folder you want the Wordpress installation to go into if that doesn’t work you may need to use your hosts control panel to make the folder and then continue.

Type:

cd directoryname

Where directoryname is the name of the folder you just created.

Now move on to step 2.

Step 2 - Install Wordpress

First you need to select your version, I would always go for the latest, but what is that?

Go to this website - http://svn.automattic.com/wordpress/tags/ thats the Subversion repository (if you don’t understand what that means don’t worry). Scroll down to find the latest version at the bottom of the page.

Bearing in mind the version you want, enter the following into your command line window:

svn co http://svn.automattic.com/wordpress/tags/2.5.1/ .

Where 2.5.1 is the version you want to use.

Set up a database, set up your wp-config as normal and your ready to go!

Step 3 - Update Wordpress using SVN

Updates are much easier now. Updating with SVN will ensure no folders are overwritten and any unused files are removed.

Do a backup first to be on the safe side, and wake sure your database is backed up.

Using the instructions above in step 1, navigate to the folder containing your Wordpress installation.

Once you are inside the folder, enter the following:

svn sw http://svn.automattic.com/wordpress/tags/2.5.2/ .

Where 2.5.2 is the version you want to update to.

You’re done!

7 Responses to “How to install wordpress using ssh and svn”

  1. On June 5th, 2008 at 6:26 pm, Ryan said

    Super helpful! Thank you very much Mark!

  2. On July 24th, 2008 at 5:22 pm, Upgrading WordPress: Fast, Faster, Fastest | WebDevLounge | design, development, SEO and wordpress | articles, discussion and community said

    [...] Instructions on Setting up a Subversion powered WordPress installation [...]

  3. On August 14th, 2008 at 11:07 am, Michael Rose said

    Fan-tastic… it works! :)

    At the moment I can work locally and upload the changed files using FTP, and exporting/importing the database… but I’m sure there is a much more efficient method.

    How about a tutorial on rsync or SVN for keeping the local and live versions in sync?

  4. On January 25th, 2009 at 1:06 am, mehter said

    the moment I can work locally and upload the changed files using FTP, and exporting/importing -

    the database… but I’m sure there is a much more efficient method

  5. On January 25th, 2009 at 7:13 pm, car pictures said

    Hey Web Master?
    C:\wamp\www’
    localhost error help me?

  6. On January 25th, 2009 at 7:14 pm, Hairstyles said

    Thank you

  7. On January 31st, 2009 at 6:13 am, banner takas said

    thanks…

Leave a Reply

This site was created with Wordpress, using my own template.