Information for: DEVELOPERS   PARTNERS   SUPPORT

About Drush on Cloud Platform

This page is for applications running Drupal 9. For information about Drush and Drupal 7, see Drush and Drupal 7 on Cloud Platform.

Drush is a command-line shell for Drupal, which you should require as part of your Composer-built Drupal website. With Drush, you can perform administrative and application maintenance tasks from the command line instead of Drupal’s administrative interface.

Using Drush on Cloud Platform

Although multiple versions of Drush (currently, Drush 6 to Drush 10) are available as global commands on Cloud Platform, Acquia recommends that you include Drush within your project. The Drush maintainers have made the decision that Drush should not be relied on as a global command since the versions required to support each new version of Drupal change frequently and it is imperative to use the version of Drush that is supported for your version of Drupal.

Installing Drush in your project

Note

Including Drush within your project is also a requirement for Remote Administration to work with Drush.

~/example_repo$ composer require drush/drush
~/example_repo$ ls -lha
[email protected] 11 user  staff   352B 28 Jan 11:04 .
[email protected] 31 user  staff   992B 17 Mar 12:23 ..
[email protected]  1 user  staff   3.2K 28 Jan 12:02 composer.json
[email protected]  1 user  staff   250K 28 Jan 12:17 composer.lock
[email protected] 21 user  staff   672B 28 Jan 12:16 docroot
drwxr-xr-[email protected] 39 user  staff   1.2K 28 Jan 12:17 vendor
~/example_repo/vendor$ ls -lha
[email protected] 39 user  staff   1.2K 28 Jan 12:17 .
[email protected] 11 user  staff   352B 28 Jan 11:04 ..
[...SNIP...]
[email protected]  3 user  staff    96B  5 Nov 13:36 drush
~/example_repo/vendor/bin$  ls -lha
[email protected]  9 user staff   288B  5 Nov 13:36 .
[email protected] 39 user staff   1.2K 28 Jan 12:17 ..
lrwxr-xr-x   1 user staff    20B  5 Nov 13:36 drush -> ../drush/drush/drush

Invoking Drush on Cloud Platform

Currently, Drush commands not specifying a version of Drush default to Drush 8.

You can use Drush with your applications after you enable SSH access to connect to Cloud Platform using SSH.

Drush versions and Drupal

  • Drush 8 is the fully supported Drush version for Drupal 8.5 and earlier. Drush 10 is the fully supported Drush version for Drupal 9+.

Specifying a version of Drush in commands

If you do not include Drush within your project, you can still choose to run one of the available versions provided by Acquia. To run a specific version of Drush, specify the major version after the drush command. For example, to run Drush 9, use the command drush9.

When you run Drush on your local machine and use a remote Drush alias for your Cloud Platform application (such as those described in Using Drush aliases), the remote Drush command runs the default version of Drush on Cloud Platform. Drush 8 and later attempt to determine if there is a project specific version of Drush included, and hand off the process to the project specific version. However, that handoff is not always clean and the platform default version may not be appropriate for the version of PHP or Drupal that you have installed.

Acquia recommends that you run Drush commands by specifying the application docroot location, replacing [application] with your application and [env] with your environment, as in the following example:

drush --root=/var/www/html/[application].[env]/docroot

Finding help for Drush

To access help for Drush online, go to Drush Documentation.