How to install aws cli on Linux

· >

Installing the AWS Command Line Interface on Linux

The Amazon Web Services (AWS) Command Line Interface (CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell. In this tutorial, we’ll explain how to install the AWS CLI on Linux.


Before you can install the AWS CLI on your Linux machine, there are some prerequisites that need to be met:

  • A valid AWS account with administrator access.
  • A machine or VM running a supported version of Linux (see AWS documentation for details).
  • At least 5GB of free disk space.

How to add swap to AWS EC2/Lightsail Amazon Linux Instance

recommended reading

Installing the AWS CLI

Once you have the prerequisites in place, you can begin the installation process. Here’s a step-by-step guide:

To install the AWS CLI on Linux, follow these steps:

  1. First, check if you have Python installed on your system. Open a terminal and run the following command:
python3 --version

If Python is not installed, you can install it by running:

sudo apt-get update
sudo apt-get install python3
  1. Next, install pip, the Python package manager. Run the following command:
sudo apt-get install python3-pip
  1. With pip, you can now install the AWS CLI. Run the following command:
pip3 install awscli
  1. To verify that the AWS CLI has been installed correctly, run the following command:
aws --version

How to change hostname on Amazon Linux 2 without reboot

recommended reading
  1. To use the AWS CLI, you need to configure your AWS access keys. Run the following command:
aws configure

This will prompt you for your AWS access key and secret key, as well as the default region and output format.

Verifying the Installation

The last step is to verify that the installation was successful. To do this, run the following command:
aws --version

If the installation was successful, you should see output similar to this:

aws-cli/1.11.68 Python/3.5.2 Linux/4.4.0-93-generic botocore/1.5.45

Congratulations, you have now successfully installed the AWS CLI on your Linux machine!

Notify of
Inline Feedbacks
View all comments