Install
Tip
Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.
See the Drush 8 or Drush 9 docs for installing prior versions of Drush.
- Composer. It is required that Drupal sites be built using Composer, with Drush listed as a dependency. See recommended-project (Drush must be added). If your Composer project doesn't yet depend on Drush, run
composer require drush/drushto add it. - Execution. Change your working directory to your project root, and call Drush via
vendor/bin/drush. To make this easier, append./vendor/binto the end of your$PATH; this allows you to call Drush viadrushonce your working directory is set. If you only have only one Drupal codebase on your system, you may put/path/to/vendor/bin/drushin your$PATH; if you do this, then it is not necessary to set your working directory before calling Drush. - Completion. Optional. Append to .bashrc or equivalent for ZSH or Fish shell. Run
drush completion --helpfor more details. - Multiple Codebases. Optional. If using the bash shell, consider installing the fd project, a small set of scripts that make it easier to switch between different project directories quickly, with type completion.
Note
- See Usage for details on using Drush.
- 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:$PATHdrush status ...` - To use a custom php.ini for Drush requests, see this comment.
- See our guide on porting commandfiles from Drush 8 to later versions. Also note that alias and config files use a new .yml format in Drush 10+.
Drupal Compatibility¶
| Drush Version | PHP Version | End Of Life | Drupal versions | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|
| Drush 12 | 8.1+ | TBD | ✅ | |||
| Drush 11 | 7.4+ | Nov 2023 | ✅ | ✓ | ||
| Drush 10 | 7.1+ (not 8) | Jan 2022 | ✓ | ✓ | ||
| Drush 9 | 5.6+ | May 2020 | ✓ | |||
| Drush 8 | 5.4.5+ | Jan 2025 | ✅ | ✓️ | ||
| Drush 7 | 5.3.0+ | Jul 2017 | ✓ | |||
| Drush 6 | 5.3.0+ | Dec 2015 | ✓ | |||
| Drush 5 | 5.2.0+ | May 2015 | ✓ | |||
| Legend | |
|---|---|
| ✅ | Supported and recommended |
| ✓ | Compatible but no longer supported |
Last update:
June 6, 2023
Authors: