DEV Community

Cover image for Install AWS CLI (Command Line Interface) on Ubuntu
Md Abu Musa
Md Abu Musa

Posted on

Install AWS CLI (Command Line Interface) on Ubuntu

To install the AWS CLI (Command Line Interface) on Ubuntu, follow these steps:


1. Update the Package Index

Run the following command to ensure your package list is up-to-date:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

2. Install Dependencies

Ensure you have the necessary dependencies installed:

sudo apt install -y unzip curl
Enter fullscreen mode Exit fullscreen mode

3. Download the AWS CLI Installer

Use curl to download the AWS CLI v2 installer:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Enter fullscreen mode Exit fullscreen mode

4. Extract the Installer

Unzip the downloaded file:

unzip awscliv2.zip
Enter fullscreen mode Exit fullscreen mode

5. Run the Installer

Run the installation script:

sudo ./aws/install
Enter fullscreen mode Exit fullscreen mode

6. Verify the Installation

Confirm that the AWS CLI is installed and check its version:

aws --version
Enter fullscreen mode Exit fullscreen mode

You should see output similar to:

aws-cli/2.x.x Python/x.x.x Linux/x.x.x
Enter fullscreen mode Exit fullscreen mode

7. Clean Up

(Optional) Remove the downloaded files to free up space:

rm -rf awscliv2.zip aws
Enter fullscreen mode Exit fullscreen mode

8. Configure the AWS CLI

Set up your AWS credentials:

aws configure
Enter fullscreen mode Exit fullscreen mode

You’ll need to provide:

  • Access Key ID
  • Secret Access Key
  • Default region (e.g., us-east-1)
  • Output format (e.g., json, text, or table)

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay