Easy way to install AWS CLI on Linux
AWS or Amazon Web services is the industry leader when it comes to Cloud & it’s being used by many industry gaints for their IT infrastructure needs. Ease on infra provision & administration are main causes for it being favourite.
In this tutorial, we are going to learn to install AWS CLI , which is 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 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)
1- AWS CLI requires either Pyton 2.6.5+ or Python 3.3+ to be installed on the system. We can install Python with 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 using PIP to install the latest version of AWS CLI, though older version are available with default package managers but 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
& than execute,
$ python get-pip.py
Once the script has been executed successfully, we can than 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 packagae managers for installing AWS CLI, i.e.
$ sudo apt-get update 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 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’, than ‘AWS Secret Access Key’ & lastly ‘Default Region Name’. All these information can be obtained from AWS Dashboard. Once all the information has been entered, we will be able to provision resources directly from our terminal, rather than from 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.