DEV Community

Cover image for Installing AWS CLI v2

Installing AWS CLI v2

The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

Here’s a complete guide for installing the AWS Command Line Interface (CLI) on major platforms:

For Windows

  1. Download the installer:
  1. Run the downloaded .msi file and follow the setup wizard.

  2. Verify installation:

   aws --version
Enter fullscreen mode Exit fullscreen mode

You should see something like:

   aws-cli/2.x.x Python/X.x.x Windows/x86_64
Enter fullscreen mode Exit fullscreen mode

For macOS

Using the official installer:

  1. Download the installer:
   curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
Enter fullscreen mode Exit fullscreen mode
  1. Install it:
   sudo installer -pkg AWSCLIV2.pkg -target /
Enter fullscreen mode Exit fullscreen mode
  1. Verify installation:
   aws --version
Enter fullscreen mode Exit fullscreen mode

Or, using Homebrew (if installed):

brew install awscli
Enter fullscreen mode Exit fullscreen mode

For Linux

  1. Download and unzip the installer:
   curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
   unzip awscliv2.zip
Enter fullscreen mode Exit fullscreen mode
  1. Install it:
   sudo ./aws/install
Enter fullscreen mode Exit fullscreen mode
  1. Verify:
   aws --version
Enter fullscreen mode Exit fullscreen mode

Post-install: Configure AWS CLI

After installation, configure with your AWS credentials:

aws configure
Enter fullscreen mode Exit fullscreen mode

You’ll be prompted for:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name (e.g., us-east-1)
  • Default output format (e.g., json, table, text)

Resources

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.