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 https://getcomposer.org/installer | 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.

Comments

nerdcore’s picture

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

https://github.com/drush-ops/drush#installupdate---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.

ckosloff

Anonymous’s picture

Installing via composer is still possible and quite simpler. I have written a detailed article here about it : http://www.zyxware.com/articles/4497/drupal-installing-latest-version-of...

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 from 7.3 to 8.1.2 on windows ,it working with Drupal 7 and 8 perfectly and need to figure out the role of Drupal Console.

mskicker’s picture

Drupal version : 7.59
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port :
Database username : nrec_nrec
Database name : nrec_d7
PHP configuration : /usr/local/lib/php.ini /etc/drush/drush.ini
PHP OS : Linux
Drush script : /usr/local/bin/drush
Drush version : 8.1.17
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /home/x/domains/x.x/public_html
Drupal Settings File : sites/default/settings.php
Site path : sites/default

i remove function limit in /etc/drush/drush.ini
but my drush still have error for php.ini restriction
how can i run drush without security issue ?
i have custombulid2 and DA