How to Install & Configure AWS CLI on Ubuntu

This guide will walk you through the steps to install and configure AWS CLI version 1 on Ubuntu (20.04).

Topics Covered:
1. Updating Local Packages
2. Installing AWS CLI on Ubuntu
3. Checking Installed AWS CLI Version
4. Configuring AWS Profile
5. Running AWS CLI Commands

1. Updating Local Packages

To start, update your local packages by running the following command:

# update local packages ubuntu
sudo apt-get update

2. Installing AWS CLI on Ubuntu

To install AWS CLI on your Ubuntu machine, run the following command:

# install awscli ubuntu
sudo apt-get install awscli

3. Checking Installed AWS CLI Version

After the installation is complete, check the version of AWS CLI installed by running:

# check version of awscli installed
aws --version
aws --version

4. Configuring Your AWS Profile

Once the installation is confirmed, set up your AWS profile by running the aws configure command as shown below.

You will need your AWS Access Key ID and Secret Access Key, which you can retrieve or create in the AWS IAM Console.

# configure aws profile
aws configure
aws configure

For reference, here are the output config files:

aws credentials config

5. Running AWS CLI Commands

Once your profile is set up, you can run AWS CLI commands. For example, the following command lists all S3 buckets in your AWS account that begin with the “pw-” prefix:

aws s3api list-buckets

Hope this was useful for you!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts
Categories
Tags

Always On Availability Groups (AAG) (4) AWS (4) AWS Redshift (6) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (72) Database Backups & Recovery (14) Database Mirroring (2) Deleting Data (1) Error Messages (5) Git Commands (6) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) MySQL (4) Postgres (6) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (15) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (6) SQL Server Permissions (2) SQL Server Processes (SPIDs) (7) SQL Server Replication (2) SQL Server Scripts (13) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (18)