- 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 you Composer project doesn't yet depend on Drush, run
composer require drush/drush
to add it. - To run Drush, navigate to your Drupal root and call
../vendor/bin/drush
. - If you want the convenience of calling
drush
instead of../vendor/bin/drush
, copy the examples/drush.wrapper file to your Drupal root and modify to taste. - If you want the old convenience of being able to call
drush
from anywhere, see drush-shim. - See Usage for details on using Drush.
- MAMP users, and anyone wishing to use a non-default PHP, needs to edit ~/.bashrc so that the right PHP is in your $PATH.
# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush
# Or use our upcoming release: php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush-unstable.phar');" > drush
# Test your install.
php drush core-status
# Make `drush` executable as a command from anywhere. Destination can be anywhere on $PATH.
chmod +x drush
sudo mv drush /usr/local/bin
# Optional. Enrich the bash startup file with completion and aliases.
drush init
Drush Version | Drush Branch | PHP | Compatible Drupal versions | Code Status |
---|---|---|---|---|
Drush 9 | master | 5.6+ | D8 | |
Drush 8 | 8.x | 5.4.5+ | D6, D7, D8 | |
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 |