Overview
This page provides instructions on how to install Drush for a Drupal 7 environment hosted on Cloud Platform.
Because Drupal 7 is a legacy system, modern versions of Drush are no longer compatible with it. Drush 8 is the latest and only supported version for Drupal 7. Drush 9 and later version no longer support Drupal 7.
Important Alert: Ubuntu 24.04 (Noble Numbat) OS Upgrade
Historically, Cloud Platform provided a pre-installed, global fallback version of Drush. This change occurs with the self-service operating system upgrade to Ubuntu 24.04. An operating system upgrade to Ubuntu 24.04 on Acquia environments removes the pre-installed global Drush fallback. An upgrade to the operating system without Drush in the codebase causes the drush command to fail, which breaks cron jobs and deployment scripts that depend on the command.
Solution: Project-Specific Installation through Composer
To ensure that the Drupal 7 site continues to function on Ubuntu 24.04, you must transition to a Composer-based installation method. This method places Drush 8 directly into the project codebase. Cloud Platform utilizes a Drush launcher. After Drush is in the project vendor directory, execution of the standard drush command detects and triggers the site-local Drush from ./vendor/bin/drush. Scripts and cron jobs do not require updated command paths.
Step-by-Step Installation
Navigate to the project root directory in the local terminal.
Run the following Composer command to require Drush 8 as a dependency when you are above the docroot:
composer require drush/drush:^8.0Run the newly created vendor binary to ensure that Drush works:
./vendor/bin/drush statusCommit the updates to the composer.json and composer.lock files, and add the new additions to the vendor directory if the repository tracks the vendor folder.
Push the changes to Acquia Cloud environments.
After the code deploys, log in to the Acquia environment through SSH.
Use the standard drush command:
drush statusCloud platform detects and routes this command to the project ./vendor/bin/drush command.