Linux Tutorials, Guides & Latest Tech Stuffs

How to Install AWS CLI on Ubuntu 18.04

The AWS Command Line Interface (CLI) is unified tool to control multiple AWS services from command line and help you to automate them through scripts. This post talks about how to install AWS CLI on Ubuntu 18.04 Bionic Beaver.

Most preferred installation method for AWS CLI is pip  a package manager for Python, that help to install, remove and upgrade python packages along with their dependencies.

Latest AWS CLI Version

AWS CLI code base keeps updating frequently, for latest CLI command support, you should check AWS CLI release page on GitHub

Requirements

  • Python 2 version 2.6.5+ or Python 3 version 3.3+
  • Windows, Linux, MacOS, or Unix

Installing AWS CLI

If you already have pip and supported version of Python, you can install AWS CLI with following command.

pip install awscli --upgrade --user

–upgrade option tells pip to upgrade requirements.

–user option tells pip to install program in current user subdirectory, to avoid modifying libraries used by operating system.

Verifying AWS CLI installation

After installation, you can verify AWS CLI Installation by running following command.

aws --version

Upgarde AWS CLI

As already state above, AWS CLI keeps on updating frequently to add support for newly added services and commands. Latest version of AWS CLI can be installed with following command.

pip install awscli --upgrade --user

Configure AWS CLI

For configuring AWS CLI, you should have access key ID and secret access key for an IAM user

For single profile

For general use, you can configure AWS CLI using aws configure command.

aws configure

Once you run this command, you need to provide AWS access key ID, AWS secret access key, Default region name and Default output format.

Example Inputs:

AWS Access Key ID [None]: AKAIDNGHFO7ECLGIKI
AWS Secret Access Key [None]: lwsfjlsXflsaf/K8f0asfjl/dsfhoiewrjdiflEX
Default region Name [None]: us-west-2
Default output format[None]: json

For multiple profiles

If you have more than one profile, you can configure additional profiles by using –profile option. See example.

aws configure --profile user2

Removing AWS CLI

For removing AWS CLI from you computer, you can use pip uninstall command like this.

pip uninstall awscli

Other ways to Install AWS CLI

Standalone installers

For Offline or automated installation on Linux, MacOS and Linux,You can try bundled installer. Bundled installer contains AWS CLI, its dependencies and a shell script that will complete installation for you.

Pranav K

Pranav K is a software engineer and all-round computer geek. His interests include AWS, Ubuntu and Wordpress

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.