Note

Drush 9 (coming soon!) 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

  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 run Drush, navigate to project root or Drupal root and call like so: ../vendor/bin/drush.
  3. If you want the convenience of being able to call drush from anywhere, install the drush-shim. Thats a small launcher program that locates your Composer project and hands control to its Drush.
  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 thats not desireable, you can change your PATH for just one request: PATH=/path/to/php:$PATH drush status ...`

Drupal Compatibility

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