<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Madhav Nakra</title>
    <description>The latest articles on DEV Community by Madhav Nakra (@madhavnakra).</description>
    <link>https://dev.to/madhavnakra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3944547%2F1dded4cf-b050-4ed7-9d21-795782aeacad.jpg</url>
      <title>DEV Community: Madhav Nakra</title>
      <link>https://dev.to/madhavnakra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/madhavnakra"/>
    <language>en</language>
    <item>
      <title>Configuring AWS CLI on Ubuntu for Local Machine ☁️🐧</title>
      <dc:creator>Madhav Nakra</dc:creator>
      <pubDate>Thu, 21 May 2026 17:26:05 +0000</pubDate>
      <link>https://dev.to/madhavnakra/configuring-aws-cli-on-ubuntu-for-local-machine-5elf</link>
      <guid>https://dev.to/madhavnakra/configuring-aws-cli-on-ubuntu-for-local-machine-5elf</guid>
      <description>&lt;p&gt;When people start learning AWS, they usually focus only on installing the AWS CLI.&lt;br&gt;
But installing it is just the first step.&lt;/p&gt;

&lt;p&gt;To actually interact with AWS services from your Ubuntu machine, you also need to configure AWS credentials properly.&lt;/p&gt;

&lt;p&gt;In this guide, we’ll go through the complete setup process for AWS CLI on Ubuntu — from installation to configuration and verification.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why AWS CLI?
&lt;/h2&gt;

&lt;p&gt;AWS CLI allows you to manage AWS services directly from your terminal.&lt;/p&gt;

&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launch EC2 instances&lt;/li&gt;
&lt;li&gt;Upload files to S3&lt;/li&gt;
&lt;li&gt;Configure IAM&lt;/li&gt;
&lt;li&gt;Manage EKS clusters&lt;/li&gt;
&lt;li&gt;Automate cloud operations using scripts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of clicking through the AWS Console every time, AWS CLI helps automate everything efficiently.&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 1: Update Packages
&lt;/h2&gt;

&lt;p&gt;First, update your system packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures your package manager has the latest repository information.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Install Required Dependencies
&lt;/h2&gt;

&lt;p&gt;Install &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;unzip&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unzip curl &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These tools are required to download and extract the AWS CLI installer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Download AWS CLI v2 Installer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"awscliv2.zip"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This downloads the latest AWS CLI v2 package for Ubuntu/Linux systems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg4u0m4kan12svme29j8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbg4u0m4kan12svme29j8.png" alt=" " width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Unzip the Installer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;unzip awscliv2.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This extracts the installation files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Run the Install Script
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./aws/install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AWS CLI will now be installed on your machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Verify Installation
&lt;/h2&gt;

&lt;p&gt;Check whether AWS CLI is installed successfully:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw2fyc22q8fq5z20yu14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw2fyc22q8fq5z20yu14.png" alt=" " width="797" height="109"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 7: Configure AWS CLI
&lt;/h2&gt;

&lt;p&gt;Now comes the important part — configuration.&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll be asked for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;AWS Access Key ID
AWS Secret Access Key
Default region name
Default output format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;AWS Access Key ID &lt;span class="o"&gt;[&lt;/span&gt;None]: AKIAXXXXX
AWS Secret Access Key &lt;span class="o"&gt;[&lt;/span&gt;None]: &lt;span class="k"&gt;********&lt;/span&gt;
Default region name &lt;span class="o"&gt;[&lt;/span&gt;None]: ap-south-1
Default output format &lt;span class="o"&gt;[&lt;/span&gt;None]: json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can generate Access Keys from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AWS Console → IAM → Users → Security Credentials → Create Access Key&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 8: Verify Configured Profiles
&lt;/h2&gt;

&lt;p&gt;To check configured AWS profiles and settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps verify whether your credentials and region are configured correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 9: View Stored Credentials
&lt;/h2&gt;

&lt;p&gt;AWS stores credentials locally inside the &lt;code&gt;.aws&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Check credentials file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.aws/credentials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.aws/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5xbt1zmtfqdzblyq7cy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5xbt1zmtfqdzblyq7cy.png" alt=" " width="799" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Files
&lt;/h2&gt;

&lt;h3&gt;
  
  
  credentials file
&lt;/h3&gt;

&lt;p&gt;Stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access Key ID&lt;/li&gt;
&lt;li&gt;Secret Access Key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[default]&lt;/span&gt;
&lt;span class="py"&gt;aws_access_key_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;XXXXX&lt;/span&gt;
&lt;span class="py"&gt;aws_secret_access_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;XXXXX&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  config file
&lt;/h3&gt;

&lt;p&gt;Stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Default region&lt;/li&gt;
&lt;li&gt;Output format&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[default]&lt;/span&gt;
&lt;span class="py"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;ap-south-1&lt;/span&gt;
&lt;span class="py"&gt;output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Important Security Tip ⚠️
&lt;/h2&gt;

&lt;p&gt;Never share:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access Key ID&lt;/li&gt;
&lt;li&gt;Secret Access Key&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.aws/credentials&lt;/code&gt; file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, add &lt;code&gt;.aws/&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt; if you're working inside projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Installing AWS CLI is easy, but properly configuring it is what actually enables you to work with AWS services from your local Ubuntu machine.&lt;/p&gt;

&lt;p&gt;Once configured, you can automate cloud operations directly from the terminal and integrate AWS into scripts, CI/CD pipelines, and DevOps workflows.&lt;/p&gt;

&lt;p&gt;If you're starting your cloud or DevOps journey, AWS CLI is one of the most essential tools to learn 🚀&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>ubuntu</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
