AWS Command Line Interface
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Install the AWS CLI on Amazon Linux

The AWS Command Line Interface (AWS CLI) comes preinstalled on Amazon Linux and Amazon Linux 2. Check the currently installed version by using the following command.

$ aws --version aws-cli/1.16.116 Python/3.6.8 Linux/4.14.77-81.59.amzn2.x86_64 botocore/1.12.106


Using sudo to complete a command grants the command full access to your system. We recommend using that command only when no more secure option exists. For commands like pip, we recommend that you avoid using sudo by using a Python virtual environment (venv) or by specifying the --user option to install in the user's folders instead of the system's folders.

If you use the yum package manager, you can install the AWS CLI with the command: yum install aws-cli. You can use the command: yum update to get the latest version available in the yum repository.


The yum repository is not owned or maintained by Amazon and might not contain the latest version. Instead, we recommend that you use pip to get the latest version.


Verify that Python and pip are already installed. For more information, see Install the AWS CLI on Linux.

To install or upgrade the AWS CLI on Amazon Linux (user)

  1. Use pip3 install to install the latest version of the AWS CLI. We recommend that if you have Python version 3+ installed that you use pip3. If you run the command from within a Python virtual environment (venv), then you don't need to use the --user option.

    $ pip3 install --upgrade --user awscli
  2. Add the install location to the beginning of your PATH variable.

    $ export PATH=/home/ec2-user/.local/bin:$PATH

    Add this command to the end of your profile's startup script (for example, ~/.bashrc) to persist the change between command line sessions.

  3. Verify that you're running new version with aws --version.

    $ aws --version aws-cli/1.16.116 Python/3.6.8 Linux/4.14.77-81.59.amzn2.x86_64 botocore/1.12.106