How to Install AWS CLI in LINUX

In this tutorial, we are going to learn How to install AWS CLI in LINUX, which is a command-line interface for AWS Cloud which is used for the administration of Amazon Web Services. Using AWS CLI, easily we can manage all the resources on AWS. AWS CLI is available for Windows, Linux as well Mac OS

AWS CLI is updated frequently with support for the latest/new services and commands provided by AWS.

Check the latest release page on GitHubHow to Install AWS CLI in LINUX

Pre-requisite to install AWS CLI on Linux

Python version 2.6.5+ / Python version 3.3+

Support OS – Linux, MacOS, Unix or Windows

Note: If you are using an old version of python then AWS CLI may not work and you may see “InsecurePlatformwarning” or deprecation notices. To resolve this update to the latest version, you can update it with the below command.

$pip install awscli --upgrade --user

“–upgrade,” option tells pip to upgrade the current package.

“–user” option tells pip to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.

Command to verify AWS CLI updated/installed

$ aws --version
aws-cli/1.11.84 Python/3.6.2 Linux/4.4.0-59-generic botocore/1.5.47

AWS CLI is regularly updated and support for the latest services and command. You can update it with the below command.

$ pip install awscli --upgrade –user

Uninstall AWS CLI using pip or yum command

$ pip uninstall awscli

If you don’t have pip command installed then install it by mention steps

Steps to install pip on Linux

  1. Download the script:
$ curl -O https://bootstrap.pypa.io/get-pip.py
  1. Run the script with python:
$ python get-pip.py –user
  1. Verify that pip is installed correctly
     $ pip --version 
    pip 8.1.2 from ~/.local/lib/python3.4/site-packages (python 3.4)

AWS Command Line Interface: The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts. –Ref by AWS Doc.

Steps to install AWS CLI in Ubuntu

We can have a default package manager for installing AWS CLI

For Ubuntu:

$ sudo apt-get update awscli

For Linux:

$ sudo yum install awscli

Install Updated Version, run the pip command

$ pip install awscli

To Upgrade

$ pip install awscli –upgrade

How to configure AWS CLI

After Installation of AWS CLI, you need to configure it, run the “aws configure” command and it will ask you  ‘AWS Access Key ID’, then ‘AWS Secret Access Key’ & lastly ‘Default Region Name’ these all details you can get from your AWS Account – Login to your AWS Console and goto IAM service.

$ aws configure

End of the tutorial, How to Install AWS CLI in LINUX.


Thanks for reading this article, you’ll also like to read below articles.

What is AWS EC2 and its Benefits

How to execute script or command on reboot or startup in Linux

Checklist for Pre and Post Linux Reboot