Acquia Cloud defines Drush aliases for all of your site's environments. For example, the site name (Acquia Cloud username) mysite has the following Drush aliases:
Your Dev, Stage, and Prod environments might not all be on the same server, depending on your account and configuration. Using Drush's remote command capability, you can use any of the aliases to access any of your websites from your local computer or any Acquia Cloud server. The remote aliases work seamlessly if you have your SSH private key available on the source server. To use your SSH private key from Acquia Cloud without having to copy the private key to the Acquia Cloud server, use SSH key forwarding by using the
-A argument to SSH when connecting from your local computer.
For the following examples, your staging environment is on server
staging-1 and your production website is on
Downloading Drush aliases
To download your Drush aliases, just click here and look under Drush integration.
Or, to navigate your way there:
- Sign in to the Acquia Cloud, using your email address and password.
- Click your name in the upper left corner, and then click View profile.
- On the Profile page, click Credentials.
Under Drush integration, click Download Drush aliases.
Extract the downloaded archive file into
tar -C $HOME -xf $HOME/Downloads/mysite.tar.gz
Use the aliases on your local command line as though you were signed in to your Acquia Cloud server to view the Drush status. For example:
drush @mysite.test status
Example: Viewing site status with Drush
To view the status of your production website from your local computer using Drush, enter the following command:
drush @mysite.prod status
Viewing site status using Drush and SSH forwarding
By signing in to an Acquia Cloud server with SSH forwarding, you can access all of your environments without copying your private key to Acquia Cloud. To view the Drush status for your production website while being signed in to your staging server, enter the following commands:
ssh -A firstname.lastname@example.org
drush @mysite.prod status
Refreshing Drush aliases
From time to time, your Drush aliases may change. This can happen when your server infrastructure (and therefore the hostname of your Acquia Cloud) changes. This can happen if your server instance is resized or relaunched, for example, or if you upgrade your subscription from Acquia Cloud Free to Acquia Cloud Professional, or from Acquia Cloud Professional to Acquia Cloud Enterprise.
You can refresh your Drush aliases by downloading them again, and pasting the new version over the old one. As an alternative, you can use this Drush command: