Information for: DEVELOPERS   PARTNERS

Managing applications using the command line

Secure Shell (SSH) is a secure network protocol you can use to sign in to your Acquia Cloud environments and use command-line tools.

SSH address

To sign into an environment with SSH, you need its SSH address. You can find the SSH address for an environment in the Acquia Cloud interface, on the Servers page of the environment, at the top of the list.

Finding the SSH address on the Servers page

The SSH address is in the form [application name].[environment name]@[server address], where:

  • [application name] is the name of your application.
  • [environment name] is the environment name (frequently one of dev, test, or prod). When you specify an environment, your PATH and other environment variables are configured the same way as they are for web processes, cron jobs, and Cloud hooks. In particular, whichever version of PHP you have configured appears first in the PATH, and is the default in your SSH session.
  • The [server address] is the URL of the web server, displayed in the Acquia Cloud interface, on the Servers page of an environment.

For more information about the application name, see the Sitename definition page.

Tasks you can perform from the command line

After you enable SSH access in Acquia Cloud, you can use SSH in the Acquia Cloud environment to perform the following tasks:

Access your file storage directories from the command line

You have shell access to all web nodes running your application, using the same username and SSH public key credentials you use for rsync, Secure Copy (SCP), or Secure File Transfer Protocol (SFTP) on Acquia Cloud. To access your file storage directories, use a command like:

ssh [SSH address]

For example, this command accesses the Staging environment of an application named example on the server with the address srv-456.devcloud.hosting.acquia.com:

Import and export databases

Acquia Cloud has unique database requirements to provide the best possible Drupal application performance. With SSH access enabled, you can use the Acquia Cloud database import script. For more information, see Importing your database.

Use the Drush command-line tool

Acquia Cloud applications with SSH access have an installed and configured instance of Drush for performing administrative and application maintenance tasks from the command line instead of using the Drupal administrative interface. For more information, see About Drush on Acquia Cloud.

Limitations on shell access

Because of the technical requirements necessary for maintaining a highly available and redundant hosting platform, you have limits on what you can access and do using shell access on Acquia Cloud:

  • Limited file access – You must store files in the persistent network filesystem directory at /mnt/files/[application name].[environment name].
  • No root access – You do not have root access, even if your application runs on dedicated cloud instances.
  • Write access to your Drupal docroot – Use Git to manage your code on Acquia Cloud. By default, you cannot use shell access to install or update modules or to make other changes to your Drupal docroot directory (/var/www/html). If you want to make changes to your Drupal docroot directory, enable Live Development on a non-production environment. Live Development is not available for production environments.
  • Session timeout – Your SSH session will time out (expire) after 15 minutes of idle time.