Alibaba Cloud CLI lets you manage cloud resources from a terminal. This topic covers installation, updates, and uninstallation on Linux, macOS, and Windows.
Version information
The latest Alibaba Cloud CLI version is 3.3.14. View release notes on the GitHub Releases page.
Versions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes. If you are running one, use the migration guide to upgrade.
Prerequisites
-
You have an Alibaba Cloud account. Create an account if needed.
-
(Optional) curl is installed. Most macOS and Linux systems include it by default. Not required for GUI or package manager installs.
Supported systems
|
Operating system |
Supported versions |
Supported architectures |
|
Linux |
Major distributions including CentOS 7+, Ubuntu 16.04+, Debian 9+ |
AMD64, ARM64 |
|
macOS |
macOS 11 (Big Sur) and later |
Intel and Apple Silicon (Universal) |
|
Windows |
Windows 10 and later (64-bit) |
AMD64 only (32-bit and ARM64 are not supported) |
Install Alibaba Cloud CLI
Select your operating system and preferred installation method.
Linux
Use the Bash script for a quick one-command install; use the TGZ package for air-gapped environments or custom install paths.
Use a Bash script
The script detects your architecture, downloads the correct package, and places the aliyun binary in /usr/local/bin/.
-
Install the latest version
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -
Install a specific version
Check GitHub Releases for available versions.
ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -- -V 3.0.277
Use a TGZ package (compressed tar archive)
-
Download the installation package that matches your system architecture.
NoteRun
uname -mto check your architecture.arm64oraarch64indicates ARM64. Other output indicates AMD64.-
Download for Linux AMD64:
curl https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz -o aliyun-cli-linux-latest.tgz -
Download for Linux ARM64:
curl https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz -o aliyun-cli-linux-latest.tgz -
Download a specific version: Visit the GitHub Releases page. The package name format is
aliyun-cli-linux-<version>-<architecture>.tgz.ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
-
-
Extract the package to obtain the
aliyunbinary.tar xzvf aliyun-cli-linux-latest.tgz -
Move the binary to
/usr/local/binfor global access.sudo mv ./aliyun /usr/local/bin/
macOS
Use a graphical installer (GUI, recommended)
-
Download the PKG (macOS installer package).
-
Latest version: Download the PKG installer: https://aliyuncli.alicdn.com/aliyun-cli-latest.pkg
-
Specific version: Visit the GitHub Releases page. The PKG name format is
aliyun-cli-<version>.pkg.ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
-
-
Double-click the downloaded PKG file and follow the on-screen instructions to complete the installation.
NoteIf macOS blocks the installer with a security warning, open System Settings > Privacy & Security and click Open Anyway to proceed.
Use Homebrew
Ensure Homebrew is installed before proceeding.
To install the latest version, run:
brew install aliyun-cli
Use a Bash script
The script detects macOS and downloads the universal binary automatically.
-
Install the latest version
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -
Install a specific version
Check GitHub Releases for available versions.
ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -- -V 3.0.277
Use a TGZ package
-
Download the installation package.
-
Latest version:
curl https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-universal.tgz -o aliyun-cli-macosx-latest-universal.tgz -
Specific version: Visit the GitHub Releases page. The package name format is
aliyun-cli-macosx-<version>-universal.tgz.ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
-
-
Extract the package to obtain the
aliyunbinary.tar xzvf aliyun-cli-macosx-latest-universal.tgz -
Move the binary to
/usr/local/binfor global access.sudo mv ./aliyun /usr/local/bin
Windows
Alibaba Cloud CLI runs only on Windows AMD64 systems. 32-bit and other non-AMD64 architectures (including ARM64) are not supported.
Use the PowerShell script for automated installs; use the ZIP package for manual or portable installs.
Use a ZIP package
-
Download the installation package.
-
Latest version: Download the ZIP package: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip
-
Specific version: Visit the GitHub Releases page. The package name format is
aliyun-cli-windows-<version>-amd64.zip.ImportantVersions earlier than 3.3.0 are end-of-life and no longer receive updates or security fixes.
-
-
Extract
aliyun.exefrom the ZIP file to a directory of your choice. This directory serves as the Alibaba Cloud CLI installation directory.NoteRun
aliyun.exefrom a command-line terminal. Double-clicking the executable has no effect. -
Press
Windows+Sto open the Windows search bar, then type "environment variables". -
In the search results, click Edit the environment variables for your account to open the Environment Variables dialog box.
-
Under User variables, select the
Pathvariable, and then click Edit.
-
Click New, and enter the Alibaba Cloud CLI installation directory path. For example:
C:\ExampleDir(replace with your actual installation path).
-
Click OK in each open dialog box to save the changes.
-
Restart your terminal for the changes to take effect.
Use a PowerShell script
-
Create a file named
Install-CLI-Windows.ps1and paste the following script into it. -
Run the script to install Alibaba Cloud CLI.
NoteThe example script path is
C:\Example\Install-CLI-Windows.ps1. Replace it with your actual script path.-
Install the latest version. The default installation path is
C:\Users\<USERNAME>\AppData\Local\AliyunCLI.powershell.exe -ExecutionPolicy Bypass -File C:\Example\Install-CLI-Windows.ps1 -
Specify a version (from GitHub Releases) and installation directory.
powershell.exe -ExecutionPolicy Bypass -File C:\Example\Install-CLI-Windows.ps1 -Version 3.0.277 -InstallDir "C:\ExampleDir\AliyunCLI"
-
Verify the installation
Confirm the installation:
aliyun version
A version number output (e.g., 3.3.14) confirms a successful installation.
If the command returns command not found or an unexpected version, see FAQ below.
Update Alibaba Cloud CLI
Update using the same method you used for the initial installation.
Locate your current installation
If you are unsure how CLI was installed, locate the binary:
-
Linux/macOS: Run
which aliyun. The output is the path to the executable.-
Path contains
/homebrew/or/linuxbrew/→ installed via Homebrew. Use the Homebrew update method. -
Path is
/usr/local/bin/aliyun→ installed via Bash script or TGZ package to the default directory. -
Other path → installed via TGZ package to a custom directory. Note the path and use the TGZ update method.
-
-
Windows: Run
where aliyun.exein Command Prompt. The output is the path to the executable.-
Path is
%LOCALAPPDATA%\AliyunCLI\aliyun.exe→ installed via PowerShell script (default path). -
Other path → installed via GUI installer (ZIP) to the directory you chose.
-
Version upgrade path
Run aliyun version to check your current version, then follow the appropriate path:
-
Version 3.3.0 or later: Update directly using the method that matches your installation.
-
Version earlier than 3.3.0: Do not update directly. See the migration guide to complete the upgrade first.
Update methods
Choose the method that matches your initial installation:
-
Bash script (Linux/macOS): Re-run the installation script to update to the latest version.
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -
Homebrew (macOS only): To update, run:
brew update && brew upgrade aliyun-cli && brew cleanup aliyun-cli -
PKG installer (macOS) / ZIP package (Windows):
-
macOS (PKG): Download the latest PKG installer: https://aliyuncli.alicdn.com/aliyun-cli-latest.pkg. Double-click the PKG file and follow the on-screen instructions. The new binary overwrites the previous installation.
-
Windows (ZIP): Download the latest ZIP package: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip. Extract
aliyun.exefrom the ZIP file and move it to your existing Alibaba Cloud CLI installation directory, overwriting the old binary. You do not need to repeat the PATH configuration.
-
-
TGZ package (Linux/macOS): Follow steps 1–3 in the Linux > Use a TGZ package or macOS > Use a TGZ package installation section, using the same target directory as your original installation to overwrite the existing binary.
-
PowerShell script (Windows only): Re-run the PowerShell installation script with the same parameters you used originally. The script will download the latest version and overwrite the existing installation.
powershell.exe -ExecutionPolicy Bypass -File <script_path> [-InstallDir <install_path>]NoteAdd
-Version <version>to update to a specific version. Omit it to install the latest release. Check GitHub Releases for available versions.
Notes
-
If you used a custom installation directory, specify the same directory when updating.
-
Fully uninstall and reinstall if: you are unsure of your installation method, need to switch methods, or need to change the install directory.
Verify the update
Confirm the update:
aliyun version
Uninstall Alibaba Cloud CLI
Linux
Use the command line
-
Remove the
aliyunbinary:sudo sh -c "which aliyun | xargs -r rm -v" -
If you installed to a custom directory, remove that directory from the
PATHenvironment variable. Open your shell configuration file (for example,~/.bashrcfor Bash or~/.zshrcfor Zsh) and delete the line that adds the Alibaba Cloud CLI directory toPATH. Then reload the configuration:source ~/.bashrcNoteReplace
~/.bashrcwith~/.zshrcif your default shell is Zsh.
Use a Bash script
-
Create a script file and paste the following content into it.
-
Run the script:
# Uninstall only the executable file bash <script_path> # Uninstall the executable file and delete the configuration file bash <script_path> -C # View script help bash <script_path> -h
macOS
Use Homebrew
Run the following command to uninstall:
brew uninstall aliyun-cli
Use the command line
-
Remove the
aliyunbinary:BINARY=$(which aliyun 2>/dev/null) && [ -n "$BINARY" ] && sudo rm -v "$BINARY" -
If you installed to a custom directory, remove that directory from the
PATHenvironment variable. Open your shell configuration file (~/.bashrcfor Bash or~/.zshrcfor Zsh) and delete the line that adds the Alibaba Cloud CLI directory. Then reload the configuration:source ~/.zshrcNoteReplace
~/.zshrcwith~/.bashrcif you use Bash.
Windows
Use File Explorer
-
Open File Explorer, navigate to the Alibaba Cloud CLI installation directory, and delete the
aliyun.exefile. -
Press the
Windowskey, then type "environment variables" in the search box. -
In the search results, click Edit the environment variables for your account to open the Environment Variables dialog box.
-
Under User variables, select the
Pathvariable, and then click Edit.
-
Select the Alibaba Cloud CLI installation directory entry, click Delete to remove it from
Path. For example:C:\ExampleDir(replace with your actual installation path).
-
Click OK in each open dialog box to save the changes.
Use a PowerShell script
-
Create a script file and paste the following content into it.
-
Run the script:
# Uninstall only the executable file powershell.exe -ExecutionPolicy Bypass -File <script_path> # Uninstall the executable file and delete the configuration file powershell.exe -ExecutionPolicy Bypass -File <script_path> -Clean # View script help powershell.exe -ExecutionPolicy Bypass -File <script_path> -Help
Delete configuration files (optional)
CLI configuration is stored in the .aliyun directory under your user profile. Delete it to fully remove all CLI data:
-
Linux/macOS:
~/.aliyun -
Windows:
C:\Users\<USERNAME>\.aliyun
FAQ
Why does the aliyun command return "command not found" after installation?
The aliyun binary is not in your PATH or was not installed. Locate the binary to confirm:
-
Linux/macOS: Run
which aliyun. If a path is returned, the binary exists but its directory is not inPATH. If no path is returned, the binary was not installed. Retry the installation using one of the methods in the Install section. -
Windows: Run
where aliyunin Command Prompt. If a path is returned, the binary exists but its directory is not inPATH. If no path is returned, the binary was not installed. Retry the installation using one of the methods in the Install section.
If the binary is found, add its directory to PATH for your shell:
-
Bash: Add
export PATH="$PATH:/your/install/dir"to~/.bashrc, then runsource ~/.bashrc. -
Zsh: Add the same line to
~/.zshrc, then runsource ~/.zshrc. -
Windows: Follow steps 3–8 in the Windows > Use a ZIP package installation section to add the installation directory to the
Pathenvironment variable, then restart your terminal.
Why does "aliyun version" show a different version than what I just installed?
Multiple aliyun binaries may exist. Run which aliyun (Linux/macOS) or where aliyun (Windows) to check which one your shell resolves. If it points to an older installation, delete the old binary or reorder PATH directories so the new installation takes precedence. Restart your terminal and re-run aliyun version to confirm.
Why does the installation fail with "Permission denied"?
System directories like /usr/local/bin require administrator privileges. On Linux/macOS, prefix the command with sudo (e.g., sudo mv ./aliyun /usr/local/bin/). On Windows, run PowerShell as administrator.
Homebrew installation or update times out on macOS
GitHub CDN access can be slow in mainland China. Configure a domestic Homebrew mirror (e.g., USTC) as shown in the macOS > Homebrew section. To persist the settings, add the export lines to ~/.zshrc or ~/.bashrc and run source ~/.zshrc. Retry the Homebrew command after configuring the mirror.
Why doesn't anything happen when I double-click aliyun.exe on Windows?
Alibaba Cloud CLI is a command-line tool with no graphical interface. Double-clicking the executable opens and immediately closes a window. Open Command Prompt or PowerShell, navigate to the directory containing aliyun.exe (or add it to PATH), and run commands from there.
Next steps
-
Quick start: Configure credentials and run your first command.
-
Configure credentials: Set up access credentials for Alibaba Cloud CLI.
-
Migration guide: If your current version is earlier than 3.3.0, follow the migration guide to upgrade to the latest version.