Installing the AWS CLI
What is the AWS CLI?
The AWS CLI (command line interface) is an application you can install to manage an AWS cloud environment programmatically. It is open source, although it is developed and managed by AWS directly. It is available for a wide variety of operating systems and there are tools and SDKs for many programming languages. See AWS Documentation here for more information on the AWS CLI.
Installing the AWS CLI
With the many different SDKs and operating systems supported by the AWS CLI, this guide will not cover all options. Instead, a few of the most common use cases will be covered. See AWS documentation for additional guides on how to install the AWS CLI if you don't find what you're looking for here.
Windows with Setup File
- Download the AWS CLI setup file.
- Run the setup program and follow the prompts.
- Open a command window and enter
aws --version
to verify the installation succeeded. It should look similar to the below example, although your version number may be different.
C:\>
aws --version
aws-cli/1.16.116 Python/3.6.8 Windows/10 botocore/1.12.106
Linux or Mac with Bundled Installer
MacOS requires Python 2.6.5+ or Python 3.3+ to be installed prior to the AWS CLI. Be sure you have that installed by running python --version in a terminal window.
- Download the AWS CLI Bundled Installer.
- Extract the package.
- Open a terminal window and navigate to inside the extracted folder.
- Run the Installer with the following command:
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
Install with pip - Cross Platform
Pip is a python package manager that provides tools to manage installed python libraries. It can be used to install the AWS CLI as well as many other python packages. Pip requires Python so be sure Python is available first. Python is available on Windows, Mac, and Linux from the python.org website. Python is also available through most Linux package managers or installed by default.
Steps:
- Download the get-pip.py script from `pypa.io`.
- Use python to run the script.
- Use pip to install the AWS CLI.
Code:
Install pip
python get-pip.py --user
Alternatively, install with Python3 instead
python3 get-pip.py --user
Install AWS CLI
pip install awscli --upgrade --user
Alternatively, install with pip3 to use the Python3 version instead
pip3 install awscli --upgrade --user