The AWS Command Line Interface (CLI) is a powerful tool that enables you to manage your AWS services directly from the terminal. Whether you’re automating workflows or managing resources on the go, the AWS CLI can streamline your operations. In this guide, we’ll walk you through the steps to install the AWS CLI on Ubuntu 24.04 Noble Numbat.
Prerequisites
Before we start, ensure you have the following:
- A fresh installation of Ubuntu 24.04 Noble Numbat.
- A user account with sudo privileges.
- Basic knowledge of using the terminal.
Step 1: Update Your System
First, make sure your system is up-to-date by running the following commands:
$ sudo apt update
$ sudo apt upgrade -y
Step 2: Install Dependencies
The AWS CLI requires Python and pip
(Python’s package installer). Install these dependencies if they are not already installed:
$ sudo apt install python3 python3-pip -y
Step 3: Install the AWS CLI
With pip
installed, you can now install the AWS CLI using the following command:
$ pip3 install awscli --upgrade --user
The --upgrade
option ensures that any existing versions of AWS CLI are upgraded to the latest version, and the --user
option installs the AWS CLI for your user without requiring sudo.
Step 4: Add AWS CLI to Your PATH
To ensure that the AWS CLI can be accessed from any terminal session, you need to add it to your PATH. Add the following line to your ~/.bashrc
file:
$ echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
Then, reload your ~/.bashrc
file to apply the changes:
$ source ~/.bashrc
Step 5: Verify the Installation
To verify that the AWS CLI is installed correctly, check its version by running:
$ aws --version
You should see output similar to:
aws-cli/2.7.18 Python/3.10.4 Linux/5.15.0-58-generic botocore/2.4.8
The exact version numbers may vary, but as long as you see similar output, the installation was successful.
Step 6: Configure the AWS CLI
Before you can start using the AWS CLI, you need to configure it with your AWS credentials. Run the following command to start the configuration process:
$ aws configure
You’ll be prompted to enter your AWS Access Key ID, Secret Access Key, region, and output format:
AWS Access Key ID [None]: YOUR_ACCESS_KEY_ID
AWS Secret Access Key [None]: YOUR_SECRET_ACCESS_KEY
Default region name [None]: YOUR_PREFERRED_REGION
Default output format [None]: json
Replace YOUR_ACCESS_KEY_ID
, YOUR_SECRET_ACCESS_KEY
, and YOUR_PREFERRED_REGION
with your actual AWS credentials and preferred region. For the output format, you can choose json
, text
, or table
.
Step 7: Test Your Configuration
To ensure your configuration is working, you can run a simple AWS CLI command, such as listing your S3 buckets:
$ aws s3 ls
If everything is configured correctly, you should see a list of your S3 buckets.
Conclusion
Congratulations! You have successfully installed and configured the AWS CLI on Ubuntu 24.04 Noble Numbat. With the AWS CLI, you can now manage your AWS services efficiently directly from your terminal. Be sure to refer to the AWS CLI documentation for more detailed information and advanced usage.
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.