---
title: "Acquia CLI installation"
date: "2024-02-14T06:18:38+00:00"
summary: "Install Acquia CLI easily with step-by-step instructions for macOS, Linux, and Windows. Supports PHP 8.0+ and Cloud Platform integration."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/acquia-cli/acquia-cli-installation"
id: "4ffed29c-4663-404e-815b-521d56482628"
---

Table of contents will be added

Requirements
------------

Acquia CLI requires PHP 8.0 or later, with the [PHP-JSON](https://www.php.net/manual/en/book.json.php) and [PHP-PHAR](https://www.php.net/manual/en/book.phar.php) extensions enabled. If you use PHP 7.4, follow the instructions to [download earlier releases](#acli-previous-releases).

Commands that require a [Cloud Platform account](https://cloud.acquia.com/) prompt you to link your account, if necessary. For more information, see [Authenticating with Cloud Platform API](/acquia-cloud-platform/add-ons/acquia-cli/start#acquiacli-auth-login).

Installing Acquia CLI
---------------------

Note

Acquia CLI is distributed as a [standalone Phar archive](https://www.php.net/manual/en/phar.using.intro.php). Do not install Acquia CLI using Composer, as it might create dependency conflicts.

After you install Acquia CLI, proceed to [Getting started with Acquia CLI](/acquia-cloud-platform/add-ons/acquia-cli/start).

### MACOS AND LINUX

Open Terminal and type the following commands to automatically install Acquia CLI. Remember to press **Enter** to execute each command.

1.  Download Acquia CLI:
    
        curl -OL https://github.com/acquia/cli/releases/latest/download/acli.phar
    
2.  Make the file executable:
    
        chmod +x acli.phar
    
3.  Rename the file and move it to a location that is globally accessible. This step allows you to type `acli` from anywhere on your system. If the following command fails, prefix it with `sudo`. When the system prompts for a password, enter your password.
    
        mv acli.phar /usr/local/bin/acli
    
4.  Run `acli` from anywhere on your system to view the installed version of Acquia CLI and a list of commands. If you see the `Class 'Phar' not found` error, ensure that the PHP-PHAR extension is enabled.

Acquia CLI warns you if any other runtime requirements are not met. Follow the instructions provided by the error messages.

### WINDOWS (POWERSHELL, CMD, AND GIT BASH)

Acquia CLI does not require the Windows Subsystem for Linux (WSL). It runs natively in any environment that has the required version of PHP and the extensions.

1.  Download the latest `acli.phar` file from the [releases](https://github.com/acquia/cli/releases) page and place it in the directory where you want to run Acquia CLI.
2.  Open Terminal and run `php acli.phar`.
    
    You can view the installed version of Acquia CLI and a list of commands. If you encounter an SSL certificate issue, review this [known issue](https://known-issues.html/#acquia-cli-windows-curl-cert).
    
    In CMD and Powershell, Phar files including Acquia CLI must be run using the PHP CLI interpreter in the directory where the Phar is installed. To run Acquia CLI as an executable from another directory, [create a batch script](https://stackoverflow.com/questions/22297546/how-to-run-phar-from-anywhere-on-windows). See the following example:
    
        @ECHO OFF 
        php %~dp0acli.phar %*
    

### DOCKERFILE

Acquia CLI is best installed through a Phar file. The following is an advanced process, so you must use it only when you cannot install Acquia CLI natively or when you create a custom Docker image on top of it. For more information about Docker, see [https://docs.docker.com/](https://docs.docker.com/). For all commands that need to invoke the [Cloud Platform API](/acquia-cloud-platform/developing-cloud-platform-api "Developing with the Cloud Platform API"), you must prefix them with your API token and secret as environment variables.

1.  Clone the Acquia CLI Git repository and navigate into it:
    
        git clone git@github.com:acquia/cli.git 
        cd cli
    
2.  Build the Docker image:
    
        docker build -t acli .
    
    To run Acquia CLI commands, do one of the following:
    
    *   Create a container that gets destroyed immediately after you run a command:
        
            docker run -e ACLI_KEY=<key> \ 
                       -e ACLI_SECRET=<secret> \ 
                       -it acli \ 
                       php /usr/local/bin/acli -n <command>
        
    *   Run the commands interactively:
        
            docker run -it acli sh 
            / # ACLI_KEY=<key> ACLI_SECRET=<secret> acli -n <command1> 
            / # ACLI_KEY=<key> ACLI_SECRET=<secret> acli -n <command2>
        

### NATIVE BINARIES

You can install Acquia CLI through this method for the following operating systems:

*   Linux (x86-64)  
    
*   MacOS (aarch64)
    

Currently, this method is experimental and do not support some features of the Phar releases, including self-updates.

1.  Download the native binary that matches your operating system architecture:
    
        curl -OL https://github.com/acquia/cli/releases/latest/download/native-acli-linux-x86_64.zip
    
        curl -OL https://github.com/acquia/cli/releases/latest/download/native-acli-macos-aarch64.zip
    
2.  Unzip the binary: 
    
        unzip native-acli-*.zip
    
3.  Rename the file and move it to a location that is globally accessible: 
    
        mv acli /usr/local/bin/acli
    
4.  To confirm that the binary is executable and installed correctly, run the following command:
    
        acli --version t
    

After installing Acquia CLI, proceed to [Getting started with Acquia CLI](https://docs.acquia.com/acquia-cloud-platform/add-ons/acquia-cli/start).

Installing unstable releases
----------------------------

To enable a larger audience to test new features, Acquia sometimes publishes unstable releases, such as alpha or beta.

Important

Preview releases may contain critical bugs. Use them at your own risk.

To allow Acquia CLI to download unstable releases, run the following command:

    $ acli self-update --preview
    Downloading Acquia CLI (acquia/cli) 1.30.0-beta1
    Download finished
    Successfully updated acli

To revert Acquia CLI to download stable releases only, run the following command:

    $ acli self-update --stable
    Downloading Acquia CLI (acquia/cli) 1.30.0
    Download finished
    Successfully updated acli

Installing earlier releases
---------------------------

Acquia recommends you to install Acquia CLI 2.x. It is the latest supported version and receives frequent feature updates. Acquia CLI 2.x requires PHP 8. If you use PHP 7, you can install Acquia CLI 1.x, which is minimally supported.

To install Acquia CLI 1.x, follow the earlier steps after replacing the download URL with the latest 1.x release:

    curl -OL https://github.com/acquia/cli/releases/download/1.30.1/acli.phar

Note

Acquia does not recommend installing Acquia CLI 1.x.