TL;DR
To install AWS CLI on Ubuntu, you can follow these steps:
- Check Ubuntu version:
lsb_release -a -Run this command in the Terminal to check the version of Ubuntu you are using. It will display the specific release information of your Ubuntu distribution. - Update package list:
sudo apt update -Execute this command to update the package list on your Ubuntu system. It ensures that you have the latest information about available packages and their versions. - Install Python:
sudo apt install python3 -Use this command to install Python, a widely used programming language required for running AWS CLI and its dependencies. Python provides the foundation for AWS CLI’s functionality. - Install AWS CLI using Pip:
pip3 install awscli --upgrade --user -This command installs AWS CLI using Pip, the package installer for Python. Pip fetches the latest version of AWS CLI and installs it specifically for the current user, upgrading any existing installation if necessary.
To configure AWS CLI after installation, generate AWS access credentials through the AWS Management Console, then use the aws configure command in the Terminal to set up AWS CLI with your access key ID, secret access key, default region, and output format. Be aware of common installation errors like “Command not found,” “Permission denied,” “Could not connect to the Internet,” and “Version conflict” to troubleshoot and ensure a successful installation.
Explore the step-by-step method to install AWS CLI on Ubuntu in the guide below. Also, learn about the common errors that can occur during installation.
AWS Command Line Interface (CLI) is a powerful tool that allows you to interact with AWS services through a command-line interface. By using the AWS CLI on Ubuntu, you can streamline your operations, automate tasks, and enhance your productivity. With AWS CLI, you can bid farewell to manual navigation through the AWS Management Console and embrace the power of command-line interactions. This comprehensive guide will walk you through the process of installing and configuring the AWS CLI on Ubuntu, enabling you to harness the full potential of AWS for your projects. In this guide, you will also learn about common errors that can occur during the installation.
How to Install AWS CLI on Ubuntu
To install AWS CLI on Ubuntu, ensure you have a supported version of Ubuntu installed and both Python and Pip installed on your system. Once these requirements are met, you can proceed with the installation process. Follow this step-by-step guide:
- Open a Terminal window.

- Enter the following command to check your Ubuntu version:
<strong>lsb_release -a</strong> - This command will display your Ubuntu version.

- Update the package list by opening a Terminal and running the command:
<strong>sudo apt update</strong> - This command will refresh the package list to ensure you have the latest versions available.

- Install Python by executing the following command:
<strong>sudo apt install python3</strong> - This command will install Python, a programming language required for AWS CLI.

- Verify the Python installation by checking the version:
<strong>python3 --version</strong> - This command will display the installed Python version.

- Install Pip, the package installer for Python, using the command:
<strong>sudo apt install python3-pip</strong> - This command will install Pip, which is necessary for managing Python packages.

- Verify the Pip installation by checking the version:
<strong>pip3 --version</strong> - This command will display the installed Pip version.

- Now you can install AWS CLI using Python and Pip, by running the following command to install AWS CLI using Pip:
<strong>pip3 install awscli --upgrade --user</strong> - This command will install AWS CLI on your Ubuntu system, specifically for the current user.

- To ensure that AWS CLI is installed correctly, you can check the version by running the following command in the Terminal:
<strong>aws --version</strong> - The command will display the installed AWS CLI version.

How to Configure AWS CLI
After successfully installing AWS Command Line Interface (CLI), the next crucial step is to configure it with your AWS access credentials. Configuring AWS CLI allows you to authenticate and interact with your AWS resources seamlessly. To authenticate with AWS CLI, you’ll need an AWS access key and secret access key. If you don’t have these credentials, follow these steps to generate them:
- Go to the AWS Management Console. Select Identity and Access Management (IAM) service, provide your registered ID, and then cleck on Next button. You can also create a new account by providing the credentials.

- Entering credentials to sign in.

- Now open the security credentials by clicking on the username on the top right corner of AWS Management Console.

- Navigate to the Users section in the IAM dashboard.

- Select the user to which you want to create the access key.

- Go to the security credentials tab of the user.

- Under the Security credentials tab, click Create access key.

- Now choose the use case for which you want to create the access key. In this case, I am selecting the command line interface.

- Now accept terms and conditions and click on the Next button to proceed further.

- Click on Create Access Key button to generate access key.

- Take note of the generated access key ID and secret access key.

- Configuring AWS CLI with Access Keys: Configure AWS CLI by running the following command in the Terminal: