How to install Drush server-wide in less than one minute

Having Drush installed server wide is handy, especially if you have several users logging on the server. Use the appropriate url for the tarball, you can find the latest release of drush at http://drupal.org/project/drush. The lines below assume you have sudo access. If you don't, please check the Drush documentation to learn how to install Drush. The commands below have been tested successfully on Debian, Ubuntu, CentOS and should work for most *NIX systems.


sudo wget --quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-5.6.tar.gz | sudo tar -zxf - -C /usr/local/share
sudo ln -s /usr/local/share/drush/drush /usr/local/bin/drush
sudo drush

The last line is for Drush to auto download the required library. If it displays a list of drush command, it means drush was installed successfully!

Some machines might not have the right folders created, so either update the paths above to match your environment, or create them beforehand:

sudo mkdir /usr/local/share/
sudo mkdir /usr/local/bin/

Comments

Great quick tutorial, thanks!
The wget line doesn't paste well though, maybe remove the ?

thanks for pointing this out, I've fixed the input format, should work now.

Hi.

Maybe you could replace first four lines with this piped command:

sudo wget --quiet -O - http://ftp.drupal.org/files/projects/drush-All-Versions-HEAD.tar.gz | tar -zxf - -C /usr/local/share

Those who know something about *NIX will understand what is happening, and to those who are not so familiar you will spare typing four commands. ;)

Cheers.

Thanks @mariomaric, I've updated the original code with your suggestion. We're down to three command lines now!

For anyone who wants to install Drush on Hostmonster, use the instructions above but don't use 'sudo'. You can download the drush tar ball into a folder called /home/username/drush and after extracting it, then symlink to it using the command: ln -s /home/username/drush/drush /home/username/bin/drush

This works because any program that is symlinked to your /home/username/bin folder can run from any directory.

Anyway, I suppose this is basic but no one else on the web made it this clear so, here it is.

Add new comment