How To Install AWS CLI

How To Install AWS CLI

In this AWS article, we will discuss How To Install AWS CLI and along with that we will also discuss a few other topics as below.

  • What Is AWS CLI?
  • Why Do We Need AWS CLI?
  • How To Install AWS CLI On Windows
  • Uninstall AWS CLI Windows
  • Install AWS CLI Ubuntu
  • Uninstall AWS CLI Ubuntu
  • Install AWS CLI Linux
  • Uninstall AWS CLI Linux
  • Install AWS CLI mac
  • Uninstall AWS CLI mac

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?

A simple tool to manage all your AWS services in one place and to automate your cloud infra with the help of a few simple scripts and commands.

Now, let’s see how easy to install and configure the AWS CLI tool.

How To Install AWS CLI

You can follow the below steps to quickly install AWS CLI o your Windows machine.

How To Install AWS CLI On Windows

  1. If you are using 64 bit machine, Download the 64bit MSI for AWS CLI now.

Or, If you are using 32 bit machine, Download the 32bit MSI for AWS CLI now.

2. Once you will click on the download link, you will get the below setup.

AWS CLI setup Download and installation on Windows

3. Double click on the above setup and then click on the Next button as shown below.

AWS CLI setup Download

4. Accept the terms in the License Agreement and then click on the Next button.

How to  Download AWS CLI setup

5. Click on the Next button.

How to install AWS CLI in windows 10

6. Now, click on the Install button to install the AWS CLI.

How to install AWS CLI in windows

7. Click on the Allow button to allow the third-party installation on your machine. It will take a few seconds to install the AWS CLI. Finally, click on the Finish button to complete the installation of the AWS CLI.

How to install AWS CLI windows

The default path for the installation of Azure CLI for 64 bit machine is “C:\Program Files\Amazon\AWSCLI”.

Same way, the default path for the installation of Azure CLI for 32-bit machines is “C:\Program Files (x86)\Amazon\AWSCLI“.

How To Confirm The AWS CLI Installation

Now, we should make sure that the installation of AWS CLI 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.
Confirm The AWS CLI Installation

3. Run the below command

aws --version

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

verify AWS installation in windows 10

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

cd C:\Program Files\Amazon\AWSCLI

4. Now, run the below command to know the version of the AWS CLI that has been installed on your 64 bit machine.

aws --version

You can able to see below, it is showing us the version of the AWS CLI that has been installed on my machine.

How To Confirm The AWS CLI Installation

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 same as above.

Configure AWS CLI

Now, there is one more final step you have to perform in order to configure the AWS CLI. Run the below command to set up the AWS CLI.

aws configure

Once you will execute the above command, it will ask you to enter the below details. After entering each entry press 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 the configuration of the AWS CLI, To, check run the below command to list down all the S3 buckets if you have.

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.

Uninstall AWS CLI Windows

Well, if you have decided to uninstall the AWS CLI, you can follow the below steps to uninstall the AWS CLI from Windows.

  1. Open the Control Panel –> Click on Programs –> Click on Programs and Features.
  2. Select the AWS Command Line Interface and then click on the Uninstall button as highlighted below.
Uninstall AWS CLI Windows

Or, You can also right click on the AWS Command Line Interface and then select the Uninstall option.

3. Click on the Yes button to confirm the uninstallation process on the next pop up.

Install AWS CLI Ubuntu

Well, let’s discuss here, How to install AWS CLI on ubuntu. Basically, we will discuss here multiple approaches to install AWS CLI on ubuntu. As part of this, we will discuss the below two key approaches.

  • 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 APT package manager.

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

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

$ sudo apt-get install awscli

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

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

$ aws --version

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

Configure AWS CLI

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

$ aws configure

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

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 just press Enter key for the default option.

Below is a sample of 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 AWS CLI, Run the below command for help from 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 important point is, it is always better and easy to update 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, 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. Now if you want to install the Python PIP 2.x version, then you can use the below command.

$ sudo apt-get install python-pip

2. Now, 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 will execute the above command, it will take a few seconds to install the AWS CLI.

Now, just to make sure that 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, then use the below AWS CLI command.

$ python -m awscli --version

Once, you will execute the above command, it will show you, the AWS CLI version details that have been installed on your machine.

Configure AWS CLI

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 will run the above command, it will prompt you to enter the below details.

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 just press Enter key for the default option.

Below is a sample of 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 AWS CLI, run the below command for help from 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.

Update AWS CLI Ubuntu

If you find the AWS CLI version that you are using is the old version, then you need to update the AWS CLI on ubuntu using the below command.

pip3 install --upgrade awscli

After running the above command, if you didn’t see the updated version of AWS CLI, you can reboot your machine once.

Uninstall AWS CLI Ubuntu

If you have decided to uninstall the AWS CLI on ubuntu, you can do that using the below commands.

Execute the below command to uninstall AWS CLI on ubuntu.

sudo apt-get remove  awscli

If you want to uninstall the AWS CLI package along with all its dependencies, you can use the below command.

sudo apt-get remove --auto-remove awscli

Now, if you want to remove the AWS CLI along with all the configuration. you can use the below command

sudo apt-get purge awscli

Or, for the same purpose you can also use the below command.

sudo apt-get purge --auto-remove awscli

Install AWS CLI Linux

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

  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 will run the above command, it will show you the AWS CLI version details that have been installed successfully on your machine. Now the time to configure the AWS CLI meaning linking the AWS CLI to your AWS account.

Configure AWS CLI

To configure the AWS CLI, run the below command

$ aws configure

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

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 just press Enter key for the default option.

Below is a sample of 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

Now, we are done with the installation and the configuration for the AWS CLI. Let’s check if everything is working fine. Run the below command that will list out all your available S3 buckets.

$ aws s3 ls

Uninstall AWS CLI Linux

You can easily uninstall the AWS CLI on Linux by removing the below two items using the two commands as below

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

Install AWS CLI mac

You can easily able to install the AWS CLI on mac using the below steps.

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

In case, 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. Now you need to run the below command to install the AWS CLI.

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

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

Now you are done with the installation, Time to verify the installation is proper or not. You can use the below command to verify the installation of the AWS CLI.

$ aws --version

Once, you will execute the above command, it will show you the version of the AWS CLI that has been installed on your machine.

Uninstall AWS CLI mac

You can easily uninstall the AWS CLI on Linux by removing the below two items using the two commands as below

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

Or, you can also uninstall the AWS CLI using the pip command

$ pip3 uninstall awscli

You may also like following the below articles

Wrapping Up

Well, in this article we have discussed How To Install AWS CLI, What Is AWS CLI ?, Why Do We Need AWS CLI?, How To Install AWS CLI On Windows, Uninstall AWS CLI Windows, Install AWS CLI Ubuntu, Uninstall AWS CLI Ubuntu, Install AWS CLI Linux, Uninstall AWS CLI Linux, Install AWS CLI mac, Uninstall AWS CLI mac, etc. Hope you got enough information to install the AWS CLI.