Master the AWS CLI Installation Process

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.
Unleash the power of automation with the AWS CLI! Say goodbye to manual tasks and hello to seamless access to AWS services. Whether you're a Windows or Linux user, the installation process is a breeze, so you can start taking advantage of the CLI's programmatic capabilities in no time. The two operating systems I always use, as well as my installation preference, are listed below.
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. |