How to Install AWS CLI on Ubuntu

|

|

The article provides instructions on installing the AWS Command Line Interface (CLI) on an Ubuntu Linux system. Three methods of installation are provided: via Ubuntu’s Universe repository, directly from Amazon, and through Python PIP. After installation, instructions for verifying the installation success and configuring access keys for the AWS account are provided.

This article will guide you through installing the AWS Command Line Interface (CLI) on your Ubuntu Linux system.

AWS CLI stands for Amazon Web Services Command Line Interface. It is a unified tool to manage various AWS services from the command line. You can use AWS CLI to automate your AWS services and develop custom scripts to manage your AWS resources. AWS CLI is available for Windows, macOS, and Linux.

You can manage various AWS services directly from your terminal with the AWS CLI.

Before we start, please ensure you have the necessary permissions to install software on your Ubuntu Linux system.

There are multiple ways to install AWS CLI on Ubuntu Linux. You can install it from Ubuntu’s Universe repository, directly download it from AWS, or use it through Python PIP.

Install AWS CLI from Ubuntu’s repository

The easiest way to install AWS CLI is from Ubuntu’s Universe repository, although it may not be the latest version.

Open the terminal and run the command below.

sudo apt install awscli

Once installed, run the command below to verify if AWS CLI is installed.

aws --version

Install AWS CLI from Amazon

To install AWS CLI from Amazon, run the command below. First, install the unzip package if it is not available on Ubuntu.

sudo apt install curl unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

Next, run the commands below to extract and install the downloaded file.

unzip awscliv2.zip
sudo ./aws/install

To confirm that the AWS CLI is installed correctly, run the following command to check its version:

aws --version

Install AWS CLI via Python PiP

First, let’s update the system packages to their latest versions. Open a terminal and execute the following command:

sudo apt update

This command will update the package lists for upgrades and new installations.

Install Python and PIP

The AWS CLI is built with Python, so we must install Python and PIP (Python Package Installer) as prerequisites. Run the following command in the terminal:

sudo apt install python3 python3-pip -y

Install AWS CLI using PIP

Now, we can install the AWS CLI using PIP. Execute the following command to install or upgrade the AWS CLI:

sudo pip3 install --upgrade awscli

This command will install the AWS CLI globally on your system.

Verify the Installation

To confirm that the AWS CLI is installed correctly, run the following command to check its version:

aws --version

If the installation was successful, you will see the version information displayed in the terminal.

Configuring AWS CLI

To use the AWS CLI, we need to configure the access keys for your AWS account. Run the following command and follow the interactive prompts:

aws configure

You will be asked to enter your AWS Access Key ID, Secret Access Key, default region, and default output format. Provide the necessary information based on your AWS account configuration.

Conclusion

Congratulations! You have successfully installed and configured the AWS CLI on your Ubuntu Linux system with your AWS account. Now, you can begin using the AWS CLI to manage various AWS services directly from your terminal.

Like this:



Leave a Reply

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

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