Skip to content

Goal: run one real acli command against the Cloud Platform from your terminal.

  • acli installed as a standalone executable at ~/.local/bin/acli, with no sudo.
  • A signed-in acli session stored in cloud_api.conf inside acli’s config directory (~/.acquia/ if it exists, otherwise ~/.config/acquia/).
  • One successful command (acli api:applications:list) printing real JSON from your account.
  • An Acquia ID with access to a Cloud Platform application, or a free trial
  • curl (preinstalled on macOS and Linux)
  • On an Apple silicon Mac or Linux x86_64: nothing else. The native build needs no PHP.
  • On any other machine (an Intel Mac, Linux on arm64): PHP 8.2 or later with the json and Phar extensions enabled, for the Phar build. acli refuses to start on anything older, with This application requires a PHP version matching "^8.2" (the requirement is the same in acli 3.x and 4.x). php --version checks the version; php -m lists enabled extensions and should include both. Both extensions ship enabled in standard PHP builds.
No PHP on this machine?

If your machine has no native build and php --version answers command not found: php, Docker can supply the runtime, and the official php image already has json and Phar enabled. Step 2 below still applies, with the Phar as the file. Step 3 does not, because the Phar stays in the directory you mount instead of moving into your PATH.

Mounting ~/.acquia as well puts the session acli auth:login writes on your machine, where a system PHP would have put it, rather than inside a container that --rm throws away. Inside a container acli cannot open your browser, so it prints the sign-in URL and code for you to open on your machine:

Terminal window
mkdir -p ~/.acquia
docker run --rm -it \
-v "$PWD":/app -w /app \
-v "$HOME/.acquia":/root/.acquia \
php:8.3-cli php acli.phar auth:login

Run it from a directory under your home directory: that path is shared with containers by every runtime’s default configuration. A $PWD outside the shared paths (easy to hit on Colima) mounts as an empty directory, and the only symptom is Could not open input file: acli.phar.

Every command on this page then runs the same way: keep the docker run prefix and swap auth:login for the command you want. php acli.phar --version prints Acquia CLI 4.3.2 from inside the container, the same build a system PHP runs.

A DDEV project’s web container carries PHP as well, so ddev exec php acli.phar api:applications:list runs the Phar from the project directory. Authentication is the exception: acli auth:login writes into that container’s home directory, which ddev restart rebuilds, so you have to sign in again after every restart. The docker run form above keeps the session in ~/.acquia on your machine instead.

