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)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 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