One of the major bugbears in Drupal 6 is the amount of security updates required for websites. Any way to reduce the time taken to install and update Drupal is well worth for me; I’d rather spend my time working on payable client jobs.

Installing Drupal via SSH, using CVS, is a method of installation that at first examination appears only useful to real Drupal ninjas – amateurs need not apply.  This is true to some degree – you *do* need to have a VPS or dedicated server, and you *do* need to have SSH access to the server. But beyond that, it’s only a few (long and complicated) Linux commands.

To install Drupal, SSH into your server, and go to the directory level *above* your installation directory. In my case, the directory structure is /home/sitename/public_html, so after logging in I perform the following command;

cd /home/sitename

Once there, I apply the following command (all on one line);

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co
-d public_html -r DRUPAL-6-17 drupal

If you want the quick version, just press the <enter> key now. Drupal will be installed for you. For more information about the command used, read on…

cvs : This invokes the cvs command. If you’re not sure whether you have cvs on your server, just type in cvs and press the <center> key. If you get a lot of helpful information, it’s there; if it says command not found, you haven’t got it. This is unlikely on most linux systems, but if it’s missing contact your support people or install it yourself.

-z6 : This is the compression level. It’s an optional parameter. The compression level runs from 0 (default – no compression) through 1 (low compression, high speed) to 9 (high compression, low speed). 6 works…

d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal : This specifies the directory, and the username/password to connect to that server as. You won’t need to change any part of this. Everything after this option is the actual cvs command we’re going to issue.

co : Shorthand for ‘checkout’

-d public_html : Specifies that we’re going to install Drupal in the public_html subfolder. This is optional, but if you don’t use it you’ll find your Drupal installation hiding within a folder called ‘drupal’.

-r DRUPAL-6-17 : Specifies the revision of the software that we’re going to checkout. Don’t leave this out unless (1) you know what you’re doing, and (2) checking out the HEAD revision doesn’t scare you.

drupal : The name of the repository you want to check out. Don’t omit it, and don’t change it..

What can go wrong

When installing Drupal on a new VPS I generally make two mistakes;

1. Misspelling the command.

After 25+ years developing software, you’d think I’d learn to take notice. But I usually spell something wrong. Just delete any incorrect directories (rm -rf drupal is my usual command) and start again.

2. Forgetting to open the firewall port

If you’re sure you got the command right, but the cursor just sits on the next line down for a few minutes, then gives a timeout error, the odds are that you need to allow port 2401 through the firewall. If you’re wary of firewalls and iptables, your technical people will be able to do that for you.