The AWS Command Line Interface (CLI) is a tool that allows you to manage AWS services from the command line. This guide will walk you through the steps of installing AWS CLI version 2 on Ubuntu 24.04.
Step 1: Update Your System
- Before installing AWS CLI, make sure your system is up-to-date by running the following commands:
sudo apt update && sudo apt upgrade -y
Step 2: Install Prerequisites
- Ensure that your system has curl and unzip installed. If they are not already installed, run:
sudo apt install curl unzip -y
Step 3: Download the AWS CLI Installer
- Download the AWS CLI version 2 installer using the following command:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Step 4: Unzip the AWS CLI Installer
- Extract the downloaded zip file:
unzip awscliv2.zip
Step 5: Install the AWS CLI
- After extracting, run the installer with root privileges:
sudo ./aws/install
Step 6: Verify the Installation
- To confirm the AWS CLI is installed correctly, check the version by running:
aws --version
You should see output similar to aws-cli/2.x.x, indicating that AWS CLI is installed successfully.
Step 7: Configure AWS CLI
- Before using the AWS CLI, you need to configure it with your AWS credentials. Run the following command:
aws configure
You will be prompted to provide the following information:
- Access Key ID: Enter your AWS Access Key ID.
- Secret Access Key: Enter your AWS Secret Access Key.
- Default region name: Enter your preferred AWS region (e.g.,
us-east-1). - Default output format: Choose
json,text, ortable.
Step 8: Remove the Installer Files (Optional)
- After installation, you can remove the downloaded files to clean up your system:
rm -rf awscliv2.zip aws
Conclusion
You’ve successfully installed and configured the AWS CLI on Ubuntu 24.04. You can now use the AWS CLI to manage your AWS services directly from the terminal.