Tools: Essential Guide: Configuring AWS CLI on Ubuntu for Local Machine ☁️🐧

Tools: Essential Guide: Configuring AWS CLI on Ubuntu for Local Machine ☁️🐧

Why AWS CLI?

Step 1: Update Packages

Step 2: Install Required Dependencies

Step 3: Download AWS CLI v2 Installer

Step 4: Unzip the Installer

Step 5: Run the Install Script

Step 6: Verify Installation

Step 7: Configure AWS CLI

Step 8: Verify Configured Profiles

Step 9: View Stored Credentials

Understanding the Files

credentials file

config file

Important Security Tip ⚠️

Conclusion When people start learning AWS, they usually focus only on installing the AWS CLI.

But installing it is just the first step. To actually interact with AWS services from your Ubuntu machine, you also need to configure AWS credentials properly. In this guide, we’ll go through the complete setup process for AWS CLI on Ubuntu — from installation to configuration and verification. AWS CLI allows you to manage AWS services directly from your terminal. Instead of clicking through the AWS Console every time, AWS CLI helps automate everything efficiently. First, update your system packages: This ensures your package manager has the latest repository information. Install curl and unzip: These tools are required to download and extract the AWS CLI installer. This downloads the latest AWS CLI v2 package for Ubuntu/Linux systems. This extracts the installation files. AWS CLI will now be installed on your machine. Check whether AWS CLI is installed successfully: Now comes the important part — configuration. You can generate Access Keys from: AWS Console → IAM → Users → Security Credentials → Create Access Key To check configured AWS profiles and settings: This helps verify whether your credentials and region are configured correctly. AWS stores credentials locally inside the .aws directory. Check credentials file: Also, add .aws/ to .gitignore if you're working inside projects. Installing AWS CLI is easy, but properly configuring it is what actually enables you to work with AWS services from your local Ubuntu machine. Once configured, you can automate cloud operations directly from the terminal and integrate AWS into scripts, CI/CD pipelines, and DevOps workflows. If you're starting your cloud or DevOps journey, AWS CLI is one of the most essential tools to learn 🚀 Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install unzip -weight: 500;">curl -y -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install unzip -weight: 500;">curl -y -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install unzip -weight: 500;">curl -y -weight: 500;">curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -weight: 500;">curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -weight: 500;">curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip unzip awscliv2.zip unzip awscliv2.zip -weight: 600;">sudo ./aws/-weight: 500;">install -weight: 600;">sudo ./aws/-weight: 500;">install -weight: 600;">sudo ./aws/-weight: 500;">install aws --version aws --version aws --version aws configure aws configure aws configure AWS Access Key ID AWS Secret Access Key Default region name Default output format AWS Access Key ID AWS Secret Access Key Default region name Default output format AWS Access Key ID AWS Secret Access Key Default region name Default output format AWS Access Key ID [None]: AKIAXXXXX AWS Secret Access Key [None]: ******** Default region name [None]: ap-south-1 Default output format [None]: json AWS Access Key ID [None]: AKIAXXXXX AWS Secret Access Key [None]: ******** Default region name [None]: ap-south-1 Default output format [None]: json AWS Access Key ID [None]: AKIAXXXXX AWS Secret Access Key [None]: ******** Default region name [None]: ap-south-1 Default output format [None]: json aws configure list aws configure list aws configure list cat ~/.aws/credentials cat ~/.aws/credentials cat ~/.aws/credentials cat ~/.aws/config cat ~/.aws/config cat ~/.aws/config [default] aws_access_key_id = XXXXX aws_secret_access_key = XXXXX [default] aws_access_key_id = XXXXX aws_secret_access_key = XXXXX [default] aws_access_key_id = XXXXX aws_secret_access_key = XXXXX [default] region = ap-south-1 output = json [default] region = ap-south-1 output = json [default] region = ap-south-1 output = json - Launch EC2 instances - Upload files to S3 - Configure IAM - Manage EKS clusters - Automate cloud operations using scripts - Access Key ID - Secret Access Key - Default region - Output format - Access Key ID - Secret Access Key - .aws/credentials file