DEV Community

Cover image for 🚀 How to Configure AWS CLI for the First Time
Felix Jumason
Felix Jumason

Posted on

🚀 How to Configure AWS CLI for the First Time

If you’re starting your cloud journey with Amazon Web Services (AWS), one of the first things you’ll want to set up is the AWS Command Line Interface (CLI). The AWS CLI lets you manage your AWS services directly from your terminal — faster and more scriptable than clicking around in the console.

In this guide, I’ll walk you through configuring AWS CLI for the very first time.
**

✅ Step 1: Install AWS CLI**

First, make sure the AWS CLI is installed on your system.

  • Linux / macOS:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Enter fullscreen mode Exit fullscreen mode
aws --version

Enter fullscreen mode Exit fullscreen mode

Step 2: Create an IAM User

For security reasons, don’t use the root AWS account. Instead:
Log into the AWS Management Console.
Go to IAM → Users → Add user.
Create a new user with programmatic access.
Attach permissions (you can start with AdministratorAccess for testing, but use least privilege in real projects).

Go to IAM → Users → Add user.
For me I already have some users added but if it is you first time it will be blank.
Click create user
Go to IAM → Users → Add user.

User Details
Give your user a unique user name
you can give the user AWS management console but its not best practice so I wont give my new users

user

*Add user to a group *
User groups are best-practice way to manage user's permissions by job functions.
For this user I will add him to the admin group

user

For this user I will add him to the admin group

user group

Hurrah you have successfully created a user

image

Now we want to get access Key and Access secret
click on the user and it will open a similar page like below.

cli
Here click on the CLI one

blurry keys

Lets go back to our local terminal to configure AWS

✅ Step 3: Run aws configure

aws configure

Enter fullscreen mode Exit fullscreen mode

It will ask you for four inputs:

  1. *AWS Access Key ID *→ Paste your key.
  2. AWS Secret Access Key → Paste your secret.
  3. Default region name → Example: us-east-1, eu-west-1, ap-south-1.
  4. Default output format → Options: json, table, or text. (json is recommended).

cli
.

✅ Step 4: Verify Configuration

To check if everything works, run:

aws s3 ls

Enter fullscreen mode Exit fullscreen mode

If you have S3 buckets, you’ll see them listed. If not, it should return nothing but** no error means** your setup is successful! 🎉

s3

Top comments (0)