How to Install AWS CLI on Debian

Tested on Debian 13 (trixie)
Package aws
Applies to Debian
Privilege sudo or root
Scope Install AWS CLI on Debian, including Verify, credentials, fix PATH conflicts, and uninstall cleanly.
Related guides Add Apt Repository Command Not Found
Apt Install Specific Version
Backup Brave Browser Session Ubuntu
Check Ubuntu Version
Configure Vnc Server Ubuntu

The AWS Command Line Interface (AWS CLI) manages S3, EC2, IAM, and the rest of your AWS account from the shell. AWS CLI v2 is the current line—installed from Amazon’s official Linux bundle or, on recent Debian releases, the awscli apt package.

This guide covers install AWS CLI on Debian for Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie): the official v2 installer, apt install awscli, optional legacy pip, credential setup, verification, and uninstall. I ran these steps on Debian 13 and kept real terminal output below.

IMPORTANT

Compare wrapper paths with which yum versus which dnf; the which command shows how PATH order picks the executable.

Install one primary aws binary on PATH. The official installer places /usr/local/bin/aws; apt places /usr/bin/aws. If both exist, which aws follows PATH order—not necessarily the newer build.


Choose an install method

Method Best for On test host (trixie)
apt install awscli Debian-maintained updates in main 2.23.6-1 → /usr/bin/aws
pip install awscli Legacy v1 only—not recommended Not tested (no pip on minimal VM)

Amazon’s getting started install guide targets the v2 bundle. On Trixie, Debian’s awscli package is also v2—not the old PyPI-only v1 era.


Prerequisites

  • Debian 11, 12, or 13 on x86_64 (ARM: use awscli-exe-linux-aarch64.zip from AWS).
  • sudo for install steps.
  • curl or wget for the official bundle.
  • unzip for the AWS zip: sudo apt install unzip.
  • AWS account credentials when you run service commands (not required for aws --version).

Check current state:

Commands below that need root use sudo command.

bash
. /etc/os-release && echo "$PRETTY_NAME"
command -v aws || echo "aws: not installed"
apt-cache policy awscli | head -8

Before install on the test host:

text
Debian GNU/Linux 13 (trixie)
aws: not installed
awscli:
  Candidate: 2.23.6-1
     2.23.6-1 500
        500 http://deb.debian.org/debian trixie/main amd64 Packages
  • For broader CLI reference beyond the apt and sudo steps below, see the Linux commands.

Steps from Install the AWS CLI on Linux:

Download the file with curl; the curl command compares -O, -L, -fsSL, and -o output options.

bash
sudo apt install -y curl unzip
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
unzip -q /tmp/awscliv2.zip -d /tmp
sudo /tmp/aws/install
aws --version
which aws
text
-rw-r--r-- 1 root root 70M Jun 29 09:43 /tmp/awscliv2.zip
You can now run: /usr/local/bin/aws --version
aws-cli/2.35.11 Python/3.14.5 Linux/6.12.94+deb13-amd64 exe/x86_64.debian.13
/usr/local/bin/aws

Upgrade an existing official install:

bash
sudo /tmp/aws/install --update

Layout:

text
/usr/local/bin/aws -> /usr/local/aws-cli/v2/current/bin/aws
/usr/local/aws-cli/v2/2.35.11/

Install AWS CLI from Debian apt

On Debian 13, awscli in main provides AWS CLI v2:

List files shipped by a package with dpkg -L; the dpkg command shows how to locate binaries and configuration paths.

bash
sudo apt update
sudo apt install -y awscli
aws --version
dpkg -l awscli | grep ^ii
text
Setting up awscli (2.23.6-1) ...
aws-cli/2.23.6 Python/3.13.5 Linux/6.12.94+deb13-amd64 source/x86_64.debian.13
ii  awscli  2.23.6-1  amd64  Unified command line interface to Amazon Web Services
bash
apt-cache show awscli | grep -E '^Package:|^Version:|^Description-en'
text
Package: awscli
Version: 2.23.6-1
Description-en: Unified command line interface to Amazon Web Services

On Bookworm and Bullseye, run apt-cache policy awscli—the candidate version may differ or the package may be absent; use the official bundle when apt is too old or missing.


Verify the installation

Version and path:

bash
aws --version
type -a aws
aws help | head -8
text
aws-cli/2.35.11 Python/3.14.5 Linux/6.12.94+deb13-amd64 exe/x86_64.debian.13
aws is /usr/local/bin/aws
aws is /usr/bin/aws
AWS()                                                                    AWS()

NAME
       aws -

DESCRIPTION
       The  AWS  Command  Line  Interface is a unified tool to manage your AWS
       services.

API call without credentials (expected failure):

bash
aws sts get-caller-identity
text
aws: [ERROR]: An error occurred (NoCredentials): Unable to locate credentials.

That error means the CLI is installed; configure credentials next.


Configure AWS credentials

Interactive setup:

bash
aws configure

You will be prompted for:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region (for example us-east-1)
  • Default output format (json, table, or text)

