How to install and use AWS CLI – Your Ultimate Guide for Windows, Mac and Linux

In the swiftly evolving tech world, mastering the AWS Command Line Interface (AWS CLI) has become a non-negotiable skill for developers and IT professionals. AWS CLI stands as a bridge to managing Amazon Web Services’ resources, enabling direct command-line access across various operating systems. This comprehensive guide will escort you through the seamless setup of AWS CLI on Linux, macOS, and Windows, ensuring you’re equipped to harness the full potential of AWS services.

📌 Section 1: Setting Up AWS CLI

🖥️ Installing AWS CLI Across OS

  • For Windows Users:
    1. Launch the terminal.
    2. Download and execute the AWS CLI MSI installer for Windows (64-bit) from here.
      • Alternatively, employ the msiexec.exe command for installation:
        msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
    3. Confirm the installation with aws --version. You should see the AWS CLI version displayed, confirming a successful setup.
  • For Linux Users (x86_64/ARM):
    1. Open your terminal.
    2. Install AWS CLI using the following:
      • x86_64:
        curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
        unzip awscliv2.zip
        sudo ./aws/install
      • ARM:
        curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
        unzip awscliv2.zip
        sudo ./aws/install
  • For macOS Users:
    1. GUI installer:
      • Download the macOS pkg file here.
      • Execute the downloaded file and follow the prompts. Install AWS CLI globally or in a specified folder, with a symlink created at /usr/local/bin/aws.
    2. Command line (for all users):
      curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
      sudo installer -pkg AWSCLIV2.pkg -target /
    3. Validate the installation with $ which aws and $ aws --version to ensure your system recognizes the AWS CLI.

📌 Section 2: Configuring AWS CLI

To begin interacting with your AWS account, configure AWS CLI by typing aws configure in your terminal. You’ll need to enter your AWS Access Key ID, Secret Access Key, preferred region, and output format.

Here is the step-by-step Screenshots:

Login to your AWS Console:  Clicke here to login AWS Console

Go to Seachbar and Search for IAM :

Now, In IAM follow the Screenshot:

Screenshot:

Screenshot:

Screenshot:


Now, Let’s configure the AWS CLI:
Screenshot:

📌 Section 3: Mastering Commands with AWS CLI

Dive into these basic commands to kickstart your AWS CLI journey:

  • Creating an S3 Bucket:
    aws s3 mb s3://<bucket-name>
    Screenshot:
  • Listing S3 Buckets:
    aws s3 ls
    Screenshot:
    AWS console S3 bucket Screenshot:
  • Launching an EC2 Instance:
    aws ec2 run-instances --image-id <AMI-ID> --instance-type <instance-type> --key-name <key-name> --subnet-id <subnet-id>

    Screenshot:

  • Enumerating EC2 Instances:
    aws ec2 describe-instances
    Screenshot:
    AWS console EC2 instance Screenshot:

🌟 Conclusion

Navigating through AWS CLI setup and command execution across Linux, macOS, and Windows has never been easier. By embracing the insights and steps outlined in this guide, you’re well on your way to optimizing your AWS management tasks. AWS CLI not only enhances your productivity but also empowers you to navigate the vast cloud computing landscape with agility and confidence. Here’s to mastering AWS CLI—your key to unlocking the full potential of cloud resources. Happy coding! 🚀✨

Expert IT Consultation

Schedule a discussion with our IT specialists. Whether it's system upgrades, security, or digital transformation, our experts can help you navigate the IT landscape successfully.

Related

Top 5 commands to boost system performance on Linux

In the dynamic realm of Linux administration, unlocking the...

5 Essential Steps to Secure Your AWS Cloud Infrastructure 🛡️

In today's digital landscape, securing your AWS (Amazon Web...

How to prevent ransomware attack

Ransomware attacks have become increasingly sophisticated, posing a significant...

Amazon adds CIS Benchmark assessment option for AWS Inspector service

In the expansive realm of AWS services, Inspector has...

How to install Jenkins on Windows, Linux and MacOS

Jenkins is a powerful open-source automation server, widely used...