The AWS command line interface(CLI) is an open-source tool to interact with multiple AWS services. By using AWS CLI, you can start, stop, automate things such as EC2, S3, route53, etc. In this tutorial, I am going to install aws cli on Ubuntu 20.04.
Let’s install AWS CLI by following methods-
- AWS CLI Installation from the Installer Script
- Install AWS CLI from the Ubuntu repository.
- AWS CLI installation using Python pip.
Before installation of AWS CLI on Ubuntu, let’s check out prerequisites.
- Ubuntu 20.04
- AWS account details.
- Root access or sudo privileged user.
Install AWS CLI on Ubuntu 20.04
There are several ways to install CLI(Command Line Interface) on Ubuntu. I will try to cover almost all the methods. Let’s dive in one by one.
Method 1: AWS CLI Installation from the Installer Script
This is the recommended way to install CLI using the following script. First download the script using
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
After downloading the script, now
unzip the script by following command.
$ unzip awscliv2.zip
Now, run the following command to install.
$ sudo ./aws/install
To check the installation, you can check the AWS CLI version by following command.
$ aws --version
Method 2: Install AWS CLI from the Ubuntu repository
AWS CLI can be installed from the Ubuntu repository as well. Before running the installation command, update the repository using the following command.
$ sudo apt update
Once the Ubuntu packages updated, continue installation using following command.
$ sudo apt install awscli -y
Upon installation completed, check the AWS CLI version.
$ aws --version
Step 3: AWS CLI installation using Python pip
First install the python-pip packages on your Ubuntu. You can install it by following command.
$ sudo apt update $ sudo apt -y install python3-pip
Once the pip packages are installed, you can install the aws cli command line interface.
$ sudo pip3 install awscli
Configure AWS Command Line Interface
To use AWS CLI, you have to configure it with your aws account. Run the following command to configure.
$ aws configure
It will ask for the following details.
- AWS Access Key ID
- AWS Secret Access Key
- Default region name
- Default output format
After providing all the details, you can access your aws resources using aws cli commands.
In this article, you have learned to install AWS CLI on Ubuntu 20.04. If you have any doubts feel free to contact me, I will definitely try to help you. Also, you can join our elite Facebook group to get direct help from me. If you like this tutorial, please share this article on your social media handle.