Install/Upgrade a global Drush

# Browse to and download the drush.phar attached to the latest 8.x release.

# Test your install.
php drush.phar core-status

# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. 
chmod +x drush.phar
sudo mv drush.phar /usr/local/bin/drush

# Optional. Enrich the bash startup file with completion and aliases.
drush init

Install a site-local Drush

In addition to the global Drush, it is recommended that Drupal 8 sites be built using Composer, with Drush listed as a dependency.

  1. When you run drush, the global Drush is called first and then hands execution to the site-local Drush. This gives you the convenience of running drush without specifying the full path to the executable, without sacrificing the safety provided by a site-local Drush.
  2. Optional: Copy the examples/drush.wrapper file to your project root and modify to taste. This is a handy launcher script; add --local here to turn off all global configuration locations, and maintain consistency over configuration/aliases/commandfiles for your team.
  3. Note that if you have multiple Drupal sites on your system, it is possible to use a different version of Drush with each one.

Drupal Compatibility

!!! note

Drush 9 only supports one install method. It requires that your Drupal 8 site be built with Composer and Drush be listed as a dependency.

See the [Drush 8 docs]( for installing prior versions of Drush.

Install a site-local Drush and Drush Launcher.

  1. It is recommended that Drupal 8 sites be built using Composer, with Drush listed as a dependency. That project already includes Drush in its composer.json. If your Composer project doesn't yet depend on Drush, run composer require drush/drush to add it.
  2. To be able to call drush from anywhere, install the Drush Launcher. That is a small program which listens on your $PATH and hands control to a site-local Drush that is in the /vendor directory of your Composer project. If you skip this step, run Drush from Drupal root via ../vendor/bin/drush. In that case Drush's bash integration and custom prompt won't work.
  3. Run drush init. This edits ~/.bashrc so that Drush's custom prompt and bash integration are active.
  4. See Usage for details on using Drush.
  5. To use a non-default PHP, edit ~/.bashrc so that the desired PHP is in front of your $PATH. If that is not desirable, you can change your PATH for just one request: PATH=/path/to/php:$PATH drush status ...`

!!! note

Drush 9 cannot run commandfiles from Drush 8 and below (e.g. See our [guide on porting commandfiles]( Also note that alias and config files use a new .yml format in Drush 9.

Drupal Compatibility

Drush Version Drush Branch PHP Compatible Drupal versions Code Style Isolation Tests Functional Tests
Drush 9 master 5.6+ D8.4+
Drush 8 8.x 5.4.5+ D6, D7, D8.3- -
Drush 7 7.x 5.3.0+ D6, D7 Unsupported
Drush 6 6.x 5.3.0+ D6, D7 Unsupported
Drush 5 5.x 5.2.0+ D6, D7 Unsupported