0
0
AWScloud~5 mins

Installing AWS CLI - Step-by-Step CLI Walkthrough

Choose your learning style9 modes available
Introduction
Installing the AWS CLI lets you control AWS services from your computer using simple commands. This helps you manage cloud resources without using the web browser.
When you want to create or manage AWS resources quickly from your computer.
When you need to automate AWS tasks using scripts.
When you want to check the status of your AWS services without logging into the AWS website.
When you want to upload or download files to AWS storage from the command line.
When you want to configure AWS settings for your projects on your local machine.
Commands
Download the AWS CLI version 2 installer zip file for Linux 64-bit systems.
Terminal
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Expected OutputExpected
No output (command runs silently)
Extract the downloaded AWS CLI installer files from the zip archive.
Terminal
unzip awscliv2.zip
Expected OutputExpected
Archive: awscliv2.zip inflating: aws/install inflating: aws/dist/awscli-exe-linux-x86_64.zip inflating: aws/dist/awscli-exe-linux-x86_64.zip.sig inflating: aws/dist/awscli-exe-linux-x86_64.zip.sha256
Run the AWS CLI installer script with administrator rights to install the AWS CLI on your system.
Terminal
sudo ./aws/install
Expected OutputExpected
Installing AWS CLI version 2... AWS CLI version 2 installed successfully.
Check the installed AWS CLI version to confirm the installation was successful.
Terminal
aws --version
Expected OutputExpected
aws-cli/2.13.10 Python/3.11.4 Linux/5.15.0-1051-azure exe/x86_64.ubuntu.22 prompt/off
Key Concept

If you remember nothing else, remember: downloading, extracting, installing, and verifying are the four key steps to install AWS CLI.

Common Mistakes
Skipping the unzip step and trying to run the installer directly from the zip file.
The installer script is inside the zip file and cannot run without extracting first.
Always unzip the downloaded file before running the installer.
Running the install command without sudo or administrator rights.
Installation requires permission to write files to system directories, which fails without admin rights.
Use sudo or run as administrator to install AWS CLI.
Not verifying the installation with 'aws --version' after installing.
You might think installation succeeded but the CLI may not be properly installed or in your PATH.
Always run 'aws --version' to confirm the CLI is installed and accessible.
Summary
Download the AWS CLI installer zip file using curl.
Extract the installer files using unzip.
Run the installer script with sudo to install AWS CLI.
Verify the installation by checking the AWS CLI version.