Amazon Web Services (AWS) - Download and Install the AWS CLI on Linux

by
Jeremy Canfield |
Updated: November 06 2023
| Amazon Web Services (AWS) articles
On a Linux system, curl can be used to download the latest version of the AWS CLI.
curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip --output /tmp/awscliv2.zip
Or, you can download a specific version of the AWS CLI (version 2.13.24 in this example).
curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.13.24.zip --output /tmp/awscli-exe-linux-x86_64-2.13.24.zip
Or the following for version 1.x.x of the AWS CLI.
curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip --output /tmp/awscli-bundle-1.16.312.zip
Create a temporary directory for the AWS CLI installation files.
mkdir /tmp/aws-cli-2.13.24-install-files
unzip the file.
unzip /tmp/awscliv2.zip -d /tmp/aws-cli-2.13.24-install-files
You can now delete the .zip file.
rm /tmp/awscliv2.zip
The install command can then be used to install the CLI. By default, the AWS CLI will be installed at /usr/local/bin/aws.
sudo /tmp/aws/install
Or, the --install-dir and --bin-dir options can be used to install the AWS CLI is a specific directory, usually your users home directory, for testing/debugging purposes.
/tmp/aws/install --install-dir ~/.local/aws_v2.13.24/aws-cli --bin-dir ~/.local/aws_v2.13.24/bin
You can now remove the /tmp/aws install directory.
rm -rf /tmp/awscli-2.13.24-install
Did you find this article helpful?
If so, consider buying me a coffee over at