How To Install AWS CLI

How To Install AWS CLI

In this AWS article, we will discuss how to install AWS CLI.

How To Install AWS CLI

Follow the link below to install AWS CLI on your Windows machine quickly.

Install Azure CLI On Windows

How To Confirm The AWS CLI Installation

We should ensure that the AWS CLI installation has been done successfully. Follow the below steps

  1. Navigate to START menu –> Search for “cmd”.
  2. Right-click on the Command Prompt –> Select “Run as Administrator” mode.
aws cli install

3. Run the below command

aws --version

4. You can see it is showing the version of the AWS CLI that has been installed on your machine

install aws cli on mac

Or you can also run the below command inside the path “C:\Program Files\Amazon\AWSCLI”.

cd C:\Program Files\Amazon\AWSCLI

5. Now, run the below command to determine the version of the AWS CLI installed on your 64-bit machine.

aws --version

Below, it shows us the version of the AWS CLI installed on my machine.

aws cli mac

Note: In case your machine is 32-bit, to verify the installation, you need to change the path from “C:\Program Files\Amazon\AWSCLI” to “C:\Program Files (x86)\Amazon\AWSCLI”. All other steps will remain the same as above.

There is one more final step to configuring the AWS CLI. Run the command below to set it up.

aws configure

Once you execute the above command, it will ask you to enter the below details. After entering each entry, press the Enter key.

AWS Access Key ID [None]: UJLIMTRGBHIKK5WRVGFKI
AWS Secret Access Key [None]: stadbhTkiLOPG/L8YUIPO/cFTYRGTGYLPYKEY
Default region name [None]: us-west-1
Default output format [None]: json

Now, you are done with the installation and configuration of the AWS CLI. To check, run the below command to list all the S3 buckets if you have one.

aws s3 ls

For the help from AWS CLI, run the below command

aws help

We have discussed above How To Install AWS CLI On Windows 10. Let’s discuss How To Install AWS CLI On Linux, Mac, or Unix.

Install AWS CLI in Ubuntu

Well, let’s discuss how to install the AWS CLI on Ubuntu. We will discuss multiple approaches, including the two critical approaches below.

  • How to install AWS CLI on Ubuntu using APT Package Manager
  • How to install AWS CLI on Ubuntu using Python PIP

How to install AWS CLI on Ubuntu using APT Package Manager

Okay, below are the steps to install AWS CLI on Ubuntu using the APT package manager.

  1. Updating the package repository cache using the below command is suggested as a first step.
$ sudo apt-get update

2. Now, the time to install the below command is to install the AWS CLI.

$ sudo apt-get install awscli

Once you try executing the above command, it will ask, “Do you want to continue?”. Press “Y” for the confirmation and then press the “Enter” key. Then, it will take a few seconds to install the AWS CLI.

3. To ensure the AWS CLI has been installed successfully, you can run the below cmdlet.

$ aws --version

Once you execute the above command, it will show you the AWS CLI version details.

Now, the last step is to configure the AWS CLI. Run the below command to configure the AWS CLI.

$ aws configure

Once you run the above command, it will prompt you to enter the details below.

Now type in your AWS Access Key ID and then press Enter key, Enter the AWS Secret Access Key and then press Enter key, Enter the Default region name and then press Enter key, and finally, type the region and then press Enter key and type the output format like JSON or you can press Enter key for the default option.

Below is a sample of the data

AWS Access Key ID [None]: UJLIMTRGBHIKK5WRVGFKI
AWS Secret Access Key [None]: stadbhTkiLOPG/L8YUIPO/cFTYRGTGYLPYKEY
Default region name [None]: us-west-1
Default output format [None]: json

You are done with the configuration and installation of the AWS CLI. Run the command below for help with the AWS CLI.

$ aws help

This is How to install AWS CLI on Ubuntu using APT Package Manager. Now let’s see How to install AWS CLI on Ubuntu using Python PIP.

How to install AWS CLI on Ubuntu using Python PIP

Python PIP is needed to install the AWS CLI on Ubuntu. Another critical point is that it is always better and more accessible to update the AWS CLI if it is installed as a Python module.

So, as Python PIP is needed, as a first step, let’s install the Python PIP.

  1. The first step is, to run the below command to install the Python PIP on Ubuntu.
$ sudo apt-get install python3-pip

The above command is for the Python PIP 3.x version. To install the Python PIP 2.x version, you can use the below command.

$ sudo apt-get install python-pip

2. Now is the time to install the AWS CLI. Execute the below command using Python PIP 3.x version.

$ pip3 install awscli --upgrade --user

If you are using Python PIP 2.x, then use the below command