Files are written under ~/.aws/. For IAM roles on EC2, SSO, or environment variables, see Configuration and credential file settings.


Legacy pip install (AWS CLI v1 — avoid for new systems)

Older guides use pip install awscli (Cyberciti, Ask Ubuntu threads). That installs v1, which AWS has superseded with v2.

On a minimal Debian image without pip:

text
pip3: command not found
/usr/bin/python3: No module named pip

If you must use pip for a legacy workflow:

bash
sudo apt install -y python3-pip
pip3 install awscli --user

Prefer the official v2 bundle or apt install awscli on Trixie. See also install Python on Debian if you are building a Python toolchain.


PATH when both installs exist

If you install official v2 and apt install awscli:

bash
echo "$PATH" | tr ':' '\n' | head -5
which aws
/usr/local/bin/aws --version
/usr/bin/aws --version
text
aws is /usr/local/bin/aws
aws-cli/2.35.11 ...
aws-cli/2.23.6 Python/3.13.5 ...

/usr/local/bin usually precedes /usr/bin, so the newer official build runs by default. Remove one install or adjust PATH if you need the Debian package exclusively.


Update AWS CLI

Channel Command
Official bundle Download a fresh zip; sudo /tmp/aws/install --update
Debian apt sudo apt update && sudo apt install --only-upgrade awscli

Confirm with aws --version. List packages with list installed packages on Debian.


Uninstall AWS CLI

Official v2 bundle

The install script does not support --uninstall (AWS uninstall guide):

text
Got an unexpected argument: --uninstall

Remove manually:

bash
sudo rm -rf /usr/local/aws-cli
sudo rm -f /usr/local/bin/aws /usr/local/bin/aws_completer

Debian apt package

bash
sudo apt remove --purge awscli
sudo apt autoremove

After removing only the official build, /usr/bin/aws from apt may remain:

text
aws-cli/2.23.6 Python/3.13.5 Linux/6.12.94+deb13-amd64 source/x86_64.debian.13
/usr/bin/aws

Troubleshooting

Symptom Likely cause Fix
aws: command not found Not installed Official bundle or sudo apt install awscli
unzip: command not found Missing unzip sudo apt install unzip
Wrong aws --version Two installs on PATH type -a aws; remove one or fix PATH
NoCredentials on first API call Normal before aws configure Run aws configure or set env vars
Package awscli has no installation candidate Older suite without package Use official zip installer
pip awscli vs v2 confusion Legacy v1 path Use official v2 or apt awscli on Trixie

References


Summary

Install AWS CLI on Debian with Amazon’s official v2 zip (curl the bundle, unzip, sudo ./aws/install) for the latest release (2.35.11 here), or sudo apt install awscli on Trixie for Debian’s v2 package (2.23.6). Verify with aws --version, configure with aws configure, and keep one aws on PATH. Remove the official build with rm -rf /usr/local/aws-cli or drop the apt package with apt remove awscli.


Frequently Asked Questions

1. How do I install AWS CLI on Debian?

Download the official Linux x86_64 bundle from awscli.amazonaws.com, unzip it, and run sudo ./aws/install. On Debian 13 you can also run sudo apt install awscli for the Debian-packaged AWS CLI v2.

2. Is AWS CLI v1 or v2 on Debian apt?

On Debian 13 (trixie), the awscli package is AWS CLI v2 (2.23.6-1 on the test host). Older suites may ship different versions—run apt-cache policy awscli. Legacy AWS CLI v1 was the old pip package awscli.

3. Should I use apt or the official AWS installer on Debian?

Use the official installer when you want the latest upstream release (2.35.x here). Use apt when you prefer Debian security updates and a single apt upgrade path. Do not install both without managing PATH order.

4. How do I verify AWS CLI after install?

Run aws --version and which aws. Without credentials, aws sts get-caller-identity returns NoCredentials—that is expected until you run aws configure or set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

5. How do I configure AWS CLI on Debian?

Run aws configure and enter access key, secret key, default region, and output format. Credentials are stored in ~/.aws/credentials. For SSO or IAM roles, see the AWS CLI user guide.

6. Why does which aws show two different versions?

Both the official /usr/local/bin/aws and apt /usr/bin/aws may be installed. PATH order decides which runs—/usr/local/bin usually comes first. Remove one install or adjust PATH.

7. Can I install AWS CLI with pip on Debian?

pip install awscli installs legacy AWS CLI v1 and is discouraged. AWS documents the v2 zip installer for Linux. If you use pip, install python3-pip first and expect a different command layout than v2.

8. How do I uninstall AWS CLI from Debian?

For apt: sudo apt remove awscli. For the official v2 bundle: sudo rm -rf /usr/local/aws-cli and sudo rm /usr/local/bin/aws /usr/local/bin/aws_completer per AWS uninstall docs.
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, networking, and security, delivering robust and efficient solutions for diverse projects.

  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security
  • Cloud Computing
  • Kubernetes
  • Linux
  • Ansible (software)