Drush (Drupal Shell) is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

That’s straight from the Drupal Drush webpage, and I couldn’t have said it better myself.. If you work with Drupal, you really should consider installing Drush. Unfortunately, though, the Drush webpage is a little light on instructions for installing Drush. So here’s how I did it on a VPS server running CentOS…

Firstly, find out the filename of the latest Drush version. Head over to http://drupal.org/project/drush, and click the Notes link on the download of your choice. As of today (1st July 2010), that takes me to http://drupal.org/node/833938, which shows me a download filename of drush-6.x-3.1.tar.gz. Don’t download it yet – the filename is all we need.

Now, log into your server via SSH, and run the following commands.

Note: if you do not have root access, you might have to prefix the following commands with ‘sudo’.

cd /usr/local/share/

wget  http://ftp.drupal.org/files/projects/drush-6.x-3.1.tar.gz

tar zxvf drush-6.x-3.1.tar.gz

rm drush-6.x-3.1.tar.gz

ln -s /usr/local/share/drush/drush /usr/local/bin/drush

Now you can go back to your sites root directory, and type in drush. If you see a list of available drush commands, you’re in.

What can go wrong?

You have to be careful that you have the correct version of MySQL available. Drush will not work with MySQL 5.1 or lower; you’ll need 5.2 onwards. With another client site hosted at hosting.com we hit that restriction – and they were unable to upgrade us to 5.2. On that site we have to live without Drush :(