macOS install Amazon AWS command-line interface (CLI) tool

How do I setup and install the official Amazon AWS Command Line Interface (cli) on an Apple macOS or Mac OS X system?

The official or universal command line interface for Amazon Web Services recommended tool for the AWS. There are various ways to install the AWS CLI on macOS.


You must have Python installed on the system. The aws cli package works on Python versions:

  • 2.6.5+
  • 2.7.x+
  • 3.3.x+
  • 3.4.x+

Finding out your Python version

Open the Terminal and type the following command:
$ python --version
$ sw_vers

Sample outputs:

Fig.01: OS X Find Out Python Version

Fig.01: OS X Find Out Python Version

Method #1: Install the aws-cli using brew on macOS

First, install Homebrew on macOS and then type the following command:
$ brew install awscli
Add the following to ~/.bashrc to enable bash completion for aws command:

 echo 'complete -C aws_completer aws' >> ~/.bashrc

Add the following to ~/.zshrc to enable zsh completion:

 echo 'source /usr/local/share/zsh/site-functions/_aws' >> ~/.zshrc

Method #2: Install the aws-cli using the official Amazon installer

Type the following command:
$ cd /tmp
$ curl -o

    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16.8M  100 16.8M    0     0  3837k      0  0:00:04  0:00:04 --:--:-- 3837k

Unzip the file:
$ unzip

  inflating: awscli-bundle/install   
  inflating: awscli-bundle/packages/rsa-3.4.2.tar.gz  
  inflating: awscli-bundle/packages/docutils-0.15.2.tar.gz  
  inflating: awscli-bundle/packages/futures-3.3.0.tar.gz  
  inflating: awscli-bundle/packages/PyYAML-5.2.tar.gz  
  inflating: awscli-bundle/packages/colorama-0.4.1.tar.gz  
  inflating: awscli-bundle/packages/botocore-1.19.58.tar.gz  
  inflating: awscli-bundle/packages/urllib3-1.25.7.tar.gz  
  inflating: awscli-bundle/packages/six-1.15.0.tar.gz  
  inflating: awscli-bundle/packages/jmespath-0.10.0.tar.gz  
  inflating: awscli-bundle/packages/virtualenv-16.7.8.tar.gz  
  inflating: awscli-bundle/packages/colorama-0.4.3.tar.gz  
  inflating: awscli-bundle/packages/urllib3-1.26.2.tar.gz  
  inflating: awscli-bundle/packages/PyYAML-5.3.1.tar.gz  
  inflating: awscli-bundle/packages/python-dateutil-2.8.0.tar.gz  
  inflating: awscli-bundle/packages/s3transfer-0.3.4.tar.gz  
  inflating: awscli-bundle/packages/pyasn1-0.4.8.tar.gz  
  inflating: awscli-bundle/packages/awscli-1.18.218.tar.gz  
  inflating: awscli-bundle/packages/setup/wheel-0.33.6.tar.gz  
  inflating: awscli-bundle/packages/setup/setuptools_scm-3.3.3.tar.gz

Install it:
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Sample outputs:

Running cmd: /usr/local/opt/python/bin/python2.7 --python /usr/local/opt/python/bin/python2.7 /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-index --find-links file:///private/tmp/awscli-bundle/packages awscli-1.10.1.tar.gz
Symlink already exists: /usr/local/bin/aws
Removing symlink.
You can now run: /usr/local/bin/aws --version

How do I use the aws-cli?

You must have an AWS account. Visit

Create the AWS access key ID and secret access key

  1. Visit the IAM console
  2. Select your IAM user name.
  3. Select the Security Credentials tab and then Create Access Key.

Sample outputs:

Fig.02:  Get your access key ID and secret access key

Fig.02: Get your access key ID and secret access key

To see your access key, choose Show User Security Credentials.
Fig.03: Choose Download Credentials, and store the keys in a secure location

Fig.03: Choose Download Credentials, and store the keys in a secure location

Configure the aws-cli

Type the following command and when prompted enter the AWS Access Key ID and AWS Secret Access Key:
$ aws configure
Sample outputs:

Fig.04: aws configure in action

Fig.04: aws configure in action

Now you can use the aws command to control your cloud hosted by the Amazon AWS. The syntax is:
$ aws command
$ aws help
$ aws ec2 help
## examples ##
$ aws ec2 describe-instances --output table
$ aws --region=us-east-1 acm list-certificates
$ aws --region=us-east-1 acm list-certificates --certificate-statuses ISSUED


You learned how to install aws-cli on macOS using various methods. See Using the AWS Command Line Interface for more information.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • Pradeep Kumar Feb 4, 2016 @ 2:44

    Very nice. It really helped me a lot.

  • Asad May 26, 2016 @ 12:42


  • Dee Dee Jun 17, 2017 @ 0:13

    So I have the AWS CLI installed on my Mac running el Capitan. I am pleased with my initial testing of entering commands. I really need to be able to run the commands as a shell script so that I can run them unattended. But I get errors each time I attempt to run my command line as a shell script.

    Can anyone offer advice on this, please?
    Thank you very much for your time and assistance.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum