
Install the AWS CLI v2 on Linux using curl to download, unzip to extract, and sudo ./aws/install. On Windows, use msiexec.exe to install directly from the AWS URL. Verify installation with aws --version.
Quick reference for installing AWS CLI v2 on Linux and Windows. Both methods are short. Linux uses curl, unzip, and sudo install. Windows uses msiexec directly from the AWS URL. Below are the exact commands I run on each.
Prerequisites
- Access to the internet
- Ability to unzip/extract downloaded package
- 64-bit operating system
AWS CLI version 2 is the latest major version and includes features not available in version 1. Always install version 2 for new projects unless you have specific compatibility requirements.
Linux
#use curl to download the zip file and name it awscliv2.zip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
#use the unzip program to extract the package, which will create a folder called 'aws' in the current location
unzip awscliv2.zip
#use sudo to install the CLI
sudo ./aws/install
#confirm successful installation
aws --version
For Linux ARM architectures (like AWS Graviton or Raspberry Pi), use the ARM-specific installer: curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
Windows (PowerShell with Admin rights)
#install the msi package directly from the website
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
OR
#install the msi package directly from the website without any user interaction
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi /qn
After installing on Windows, you may need to restart your terminal or PowerShell session for the aws command to be recognized in your PATH. If aws --version still fails, try opening a new terminal window.
#confirm successful installation
aws --version
After installation, configure your credentials by running aws configure and entering your Access Key ID, Secret Access Key, default region, and output format.
Troubleshooting
| Issue | Possible Cause | Solution |
|---|---|---|
| "aws: command not found" after installation | PATH not updated or terminal not refreshed | Close and reopen terminal. On Linux, the installer adds /usr/local/bin/aws. Verify with which aws or add to PATH manually. |
| "unzip: command not found" on Linux | unzip utility not installed | Install unzip first: sudo apt install unzip (Debian/Ubuntu) or sudo yum install unzip (RHEL/Amazon Linux). |
| MSI installation fails on Windows | Insufficient privileges or conflicting version | Run PowerShell as Administrator. Uninstall any previous AWS CLI version first via Control Panel. |
| "Unable to locate credentials" | AWS credentials not configured | Run aws configure and enter your Access Key ID and Secret Access Key. Credentials are stored in ~/.aws/credentials. |
| SSL certificate errors during installation | Corporate proxy or firewall interference | Configure proxy settings or download the installer manually from the AWS website and install offline. |