$ pip install awscli --upgrade --user

Once you execute the above command, it will take a few seconds to install the AWS CLI.

To ensure the AWS CLI has been installed successfully, we will execute the below commands.

3. If you are using Python PIP 3.x, then execute the below command.

$ python3 -m awscli --version

Or, if you are using Python PIP 2.x version, use the AWS CLI command below.

$ python -m awscli --version

Once you execute the above command, you will see the details of the AWS CLI version installed on your machine.

Now, the last step is to configure the AWS CLI. Run the below command to configure the AWS CLI.

$ python -m awscli configure

Once you run the above command, it will prompt you to enter the details below.

Now type in your AWS Access Key ID and then press Enter key, Enter the AWS Secret Access Key and then press Enter key, Enter the Default region name and then press Enter key, and finally, type the region and then press Enter key and type the output format like JSON or you can press Enter key for the default option.

Below is a sample of the data

AWS Access Key ID [None]: UJLIMTRGBHIKK5WRVGFKI
AWS Secret Access Key [None]: stadbhTkiLOPG/L8YUIPO/cFTYRGTGYLPYKEY
Default region name [None]: us-west-1
Default output format [None]: json

You are done with the configuration and installation of the AWS CLI. Run the command below for help with the AWS CLI.

If you are using Python PIP 2.x version, use the below command

$ python -m awscli help

If you are using the Python PIP 3.x version, then run the below command

$ python3 -m awscli help

This is How to install AWS CLI on Ubuntu using Python PIP.

If your AWS CLI version is old, you need to update the AWS CLI on Ubuntu using the command below.

pip3 install --upgrade awscli

If you don’t see the updated version of AWS CLI after running the above command, you can reboot your machine once.

Install AWS CLI in Linux

You can install the AWS CLI on Linux using the steps below.

  1. The first step is to use the curl to download the zip file and save it as a zip file using the below command
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
    -o "awscliv2.zip"

2. The second step is to use the below command to unzip the file.

$ unzip awscliv2.zip

3. Run the below command to install the AWS CLI.

$ sudo ./aws/install

4. To confirm the installation, run the below command.

$ aws --version

Once you run the above command, it will show you the AWS CLI version details installed successfully on your machine. Now is the time to configure the AWS CLI and link it to your AWS account.

To configure the AWS CLI, run the below command

$ aws configure

Once you run the above command, it will prompt you to enter the details below.

Now type in your AWS Access Key ID and then press Enter key, Enter the AWS Secret Access Key and then press Enter key, Enter the Default region name and then press Enter key, and finally, type the region and then press Enter key and type the output format like JSON or you can press Enter key for the default option.

Below is a sample of the data

AWS Access Key ID [None]: UJLIMTRGBHIKK5WRVGFKI
AWS Secret Access Key [None]: stadbhTkiLOPG/L8YUIPO/cFTYRGTGYLPYKEY
Default region name [None]: us-west-1
Default output format [None]: json

We are done with the installation and configuration for the AWS CLI. To check if everything is working, run the command below, which will list all your available S3 buckets.

$ aws s3 ls

How to install AWS CLI on Mac

You can easily install the AWS CLI on Mac using the steps below.

  1. The first step is to download the AWS CLI using the curl command. If you want to install the latest version, run the command below.
$ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"

If you want to download any specific version of the AWS CLI, then you can use the below command. Say you want to install the AWS CLI version 2.0.30.

$ curl "https://awscli.amazonaws.com/AWSCLIV2-2.0.30.pkg" -o "AWSCLIV2.pkg"

2. You must run the command below to install the AWS CLI.

$ sudo installer -pkg ./AWSCLIV2.pkg -target /

If you look closely at the above command, -pkg helps you define the package name you are trying to install, and -target/parameter defines where you are installing the package.

Now that you are done with the installation, it is time to verify whether the installation was proper. To verify the installation of the AWS CLI, you can use the command below.

$ aws --version

Once you execute the above command, you will see the version of the AWS CLI installed on your machine.

FAQs

What Is AWS CLI?

The AWS CLI (AWS Command Line Interface) is an excellent tool that helps you to easily manage your AWS resources and services. It is a very user-friendly and easy-to-configure tool.

Why Do We Need AWS CLI?

This is a simple tool for managing all your AWS services in one place and automating your cloud infrastructure with a few simple scripts and commands.

Let’s see how easy it is to install and configure the AWS CLI tool.

You may also like following the articles below

Wrapping Up

This article discussed how to install AWS CLI on Windows, Ubuntu, Linux, Mac, etc. I hope you got enough information to install the AWS CLI.