Quickstart
Goal: run one real acli command against the Cloud Platform from your terminal.
What you’ll have when you’re done
Section titled “What you’ll have when you’re done”acliinstalled as a standalone executable at~/.local/bin/acli, with nosudo.- A signed-in
aclisession stored incloud_api.confinside acli’s config directory (~/.acquia/if it exists, otherwise~/.config/acquia/). - One successful command (
acli api:applications:list) printing real JSON from your account.
Prerequisites
Section titled “Prerequisites”- 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
jsonandPharextensions enabled, for the Phar build.aclirefuses to start on anything older, withThis application requires a PHP version matching "^8.2"(the requirement is the same in acli 3.x and 4.x).php --versionchecks the version;php -mlists 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:
mkdir -p ~/.acquiadocker run --rm -it \ -v "$PWD":/app -w /app \ -v "$HOME/.acquia":/root/.acquia \ php:8.3-cli php acli.phar auth:loginRun 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.
-
Check for an existing
Section titled “Check for an existing acli”acliTerminal window command -v acli && acli --versionThen set the directory step 3 installs into. Usually that is
~/.local/bin:Terminal window dir=~/.local/binThe Atlassian CLI is also named
acli. If the check printed anything other thanAcquia 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 yourPATH:Terminal window dir=~/.local/acquia-cli/binAn 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. -
Download and verify
Section titled “Download and verify”Pick the release file for your machine. The native builds need no PHP:
Terminal window file=native-acli-macos-aarch64.tar.gzThat is the Apple silicon build. On an Intel Mac there is no native build: use
file=acli.phar, which needs PHP (see Prerequisites).Terminal window file=native-acli-linux-x86_64.tar.gzThat is the x86_64 build. On any other architecture, 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/SHA256SUMSTerminal window shasum -a 256 -c --ignore-missing SHA256SUMSTerminal window sha256sum -c --ignore-missing SHA256SUMSIt prints
<file>: OK, for examplenative-acli-macos-aarch64.tar.gz: OK.--ignore-missingskips the other filesSHA256SUMSlists, which you did not download. Anything other thanOKmeans the download is not the published file: delete it and download it again.no file was verifiedmeans the file name does not match the release’s, so nothing was checked.Do not install
acliwith Composer. Installing it as a Composer dependency can create dependency conflicts with your project; the release files above are the supported install. -
Install it into
Section titled “Install it into ~/.local/bin”~/.local/binPut it in
$dirfrom step 1, a directory in your home folder, so the install needs nosudo. For a native build (a.tar.gzholding one file,acli):Terminal window mkdir -p "$dir"tar -xzf "$file" -C "$dir" aclichmod +x "$dir/acli"For the Phar:
Terminal window mkdir -p "$dir"chmod +x acli.pharmv acli.phar "$dir/acli"With the Atlassian CLI on this machine, skip the
PATHchange below, and type~/.local/acquia-cli/bin/acliin place ofacliin the commands that follow. Otherwise, if~/.local/binis not in yourPATHyet (echo $PATHdoes not show it), add it at the front, then open a new terminal:Terminal window echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcTerminal window echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrcVerify the install from any directory:
acli --versionprints the installed version (plainaclialso lists every available command):Terminal window acli --versionAcquia CLI 4.3.2 -
Sign in with your Acquia ID
Section titled “Sign in with your Acquia ID”Terminal window acli auth:loginaclisigns 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:loginSign in to Acquia ID in your browser:https://id.acquia.com/activateThen 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,
acliopens 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 incloud_api.confin acli’s config directory, every futureaclicommand reads it from there, andaclirenews it while you work. The session ends after 90 minutes of inactivity, or 12 hours after you sign in, whichever comes first; then runacli auth:loginagain. 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 likeacli, and copy the API key and API secret it shows), then pass it toacliasACLI_KEYandACLI_SECRET: see non-interactive authentication.To store a token on this machine instead of signing in, run
acli auth:login --use-legacy-authand 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. -
Run your first real command
Section titled “Run your first real command”List the applications your account can access:
Terminal window acli api:applications:listA 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 anapplicationUuidargument accepts this value.name: the application’s display name (hereBrewtal).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 matchesname, but not always (as here), so when a command reportsNo 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 thisuuid.
What just happened
Section titled “What just happened”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.
When something goes wrong
Section titled “When something goes wrong”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.
Next steps
Section titled “Next steps”- Register an SSH key before you touch code:
acli ssh-key:create-uploadgenerates 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
acliends 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?
What went wrong?
Still stuck? Contact Acquia Support (opens in a new tab)