How to install AWS command line interface (awscli) on Linux?

Yeah, this should help you to manage many things from your Linux server or local machine. AWS supports command line interface tool. It’s package name is awscli. The package awscli is available in commonly using package manager like YUM, APT, APT-GET etc..

However, it’s not recommended to install using YUM or APT, because it is not guaranteed to be the latest version unless you get it from pip.

We can simply install awscli using pip. Pip is a package management system used to install and manage software packages written in Python.

Check pip is already installed on your machine..

pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

If it is not installed, please install pip..

pip installation steps

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

The script downloads and installs the latest version of pip.

python get-pip.py --user

Next step is important. We need to add the local bin location to current PATH variable.

To list current PATH details:

echo $PATH

Add the executable path to your PATH variable: ~/.local/bin

export PATH=~/.local/bin:$PATH

This command adds a path, ~/.local/bin in this example, to the current PATH variable.

Load the profile into your current session.

source ~/.profile

You can find the shell’s profile script in your user folder.

Installing the AWS CLI with Pip

pip install awscli --upgrade --user

You can use the above command to upgrade awscli tool.

Verify that the AWS CLI installed correctly:

$ aws --version
aws-cli/1.14.37 Python/2.7.6 Linux/4.4.0-111-generic botocore/1.8.41

Add the executable path to your PATH variable: ~/.local/bin

export PATH=~/.local/bin:$PATH

This command adds a path, ~/.local/bin in this example, to the current PATH variable.

Load the profile into your current session.

source ~/.profile

To see more details about aws commandline interface tool:

  aws help
  aws command help
  aws command subcommand help

Post navigation

Arunlal Ashok

Cloud Infrastructure / DevOps Engineer. I'm dealing Linux servers since 2012. I started this blog to share and discuss my ideas.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team CryBit.com

Leave a Reply

Your email address will not be published. Required fields are marked *