For PHP on the machine itself, the php.net install docs cover every platform.

  1. Terminal window
    command -v acli && acli --version

    Then set the directory step 3 installs into. Usually that is ~/.local/bin:

    Terminal window
    dir=~/.local/bin

    The Atlassian CLI is also named acli. If the check printed anything other than Acquia CLI, do not overwrite or shadow it. Install Acquia CLI into its own directory instead, and run it by its full path (~/.local/acquia-cli/bin/acli) rather than adding that directory to your PATH:

    Terminal window
    dir=~/.local/acquia-cli/bin

    An older Acquia CLI, for example one at /usr/local/bin/acli, can stay where it is: step 3 puts the new one ahead of it.

  2. Pick the release file for your machine. The native builds need no PHP:

    Terminal window
    file=native-acli-macos-aarch64.tar.gz

    That is the Apple silicon build. On an Intel Mac there is no native build: use file=acli.phar, which needs PHP (see Prerequisites).

    Download it, plus the release’s SHA256SUMS, the checksum of every file it ships, and check that your file is the one the release published:

    Terminal window
    curl -fsSLO "https://github.com/acquia/cli/releases/latest/download/$file"
    curl -fsSLO https://github.com/acquia/cli/releases/latest/download/SHA256SUMS
    Terminal window
    shasum -a 256 -c --ignore-missing SHA256SUMS

    It prints <file>: OK, for example native-acli-macos-aarch64.tar.gz: OK. --ignore-missing skips the other files SHA256SUMS lists, which you did not download. Anything other than OK means the download is not the published file: delete it and download it again. no file was verified means the file name does not match the release’s, so nothing was checked.

    Do not install acli with Composer. Installing it as a Composer dependency can create dependency conflicts with your project; the release files above are the supported install.

  3. Put it in $dir from step 1, a directory in your home folder, so the install needs no sudo. For a native build (a .tar.gz holding one file, acli):

    Terminal window
    mkdir -p "$dir"
    tar -xzf "$file" -C "$dir" acli
    chmod +x "$dir/acli"

    For the Phar:

    Terminal window
    mkdir -p "$dir"
    chmod +x acli.phar
    mv acli.phar "$dir/acli"

    With the Atlassian CLI on this machine, skip the PATH change below, and type ~/.local/acquia-cli/bin/acli in place of acli in the commands that follow. Otherwise, if ~/.local/bin is not in your PATH yet (echo $PATH does not show it), add it at the front, then open a new terminal:

    Terminal window
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

    Verify the install from any directory: acli --version prints the installed version (plain acli also lists every available command):

    Terminal window
    acli --version
    Acquia CLI 4.3.2
  4. Terminal window
    acli auth:login

    acli signs you in with device code sign-in: it prints a URL and a short code, and waits while you approve the sign-in in a browser:

    acli auth:login session
    acli auth:login
    Sign in to Acquia ID in your browser:
    https://id.acquia.com/activate
    Then enter this code when prompted:
    <CODE>
    [INFO] Opening https://id.acquia.com/activate?user_code=<CODE>
    Confirm the code above matches what appears in your browser before approving.
    Waiting for authorization... (code expires in 10 minutes)
    ✓ Authenticated successfully.

    On a desktop, acli opens the URL for you with the code filled in. Over SSH or in a container nothing opens: open the URL in a browser on any device and type the code. In the browser, check that the code on the page matches the one in your terminal, then sign in with your Acquia ID (by email or Google; your organization’s single sign-on and multi-factor rules apply as they do anywhere else). The page says Device activated when it is done. For the browser side step by step, see Getting started with Acquia CLI on docs.acquia.com.

    ✓ Authenticated successfully. is the whole outcome: the session is stored in cloud_api.conf in acli’s config directory, every future acli command reads it from there, and acli renews it while you work. The session ends after 90 minutes of inactivity, or 12 hours after you sign in, whichever comes first; then run acli auth:login again. An API token (below) has no such limit.

    Signing in for a script or CI job?

    Device code sign-in needs a person at a browser, so automation uses a Cloud Platform API token instead. Create one at cloud.acquia.com/a/profile/tokens (select Create Token, give it a label like acli, and copy the API key and API secret it shows), then pass it to acli as ACLI_KEY and ACLI_SECRET: see non-interactive authentication.

    To store a token on this machine instead of signing in, run acli auth:login --use-legacy-auth and paste the key and secret at the prompts. This API token is not the site API client from the auth quickstart: they are separate credential systems, and pasting a client ID/secret here fails.

  5. List the applications your account can access:

    Terminal window
    acli api:applications:list

    A successful response is a JSON array with one entry per application (one real entry shown here):

    [
    {
    "id": 990066,
    "uuid": "04f18e5e-3e19-4698-ac58-c162df025345",
    "name": "Brewtal",
    "hosting": {
    "type": "ace",
    "id": "prod:eeschandan1"
    },
    "subscription": {
    "uuid": "840f74b5-bf16-4e70-baf1-49c40bbaed35",
    "name": "Brewtal"
    },
    "organization": {
    "uuid": "870bd8d4-e53a-41a8-ab05-1057fd43a5c7",
    "name": "Brewtal Org"
    },
    "flags": {
    "remote_admin": false
    },
    "status": "normal",
    "type": "drupal",
    "_links": {
    "self": {
    "href": "https://cloud.acquia.com/api/applications/04f18e5e-3e19-4698-ac58-c162df025345"
    },
    "parent": {
    "href": "https://cloud.acquia.com/api/applications"
    }
    },
    "_embedded": {
    "tags": []
    }
    }
    ]

    What to look at:

    • uuid: the application’s unique ID. Any command that takes an applicationUuid argument accepts this value.
    • name: the application’s display name (here Brewtal).
    • hosting.id: the hosting realm and sitegroup (prod:eeschandan1). The sitegroup portion (eeschandan1) is the application alias that commands accept as shorthand for the UUID; combined with an environment name it identifies an environment (eeschandan1.dev). The alias often matches name, but not always (as here), so when a command reports No applications match the alias, reach for the UUID or the sitegroup.
    • subscription: the subscription this application belongs to.
    • _links, _embedded: hypermedia the Cloud Platform API attaches to every resource; acli api:* passes the response through untouched.

    These field names aren’t invented for the CLI: acli api:* commands call the Cloud Platform API directly, so what you see here is the API’s own response, field names included. The glossary uses these names too: application UUID is this uuid.

