How to Install AWS CLI on Ubuntu
Installing the AWS Command Line Interface (CLI) on Ubuntu lets you manage Amazon Web Services directly from your computer’s command line.
The AWS CLI acts like a powerful remote control for services such as S3 (for storing files) and EC2 (for virtual servers), making it easy to automate tasks.
This guide shows you how to install version 2 of the AWS CLI on your Ubuntu machine. This is the most current and stable version available.
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 AWS CLI on Ubuntu using the official installer from Amazon. First, download the zip file using the ‘curl’ command, then ‘unzip’ it. Finally, run the install command to set up the AWS Command Line Interface on your system.
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.
To confirm the AWS Command Line Interface (AWS CLI) installation, run `aws –version` in your terminal to check the AWS CLI version. This command displays the installed version number, confirming the software is ready for use with your AWS services.
aws --version
Install AWS CLI via Python PiP
Installing AWS CLI on Ubuntu using Python’s PiP offers a strong alternative, especially if you already have Python configured. This method uses the Python Package Installer (PIP) to add the AWS CLI tools to your system, letting you manage AWS services from your terminal.
sudo apt update
This command updates the package lists, preparing your system for upgrades and new installations.
Install Python and PIP
The AWS Command Line Interface (AWS CLI) requires Python and PIP (Python Package Installer) for installation. You can install these prerequisites by running the command `sudo apt update && sudo apt install python3-pip awscli -y` in your terminal.
sudo apt install python3 python3-pip -y
Install AWS CLI using PIP
You can install or upgrade the AWS Command Line Interface (CLI) using PIP by executing the following command: `sudo apt install awscli`. This command updates the AWS CLI to its latest version on your Ubuntu system.
sudo pip3 install --upgrade awscli
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 you install the AWS CLI on Ubuntu, you need to configure it with your AWS account details. Running the ‘aws configure’ command will prompt you to enter your Access Key ID, Secret Access Key, default region, and output format, allowing you to start using AWS services.
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!