Last updated 7 July 2017. Created on 21 September 2012.
Edited by arnoldbird, saurabh.dhariwal, vgriffin, ckosloff. Log in to edit this page.

For more details about drush project, please see the Drush project page.

If you are using Windows, Git must be installed and the Git\bin directory must be in the path. Otherwise, you will not be able to run the command files. Please see Getting started with Git (for Drupal) on Windows for details.

The recommended installation instructions can be found here:
Abbreviated instructions for Unix-based (i.e. non-Windows) systems:
First install Composer globally.

$ cd [To what directory, typically?  Instructions need an edit here to tell people where in their file system to perform the following commands...]
$ curl -sS | php
$ mv composer.phar /usr/local/bin/composer
$ export PATH="$HOME/.composer/vendor/bin:$PATH"
$ source ~/.bash_profile

These instructions do not apply to Linux systems, which do not have a .bash_profile.
If you use Linux, use .bashrc instead, do not create an empty .bash_profile, this will get you rid of the error: "No such file or directory found", but will not help with install.
So, for Linux, stop after the second line, and append the third to the end of your .bashrc, which is in your home directory, you can do this is as your user, whereas the previous instructions need to be run with elevated privileges, because /usr/local/bin is a system directory.
Reboot and then you can continue installing drush.

Now that you have Composer working, you can install Drush 7 from the latest HEAD.

$ composer global require drush/drush:dev-master

To update Drush:

composer global update

Specific instructions for other ways to install Drush on specific environments appears below.

Looking for support? Visit the forums, or join #drupal-support in IRC.


nerdcore’s picture

According to drush-ops/drush on GitHub, the Pear installation method has been replaced(?) by Composer:

Is this recommended among others in the Drupal community? Should we update the docs here to reflect the composer installation method rather than pear?

I'm happy to edit the page but would like some thoughts on this first.

ckosloff’s picture

The pear method will install the stable version, whereas instructions above install dev.


abhai_zyxware’s picture

Installing via composer is still possible and quite simpler. I have written a detailed article here about it :

johnhanley’s picture

Here's instructions to install Composer on Ubuntu 14.04.

Don't forget to change permissions to enable caching:

sudo chown -R $USER $HOME/.composer
srikanth.g’s picture

using composer i updated drush to 8.1.2(from 7.3) on windows ,it working with Drupal 6 ,7 and 8 perfectly and need to figure out the difference between Drupal Console and Drush.