How Do You Install the AWS CLI on an Ubuntu Server?

Problem scenario
You want to use the AWS CLI on an Ubuntu server.  You want to rapidly create EC-2 servers or use S3.   You want to be able to script AWS management commands for rapid provisioning etc. from an Ubuntu Linux server.  What do you do to install AWS CLI on an Ubuntu Linux server?

This works on an Azure server, an AWS EC-2 instance, or an on-premises Ubuntu server:

sudo apt -y update
sudo apt -y install python3-pip
pip install awscli    
# you may want to use pip3 and/or sudo in the above command

Here is how to install pip for Python 2.

sudo apt-get -y update
sudo apt-get -y install python-pip
sudo pip install awscli

To use it run "aws configure" with no quotes.  Follow the prompts.  To find the AWS Access Key ID and AWS Secret Access Key, in the AWS console, click on your name in the upper right hand corner. Click on "My Security Credentials."  Click "Create New Access Key." Then click "Show Access Key."

If you want to install and configure AWS CLI on a Linux server without pip (or the server is not Ubuntu/Debian Linux), see this posting.

Leave a comment

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