AWS or Amazon Web services is the industry leader when it comes to Cloud & it’s being used by many industry giants for their IT infrastructure needs. Ease of infra provision & administration is the main causes for it being favorite.

In this tutorial, we are going to learn to install AWS CLI, which is a command-line interface used for administration of Amazon Web Services. Using AWS CLI, we can manage all the resources on AWS with ease. AWS CLI is available for Windows, Linux as well as Mac OS but for this article, we will only concentrate on how we can install AWS CLI on Linux machines.

(Recommended Read: Install JENKINS on CentOS/RHEL 7)

(Also Read: Create your first automation setup: Install Ansible server)

 

Pre-requisites

1- AWS CLI requires either Python 2.6.5+ or Python 3.3+ to be installed on the system. We can install Python with the following command,

$ sudo apt-get install python3                   (Ubuntu/Debian)
$ sudo yum install python                           (CentOS/RHEL)
$ dnf install python                                        (Fedora)

Also, read our article ‘How to install Python 3.6 ’ for detailed instructions.

2- We will use PIP to install the latest version of AWS CLI, though the older version is available with default package managers, latest packages can only be installed using PIP. To install PIP on the system, execute the following command,

$ curl -O https://bootstrap.pypa.io/get-pip.py

& then execute,

$ python get-pip.py

Once the script has been executed successfully, we can then run the following command to confirm the installed PIP version,

$ pip --version

You can also refer to our detailed article for 'Installing Python PIP'.

Note:- Since this tutorial uses PIP to install AWS CLI, hence it can be used be on most of the Linux distributions.

 

Install AWS CLI

As mentioned above, we can also use the default package managers for installing AWS CLI, i.e.

$ sudo apt-get install awscli                        or
$ sudo yum install awscli

But these are not the updated versions. For latest aws cli installation, run the following PIP command from the terminal,

$ pip install awscli

To upgrade the aws cli to the latest version,
$ pip install awscli --upgrade

 

 Configuring AWS CLI

After the installation, we will now configure the cli on our machine. Open terminal & execute the following command,

$ aws configure

You will now be asked to enter the ‘AWS Access Key ID’, then ‘AWS Secret Access Key’ & lastly ‘Default Region Name’. All this information can be obtained from AWS Dashboard. Once all the information has been entered, we will be able to provide resources directly from our terminal, rather than from the AWS Dashboard.

In our future tutorials, we will also discuss some commonly used AWS CLI commands. We now end our tutorial on how to install AWS CLI on Linux. Please feel free to send in any questions/suggestions using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of your hard-earned money: [paypal-donation]

Linux TechLab is thankful for your continued support.