Updated: 28 September 2026 · Applies to: AWS CLI version 2 on Linux
The AWS Command Line Interface lets you manage AWS services from a terminal. Use version 2, which AWS provides as a self-contained installer; the old pip install awscli method installs version 1.
Install on Linux (x86_64)
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip unzip awscliv2.zip sudo ./aws/install aws --version
For ARM servers use awscli-exe-linux-aarch64.zip. Update later with sudo ./aws/install --update from a newly downloaded zip.
Configure
aws configure # access key, secret key, default region (e.g. ap-south-1), output format
On EC2, attach an IAM role to the instance instead of storing keys. For several accounts use profiles: aws configure --profile work and --profile work on commands.
Test
aws sts get-caller-identity aws s3 ls
Everyday commands
aws s3 cp backup.tar.gz s3://my-bucket/backups/ aws s3 sync /var/www s3://my-bucket/www --delete aws ec2 describe-instances --output table
Uninstall
sudo rm /usr/local/bin/aws /usr/local/bin/aws_completer sudo rm -rf /usr/local/aws-cli
Tip: Never store access keys in scripts or in a Git repository. Create an IAM user or role with only the permissions a task needs, and rotate access keys regularly in the IAM console.