---
title: "Using Drush aliases"
date: "2024-02-14T06:18:38+00:00"
summary: "Simplify Drupal site management with Drush aliases. Learn how to download, use, and refresh aliases for remote command execution."
image:
type: "page"
url: "/acquia-cloud-platform/using-drush-aliases"
id: "6206d362-d148-4124-9e7a-cbbbbcd98afb"
---

Table of contents will be added

Note

*   If you work from [Cloud IDE](https://docs.acquia.com/acquia-cloud-platform/add-ons/ide) or have [Acquia CLI](https://docs.acquia.com/acquia-cli.html) installed locally, you might not need Drush aliases.
    
    Acquia CLI offers the following remote:drush command to abstract out having Drush and Drush aliases installed:
    
        $ acli remote:drush myapp.dev status -- --fields=drupal-version
    
*   The command returns the following output, where <version> refers to the version of your Drupal application.
    
        Drupal version : <version>
    
*   The [current Drupal version](https://docs.acquia.com/service-offerings/guide/software-life-cycle#supported-drupal-version) requires Drush version 11 or later. Newer versions of Drush, that is, version 11 and later, must be installed via Composer. Acquia does not manage the update to the newer versions. For more information, see [About Drush on Cloud Platform](https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush).

Cloud Platform defines [Drush](https://www.drupal.org/project/drush) aliases for all your application’s environments. For example, the application named (Cloud Platform username) _example_ has the following [Drush](https://www.drupal.org/project/drush) aliases for its Development, Staging, and Production environments:

*   example.dev
*   example.test
*   example.prod

Your environments may not all be on the same infrastructure, depending on your account and configuration. Using Drush’s remote command capability, you can use any of the aliases to access any of your applications from your local computer or any Cloud Platform infrastructure. The remote aliases work seamlessly if you have your SSH private key available on the source infrastructure. To use your SSH private key from Cloud Platform without having to copy the private key to the Cloud Platform infrastructure, use [SSH key forwarding](#drush-ssh-forwarding) by using the `-A` argument to SSH when connecting from your local computer.

For the following examples, the Staging environment is on infrastructure `staging-1``and your Production environment is on ``web-1`, `web-2`, and `web-3`.

Note

If you have more than one subscription using the same name, your Drush aliases will use the same namespace and overwrite each other.

Downloading Drush aliases
-------------------------

To download your Drush aliases:

1.  [Sign in to the Cloud Platform user interface](/node/55875).
2.  Click your user avatar in the upper-right corner, and click **Account Settings**.
    
    ![cloud-platform_account-settings-option.png](https://acquia.widen.net/content/2b48398e-5a05-4cb2-a924-a3906a8cc1b5/web/cloud-platform_account-settings-option.png?w=480&itok=QaHqvvcy)
    
3.  Click **Drush**.
4.  Based on whether you are using the Cloud Platform user interface or Acquia CLI, perform the steps in either of the following tabs:
    
    ### Cloud Platform user interface
    
    **For Drush 8**:
    
    1.  In **Drush integration**, click the link for downloading Drush 8 aliases in the PHP format.
    2.  Extract the downloaded archive file into `$HOME`:
        
            $ tar -C $HOME -xf $HOME/Downloads/cloud-platform.drush-8-aliases.tar.gz
        
    
    **For Drush 9 and later**:
    
    1.  In **Drush integration**, click the link for downloading Drush 9 and later aliases in the YAML format. 
        
        Note
        
        To download Drush aliases that you want to install in [Cloud IDE](https://docs.acquia.com/acquia-cloud-platform/add-ons/ide), drag and drop the archive file to the **Explorer** tab, and extract the file.
        
    2.  Follow the instructions in the README file.
    
    ### Acquia CLI
    
    Run the following command:
    
        acli remote:aliases:download
    
    For more information, see [Acquia CLI commands](../../../../acquia-cli/commands.html).
    

Use the aliases on your local command line as though you’re signed in to your Cloud Platform infrastructure to view the Drush status. For example:

    drush @example.test status

Note

*   Microsoft Windows users may need to edit their `$PATH` variable to use Drush. You can resolve the issue by [editing the path manually](http://betanews.com/2015/11/23/windows-10-finally-adds-a-new-path-editor/).
*   Don’t add files from your `.drush` aliases directory to your Cloud Platform infrastructure’s home directory. The Drush alias files include a `remote-host` setting that enables them to function from your local computer, but which can prevent SSH connections if it’s present on your Cloud Platform infrastructure.

Example: Viewing site status with Drush
---------------------------------------

To view the status of your application on the production environment from your local computer using Drush, enter the following command:

    drush @example.prod status

Note

Depending on the age of your subscription, there are two available formats for `remote-host`. Ensure you examine your alias file to check whether one of the following correct formats is in use, when needed:

*   `[subscriptionname][env].ssh.prod.acquia-sites.com`
*   `serverrname-nnnn.prod.hosting.acquia.com`

### Viewing site status using Drush and SSH forwarding

By signing in to a Cloud Platform infrastructure with SSH forwarding, you can access all your environments without copying your private key to Cloud Platform. To log in to the staging environment with SSH forwarding, run the following command:

    ssh -A example.test@staging-1.prod.hosting.acquia.com

To view the Drush status for your production website while you’re signed in to the infrastructure for your staging environment, enter the following command, replacing infrastructure names as appropriate:

    drush @example.prod status

Refreshing Drush aliases
------------------------

From time to time, your Drush aliases may change if your infrastructure (and hostname of your Cloud Platform) was changed. For example, your Drush aliases may change if you relaunch or resize your infrastructure. The aliases may also change if you upgrade your subscription from Cloud Platform Professional to Cloud Platform Enterprise.

You can refresh your Drush aliases by [downloading them](#download-drush-aliases) again, and pasting the new version in place of the old one. As an alternative, you can use the following Drush command:

    drush acquia-update

Related topics
--------------

*   [Getting started with SSH](/acquia-cloud-platform/manage-apps/command-line/ssh/getting-started)
*   [About Drush on Cloud Platform](/acquia-cloud-platform/manage-apps/command-line/drush)