> Source: https://meetrix.io/blogs/install-aws-cli/
> Markdown copy of that page. Cite the URL above, not this file.

Development

# Pip Install AWS CLI: Why You Get v1 and How to Install v2

[By Buddhika Jayawardhana](https://meetrix.io/blogs/authors/buddhika-jayawardhana/) • September 15, 2026 • 6 min read

The first version of this guide, written in 2018, installed the AWS CLI with `pip` on Ubuntu 16.04. That was the normal way to do it then. It is the wrong way now, and plenty of people still search for exactly that command, so this rewrite starts with why.

## Install AWS CLI using pip: what you actually get

`pip install awscli` installs **AWS CLI version 1**. Always. The `awscli` package on PyPI is v1, and AWS ships version 2 only through its own installers, never through PyPI. That is why "install aws cli python" and "aws cli pip" searches land people on a version that is on its way out.

That used to be a style preference. It is not any more:

|  | AWS CLI v1 (pip) | AWS CLI v2 (official installer) |
| --- | --- | --- |
| Status | Maintenance mode since August 2026, end of support July 15, 2027 | Current, gets new services and regions |
| Python | Uses your system Python and its packages | Bundles its own Python, no conflicts with your projects |
| IAM Identity Center (SSO) sign-in | Not available | `aws configure sso` with IAM Identity Center |
| Updates | `pip install --upgrade awscli` | `aws update` |

### Pip install AWS CLI 2: there is no official package

You will also find a package called `awscliv2` on PyPI. It is a third-party wrapper that downloads and runs the real v2 binary, not something AWS publishes. It works, but I would not put it on a production host when the official installer is a single command. The details of the v1 timeline are in the [AWS CLI v1 maintenance mode announcement](https://github.com/aws/aws-cli/issues/9994).

If pip already put v1 on the machine, remove it first so the two binaries don't fight over the `aws` command:

```bash
pip uninstall -y awscli
sudo apt remove -y awscli   # only if it came from apt
which -a aws                # should print nothing now
```

## Install AWS CLI v2 on Ubuntu and Linux

AWS now ships an install script that downloads, verifies and installs the CLI in one step, for both x86 and ARM. Installing for all users on a server:

```bash
curl -fsSL https://awscli.amazonaws.com/v2/install.sh | sudo bash -s -- --system
aws --version
```

Without `--system` it installs for your user only, under `~/.local/share/aws-cli` with the binary linked into `~/.local/bin`. That is the better choice on a shared workstation.

If you want to pin a specific version, which matters in CI images, use the zip installer instead. It needs `unzip`, which a minimal Ubuntu 24.04 or 26.04 image does not have:

```bash
sudo apt install -y unzip curl
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip
unzip awscliv2.zip
sudo ./aws/install
aws --version
```

On ARM machines such as Graviton instances or a Raspberry Pi running 64-bit Ubuntu, swap the file name for `awscli-exe-linux-aarch64.zip`. And if you would rather never think about updates, `sudo snap install aws-cli --classic` is an AWS-supported option that refreshes itself, at the cost of not being able to pin a minor version. The full list of methods is in the [official AWS CLI install guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

Already on AWS? You may not need to install it

AWS CloudShell, the browser terminal in the AWS console, has the CLI preinstalled and already signed in as you. For a one-off command such as checking an S3 bucket or a service quota, it is faster than setting up credentials on your laptop.

## Install AWS CLI on Alpine Linux and containers

This catches a lot of Dockerfiles. The official AWS installer is built against glibc, and Alpine uses musl, so the zip installer fails on `alpine` base images with confusing "not found" errors even though the file is right there.

Use the [Alpine aws-cli package](https://pkgs.alpinelinux.org/packages?name=aws-cli), which is v2:

```bash
apk add --no-cache aws-cli
aws --version
```

It tracks AWS releases with some delay. At the time of writing the stable Alpine branch carried a 2.27 release while AWS was well into 2.3x. For most scripts that gap does not matter; if you need a very new service, use a Debian-based image with the official installer instead.

## macOS and Windows

On macOS the same install script works, or you can download the `AWSCLIV2.pkg` installer:

```bash
curl -fsSL https://awscli.amazonaws.com/v2/install.sh | bash
```

On Windows, from PowerShell:

```powershell
irm https://awscli.amazonaws.com/v2/install.ps1 | iex
aws --version
```

Or use the `AWSCLIV2.msi` installer if your organisation deploys software through MSI packages.

## Configure credentials

The old way was to create an IAM user, copy its access key and secret, and run `aws configure`. That still works:

```bash
aws configure
# AWS Access Key ID: ...
# AWS Secret Access Key: ...
# Default region name: eu-central-1
# Default output format: json
```

For people, prefer short-lived credentials. If your organisation uses IAM Identity Center, sign in through the browser and let the CLI refresh tokens for you:

```bash
aws configure sso
aws sso login --profile my-profile
```

Long-lived access keys belong on the few machines that genuinely need them, and on EC2 you should not need them at all, because an instance role gives the CLI credentials automatically. Whatever you pick, confirm who the CLI thinks you are before running anything destructive:

```bash
aws sts get-caller-identity
```

## Moving scripts off v1

Most scripts run unchanged on v2. The differences that break things are small and specific (AWS keeps the full list in its [v1 to v2 migration guide](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration-changes.html)):

-   **Binary parameters.** v2 treats blob arguments as base64 by default. Scripts that pass raw file contents to commands such as `aws lambda invoke --payload` need `--cli-binary-format raw-in-base64-out`.
-   **The pager.** v2 pipes long output through `less`, which hangs non-interactive jobs. Set `AWS_PAGER=""` in CI.
-   **Python-dependent tooling.** Anything that imported `awscli` as a Python module stops working, because v2 is not a Python package. Use `boto3` for that instead.

With the CLI working, the common next steps are moving data and machines around. [Uploading large files to S3](https://meetrix.io/blogs/upload-large-files-s3/) covers multipart uploads and the settings that speed them up, [AWS VM Import/Export](https://meetrix.io/blogs/aws-vm-import-export/) covers turning a local virtual machine into an AMI, and [raising your EC2 vCPU quota](https://meetrix.io/blogs/increase-aws-vcpu-quota/) is worth doing before you launch anything large. If you run workflows on Lambda, [Step Functions with Lambda](https://meetrix.io/blogs/aws-step-functions-lambda/) is driven by the same CLI.

## Frequently Asked Questions

Does pip install aws cli 2?

No. The awscli package on PyPI is AWS CLI version 1, and AWS never published version 2 to PyPI, so pip installs v1 whatever your Python version. The awscliv2 package on PyPI is a third-party wrapper, not an AWS release.

Where is the AWS CLI install location?

The Linux and macOS installers put the files in /usr/local/aws-cli and link the aws command into /usr/local/bin. The install script without --system uses ~/.local/share/aws-cli instead. On Windows it is C:\\Program Files\\Amazon\\AWSCLIV2. Run which aws to see the one you are using.

Is the AWS S3 CLI a separate install?

No. The aws s3 and aws s3api commands ship inside the normal AWS CLI, so once aws --version works, aws s3 ls works too. There is nothing extra to install for S3.

When does AWS CLI v1 stop being supported?

AWS put CLI v1 into maintenance mode in August 2026, which means security and critical fixes only, no new services or regions. End of support is July 15, 2027. Scripts that still run v1 should move to v2 before then.

How do I install AWS CLI v2 on Alpine Linux?

Use Alpine's own package: apk add aws-cli. The official AWS installer is built against glibc, and Alpine uses musl, so the zip installer does not run there. The Alpine package tracks v2 releases, though it can lag a few weeks behind AWS.

How do I update AWS CLI v2?

If you installed it with the install script or an official installer, run aws update. Snap installs update themselves. On Alpine, use apk upgrade aws-cli.

Why does aws --version still show version 1 after installing v2?

An older v1 binary from pip or apt is earlier in your PATH. Run which -a aws to list every copy, remove the v1 install with pip uninstall awscli or apt remove awscli, then open a new shell or run hash -r.

Meetrix Store

Pre-configured open source images for AWS and Google Cloud.

[Browse products](https://meetrix.io/store/)

Meetrix Store New

One-click deploys on AWS and Google Cloud.

-    [Jitsi Meet Self-hosted video calls for 50 to 500 users](https://meetrix.io/store/jitsi-meet/)
-    [RustDesk Remote desktop AMI, a TeamViewer alternative](https://meetrix.io/store/rustdesk/)
-    [Coturn TURN/STUN for WebRTC, no per-minute relay fees](https://meetrix.io/store/coturn/)
-    [Mailcow Business email on your own domain](https://meetrix.io/store/mailcow/)
-    [Listmonk Newsletters with no per-subscriber fees](https://meetrix.io/store/listmonk/)
-    [Supabase Postgres, Auth, Storage and Realtime, self-hosted](https://meetrix.io/store/supabase/)

[Browse all products](https://meetrix.io/store/)