You installed a single self-contained executable (no Composer, no project dependency), signed in once with your Acquia ID to get a session stored in cloud_api.conf, and made an authenticated call to the Cloud Platform API through its CLI mirror. Everything else acli does (tailing logs, pulling databases, deploying artifacts) uses this same stored session.

command not found: acli

~/.local/bin isn’t in your PATH. Confirm the install succeeded with ls -l ~/.local/bin/acli, then add ~/.local/bin to your PATH as in step 3 and open a new terminal. Do not move acli into a system directory with sudo instead.

PHP Fatal error: Uncaught Error: Class "Phar" not found

the PHP-PHAR extension is disabled. Enable the phar extension in your php.ini, then run acli again. acli also warns you at startup if any other runtime requirement is missing; follow the instructions in those messages.

Your requirements could not be resolved to an installable set of packages. after composer require acquia/cli

installing acli via Composer carries a documented risk of dependency conflicts with your application. Remove the Composer install (composer remove acquia/cli) and install from steps 1 to 3 instead.

Device code sign-in is not configured; falling back to API key authentication.

you are running acli 4.3.0, which falls back to asking for an API key. Releases before 4.3.0 ask for one without this line. Either way, download and install again (steps 2 and 3) to get the latest release, and check that acli --version prints Acquia CLI 4.3.1 or later.

cURL error 60: SSL certificate problem: unable to get local issuer certificate

(from curl while downloading, or from acli): a network proxy that inspects HTTPS, such as Zscaler, sits between you and Acquia, and the program does not trust that proxy’s certificate. Ask your network administrator to allow github.com, release-assets.githubusercontent.com (where the release downloads redirect), id.acquia.com, and cloud.acquia.com without inspection (add accounts.acquia.com if you sign in with an API key using --use-legacy-auth), or try from a network without the proxy. In a container, the image does not have your machine’s trust settings, so this can fail there even when your machine works.

Code expired. Run acli login again. or Timed out waiting for authorization.

the code was not approved before it expired. Run acli auth:login again for a new code, and approve it in the browser before the time the waiting line shows.

Authorization denied.

the sign-in was declined in the browser. Run acli auth:login again and approve it.

The browser shows “Device not activated”, or acli prints Sign-in failed: an Acquia ID may already exist for this email address.

you chose to sign in with Google, and that email address already has an Acquia ID with a password. The code is used up. Run acli auth:login again and sign in with your email address and password. For the other Google sign-in errors, see the Google authentication FAQ on docs.acquia.com.

An error when you submit “Complete sign up” in the browser

your email domain signs in through your company’s single sign-on. Run acli auth:login again and sign in through your company.

Your Cloud Platform API credentials are invalid. (or a 403) after login

on the API key path, the key or secret was mistyped, or the token was revoked. Generate a fresh token at cloud.acquia.com/a/profile/tokens and run acli auth:login --use-legacy-auth again; the new credentials replace the old ones in cloud_api.conf.

  • Register an SSH key before you touch code: acli ssh-key:create-upload generates one if you don’t have it and registers it with Acquia in a single command. Cloning an application’s repository and pushing to it both need one, so this is the step between an authenticated CLI and working with code.
  • Set up local development: run the site on your machine in containers, with a Cloud Platform environment’s database and files.
  • Everyday CLI workflows: the daily jobs: tail logs, pull databases, run Drush remotely, deploy artifacts.
  • acli command reference: every command, flag, and configuration option.
  • Which CLI do I use?: where acli ends and Pipelines CLI, drush, and the other tools begin.

A machine-readable index of Acquia's developer documentation for AI agents is at /llms.txt (https://dev.acquia.com/llms.txt on the production site).

Was this page helpful?