Connect with us

Linux

Install and Use AWS CLI on Linux – Ubuntu / Debian / CentOS

The AWS CLI, an acronym for Amazon Web Services Command Line Interface, is a management tool that allows you to manage all the services on your AWS account from the command line on the terminal. It’s quite easy to install, compatible with all services on AWS, and saves you time that you would have spent using the GUI. In this tutorial, you will learn how to install and use AWS CLI on Linux. We will focus on how you can install it on the latest flavors of Ubuntu, Debian, and CentOS.

Method 1: Install AWS CLI from AWS installer

The first way of installing AWS CLI is by using a 64-bit installer from AWS that is shipped as a zipped file. This method works for all 64-bit Linux distributions and comes highly recommended because it lets you download the latest version of AWS CLI. At the time of penning this tutorial, the latest version is AWS CLI Version 2.

Firstly, download the AWS CLI zipped file. In the example below, we have downloaded it and saved it as awscli.zip.

download-aws-cli

Next, unzip the compressed file as follows:

unzip-aws-cli

After unzipping the file, a folder called aws will be created. To install AWS CLI, run the installer as shown.

install and use AWS CLI

The AWS CLI program is stored in the /usr/local/bin path which is where most programs are stored.

To confirm the version of AWS CLI installed, invoke the command:

You can also confirm the path of installation using the which command as shown.

install and use AWS CLI

To start using the AWS CLI , run the command:

Provide your AWS Access Key ID , Secret access Key and region name

aws-configure

Method 2: Install AWS CLI on Ubuntu / Debian using APT package

The other way you can install AWS CLI on Ubuntu and Debian is using the APT package manager as illustrated below.

This installs a host of Python packages, libraries, and dependencies. However, this does not give you the latest version of AWS CLI.

Method 3: Install using pip package manager

Lastly, you can use pip, which is Python’s package manager to install AWS CLI.

First, install pip in Ubuntu 18.04 / 20.04 as follows.

For older versions of Ubuntu, run:

install-python-pip

Then use pip as follows.

use-pip-to-install-awscli

Usage

Once you are done installing the aws cli tool, you can start making calls to your AWS services. For example:

To get help with command usage run:

And that’s it for this guide. Feel free to send us a shout regarding this tutorial.

Continue Reading
Advertisement

Trending