How to Install AWS CLI on Ubuntu
You install the AWS Command Line Interface (CLI) on Ubuntu by downloading and running the official installer package.
The AWS CLI is a crucial tool that lets you manage your Amazon Web Services resources directly from your command line, enabling efficient scripting and automation for services like S3 and EC2.
This guide will walk you through the straightforward process of installing AWS CLI version 2, the latest stable release, on your Ubuntu system. You’ll have it operational in just a few steps.
You install the AWS CLI on Ubuntu by downloading the official installer package from Amazon and running it with unzip and the install script. Alternatively, you can use apt install awscli or pip3 install awscli. Verify the installation with aws –version.
Install AWS CLI from Ubuntu’s repository
The easiest way to install AWS CLI is from Ubuntu’s Universe repository, although it may not be the latest version.
Open the terminal and run the command below.
sudo apt install awscli
Once installed, run the command below to verify if AWS CLI is installed.
aws --version
Install AWS CLI from Amazon
You can install the AWS CLI directly from Amazon on Ubuntu by first downloading the installer zip file and then running the installation commands.
sudo apt install curl unzip curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Next, run the commands below to extract and install the downloaded file.
unzip awscliv2.zip sudo ./aws/install
To confirm that the AWS CLI is installed correctly, run the following command to check its version:
aws --version
Install AWS CLI via Python PiP
Installing the AWS CLI using Python’s package installer, PiP, is another common method on Ubuntu, especially if you already have Python set up.
sudo apt update
This command will update the package lists for upgrades and new installations.
Install Python and PIP
The AWS CLI is built with Python, so we must install Python and PIP (Python Package Installer) as prerequisites. Run the following command in the terminal:
sudo apt install python3 python3-pip -y
Install AWS CLI using PIP
Now, we can install the AWS CLI using PIP. Execute the following command to install or upgrade the AWS CLI:
sudo pip3 install --upgrade awscli
This command will install the AWS CLI globally on your system.
Verify the Installation
To confirm that the AWS CLI is installed correctly, run the following command to check its version:
aws --version
If the installation was successful, you will see the version information displayed in the terminal.
Configuring AWS CLI
After installing the AWS CLI on Ubuntu, you’ll need to configure it with your AWS account details, like access keys and your default region, using a simple command.
aws configure
You will be asked to enter your AWS Access Key ID, Secret Access Key, default region, and default output format. Provide the necessary information based on your AWS account configuration.
Conclusion
- The AWS CLI is a powerful tool that allows you to manage AWS services from the command line
- You can install the AWS CLI on Ubuntu Linux using various methods such as Ubuntu’s Universe repository, direct download from AWS, or via Python PIP
- After installation, verify the installation and configure the AWS CLI with your AWS account access keys
- With the AWS CLI successfully installed and configured, you can begin efficiently managing various AWS services directly from your terminal
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!