This topic describes how to install or update the latest release of the AWS Command Line Interface (AWS CLI) on supported operating systems. For information on the latest releases of AWS CLI, see theAWS CLI version 2 Changelog on GitHub.
To install a past release of the AWS CLI, seeInstalling past releases of the AWS CLI version 2. For uninstall instructions, seeUninstalling the AWS CLI version 2.
AWS CLI versions 1 and 2 use the sameaws
command name. If you previously installed AWS CLI version 1, seeMigration guide for the AWS CLI version 2.
For installation instructions, expand the section for your operating system.
You must be able to extract or "unzip" the downloaded package. If your operating system doesn't have the built-inunzip
command, use an equivalent.
The AWS CLI usesglibc
,groff
, andless
. These are included by default in most major distributions of Linux.
We support the AWS CLI on 64-bit versions of recent distributions of CentOS, Fedora, Ubuntu, Amazon Linux 1, Amazon Linux 2, Amazon Linux 2023, and Linux ARM.
Because AWS doesn't maintain third-party repositories other thansnap
, we can’t guarantee that they contain the latest version of the AWS CLI.
You can install the AWS CLI by using one of the following methods:
The command line installer is good option for version control, as you can specify the version to install. This option does not auto-update and you must download a new installer each time you update to overwrite previous version.
The officially supportedsnap
package is a good option to always have the latest version of the AWS CLI as snap packages automatically refresh. There is no built-in support for selecting minor versions of AWS CLI and therefore is not an optimal install method if your team needs to pin versions.
To update your current installation of AWS CLI, download a new installer each time you update to overwrite previous versions. Follow these steps from the command line to install the AWS CLI on Linux.
The following are quick installation steps in a single copy and paste group that provide a basic installation. For guided instructions, see the steps that follow.
(Optional) The following command block downloads and installs the AWS CLI without first verifying the integrity of your download. To verify the integrity of your download, use the below step by step instructions.
To install the AWS CLI, run the following commands.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install
To update your current installation of the AWS CLI, add your existing symlink and installer information to construct theinstall
command using the--bin-dir
,--install-dir
, and--update
parameters. The following command block uses an example symlink of/usr/local/bin
and example installer location of/usr/local/aws-cli
to install the AWS CLI locally for the current user.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --bin-dir/usr/local/bin
--install-dir/usr/local/aws-cli
--update
Download the installation file in one of the following ways:
Use thecurl
command – The-o
option specifies the file name that the downloaded package is written to. The options on the following example command write the downloaded file to the current directory with the local nameawscliv2.zip
.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Downloading from the URL – To download the installer with your browser, use the following URL:https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
(Optional) Verifying the integrity of your downloaded zip file
If you chose to manually download the AWS CLI installer package.zip
in the above steps, you can use the following steps to verify the signatures by using theGnuPG
tool.
The AWS CLI installer package.zip
files are cryptographically signed using PGP signatures. If there is any damage or alteration of the files, this verification fails and you should not proceed with installation.
Download and install thegpg
command using your package manager. For more information aboutGnuPG
, see theGnuPG website.
To create the public key file, create a text file and paste in the following text.
-----BEGIN PGP PUBLIC KEY BLOCK-----mQINBF2Cr7UBEADJZHcgusOJl7ENSyumXh85z0TRV0xJorM2B/JL0kHOyigQluUGZMLhENaG0bYatdrKP+3H91lvK050pXwnO/R7fB/FSTouki4ciIx5OuLlnJZIxSzxPqGl0mkxImLNbGWoi6Lto0LYxqHN2iQtzlwTVmq9733zd3XfcXrZ3+LblHAgEt5GTfNxEKJ8soPLyWmwDH6HWCnjZ/aIQRBTIQ05uVeEoYxSh6wOai7ss/KveoSNBbYzgbdzoqI2Y8cgH2nbfgp3DSasaLZEdCSsIsK1u05CinE7k2qZ7KgKAUIcT/cR/grkC6VwsnDU0OUCideXcQ8WeHutqvgZH1JgKDbznoIzeQHJD238GEu+eKhRHcz8/jeG94zkcgJOz3KbZGYMiTh277Fvj9zzvZsbMBCedV1BTg3TqgvdX4bdkhf5cH+7NtWOlrFj6UwAsGukBTAOxC0l/dnSmZhJ7Z1KmEWilro/gOrjtOxqRQutlIqG22TaqoPGfYVN+en3Zwbt97kcgZDwqbuykNt64oZWc4XKCa3mprEGC3IbJTBFqglXmZ7l9ywGEEUJYOlb2XrSuPWml39beWdKM8kzr1OjnlOm6+lpTRCBfo0wa9F8YZRhHPAkwKkXXDeOGpWRj4ohOx0d2GWkyV5xyN14p2tQOCdOODmz80yUTgRpPVQUtOEhXQARAQABtCFBV1MgQ0xJIFRlYW0gPGF3cy1jbGlAYW1hem9uLmNvbT6JAlQEEwEIAD4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQT7Xbd/1cEYuAURraimMQrMRnJHXAUCaGveYQUJDMpiLAAKCRCmMQrMRnJHXKBYD/9Ab0qQdGiO5hObchG8xh8Rpb4Mjyf60JrVo6m8GNjNj6BHkSc8fuTQJ/FaEhaQxj3pjZ3GXPrXjIIVChmICLlFuRXYzrXcPw0lniybypsZEVai5kO0tCNBCCFuMN9RsmmRG8mf7lC4FSTbUDmxG/QlYK+0IV/luJkzxWa+rySkdpm0JdqumjegNRgObdXHAQDWlubWQHWyZyIQ2B4U7AxqSpcdJp6IS4Zds4wVLd1WE5pquYQ8vS2cNlDm4QNg8wTj58e3lKN47hXHMIb6CHxRnb947oJapg189LLPR5koh+EorNkA1wu5mAJtJvy5YMsppy2y/kIjp3lyY6AmPT1posgGk70ZCmToEZ5rbd7ARExtlh76A0cabMDFlEHDIK8RNUOSRr7L64+KxOUegKBfQHb9dADYqqiKqpCbKgvtWlds909Ms74JBgr2KwZCSY1HaOxnIr4CY43QRqAq5YHOay/mU+6whhmdF18vpyK0vfkvvGresWtSXbag7Hkt3XjaEw76BzxQH21EBDqU8WJVjHgU6ru+DJTs+SxgJbaT3hb/vyjlw0lK+hFfhWKRwgOXH8vqducF95NRSUxtS4fpqxWVaw3QV2OWSjbne99A5EPEySzryFTKbMGwaTlAwMCwYevt4YT6eb7NmFhTx0Fis4TalUs+j+c7Kg92pDx2uQ===OBAt-----END PGP PUBLIC KEY BLOCK-----
For reference, the following are the details of the public key.
Key ID: A6310ACC4672475CType: RSASize: 4096/4096Created: 2019-09-18Expires: 2026-07-07User ID: AWS CLI Team <aws-cli@amazon.com>Key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C
Import the AWS CLI public key with the following command, substitutingpublic-key-file-name
with the file name of the public key you created.
$
gpg --importpublic-key-file-name
gpg: /home/username
/.gnupg/trustdb.gpg: trustdb createdgpg: key A6310ACC4672475C: public key "AWS CLI Team <aws-cli@amazon.com>" importedgpg: Total number processed: 1gpg: imported: 1
Download the AWS CLI signature file for the package you downloaded. It has the same path and name as the.zip
file it corresponds to, but has the extension.sig
. In the following examples, we save it to the current directory as a file namedawscliv2.sig
.
For the latest version of the AWS CLI, use the following command block:
$
curl -o awscliv2.sighttps://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig
Verify the signature, passing both the downloaded.sig
and.zip
file names as parameters to thegpg
command.
$
gpg --verify awscliv2.sig awscliv2.zip
The output should look similar to the following.
gpg: Signature made Mon Nov 4 19:00:01 2019 PSTgpg: using RSA key FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475Cgpg: Good signature from "AWS CLI Team <aws-cli@amazon.com>" [unknown]gpg: WARNING: This key is not certified with a trusted signature!gpg: There is no indication that the signature belongs to the owner.Primary key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C
The warning in the output is expected and doesn't indicate a problem. It occurs because there isn't a chain of trust between your personal PGP key (if you have one) and the AWS CLI PGP key. For more information, seeWeb of trust.
Unzip the installer. If your Linux distribution doesn't have a built-inunzip
command, use an equivalent to unzip it. The following example command unzips the package and creates a directory namedaws
under the current directory.
$
unzip awscliv2.zip
Run the install program. The installation command uses a file namedinstall
in the newly unzippedaws
directory. By default, the files are all installed to/usr/local/aws-cli
, and a symbolic link is created in/usr/local/bin
. The command includessudo
to grant write permissions to those directories.
$
sudo ./aws/install
You can install withoutsudo
if you specify directories that you already have write permissions to. Use the following instructions for theinstall
command to specify the installation location:
Ensure that the paths you provide to the-i
and-b
parameters contain no volume name or directory names that contain any space characters or other white space characters. If there is a space, the installation fails.
--install-dir
or-i
– This option specifies the directory to copy all of the files to.
The default value is/usr/local/aws-cli
.
--bin-dir
or-b
– This option specifies that the mainaws
program in the install directory is symbolically linked to the fileaws
in the specified path. You must have write permissions to the specified directory. Creating a symlink to a directory that is already in your path eliminates the need to add the install directory to the user's$PATH
variable.
The default value is/usr/local/bin
.
$
./aws/install -i/usr/local/aws-cli
-b/usr/local/bin
To update your current installation of the AWS CLI, add your existing symlink and installer information to construct theinstall
command with the--update
parameter.
$
sudo ./aws/install --bin-dir/usr/local/bin
--install-dir/usr/local/aws-cli
--update
To locate the existing symlink and installation directory, use the following steps:
Use thewhich
command to find your symlink. This gives you the path to use with the--bin-dir
parameter.
$
which aws
/usr/local/bin
/aws
Use thels
command to find the directory that your symlink points to. This gives you the path to use with the--install-dir
parameter.
$
ls -l /usr/local/bin/aws
lrwxrwxrwx 1 ec2-user ec2-user 49 Oct 22 09:49 /usr/local/bin/aws ->/usr/local/aws-cli
/v2/current/bin/aws
Confirm the installation with the following command.
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64
If theaws
command cannot be found, you might need to restart your terminal or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
To update your current installation of AWS CLI, download a new installer each time you update to overwrite previous versions. Follow these steps from the command line to install the AWS CLI on Linux.
The following are quick installation steps in a single copy and paste group that provide a basic installation. For guided instructions, see the steps that follow.
(Optional) The following command block downloads and installs the AWS CLI without first verifying the integrity of your download. To verify the integrity of your download, use the below step by step instructions.
To install the AWS CLI, run the following commands.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install
To update your current installation of the AWS CLI, add your existing symlink and installer information to construct theinstall
command using the--bin-dir
,--install-dir
, and--update
parameters. The following command block uses an example symlink of/usr/local/bin
and example installer location of/usr/local/aws-cli
.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --bin-dir/usr/local/bin
--install-dir/usr/local/aws-cli
--update
Download the installation file in one of the following ways:
Use thecurl
command – The-o
option specifies the file name that the downloaded package is written to. The options on the following example command write the downloaded file to the current directory with the local nameawscliv2.zip
.
$
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
Downloading from the URL – To download the installer with your browser, use the following URL:https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip
(Optional) Verifying the integrity of your downloaded zip file
If you chose to manually download the AWS CLI installer package.zip
in the above steps, you can use the following steps to verify the signatures by using theGnuPG
tool.
The AWS CLI installer package.zip
files are cryptographically signed using PGP signatures. If there is any damage or alteration of the files, this verification fails and you should not proceed with installation.
Download and install thegpg
command using your package manager. For more information aboutGnuPG
, see theGnuPG website.
To create the public key file, create a text file and paste in the following text.
-----BEGIN PGP PUBLIC KEY BLOCK-----mQINBF2Cr7UBEADJZHcgusOJl7ENSyumXh85z0TRV0xJorM2B/JL0kHOyigQluUGZMLhENaG0bYatdrKP+3H91lvK050pXwnO/R7fB/FSTouki4ciIx5OuLlnJZIxSzxPqGl0mkxImLNbGWoi6Lto0LYxqHN2iQtzlwTVmq9733zd3XfcXrZ3+LblHAgEt5GTfNxEKJ8soPLyWmwDH6HWCnjZ/aIQRBTIQ05uVeEoYxSh6wOai7ss/KveoSNBbYzgbdzoqI2Y8cgH2nbfgp3DSasaLZEdCSsIsK1u05CinE7k2qZ7KgKAUIcT/cR/grkC6VwsnDU0OUCideXcQ8WeHutqvgZH1JgKDbznoIzeQHJD238GEu+eKhRHcz8/jeG94zkcgJOz3KbZGYMiTh277Fvj9zzvZsbMBCedV1BTg3TqgvdX4bdkhf5cH+7NtWOlrFj6UwAsGukBTAOxC0l/dnSmZhJ7Z1KmEWilro/gOrjtOxqRQutlIqG22TaqoPGfYVN+en3Zwbt97kcgZDwqbuykNt64oZWc4XKCa3mprEGC3IbJTBFqglXmZ7l9ywGEEUJYOlb2XrSuPWml39beWdKM8kzr1OjnlOm6+lpTRCBfo0wa9F8YZRhHPAkwKkXXDeOGpWRj4ohOx0d2GWkyV5xyN14p2tQOCdOODmz80yUTgRpPVQUtOEhXQARAQABtCFBV1MgQ0xJIFRlYW0gPGF3cy1jbGlAYW1hem9uLmNvbT6JAlQEEwEIAD4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQT7Xbd/1cEYuAURraimMQrMRnJHXAUCaGveYQUJDMpiLAAKCRCmMQrMRnJHXKBYD/9Ab0qQdGiO5hObchG8xh8Rpb4Mjyf60JrVo6m8GNjNj6BHkSc8fuTQJ/FaEhaQxj3pjZ3GXPrXjIIVChmICLlFuRXYzrXcPw0lniybypsZEVai5kO0tCNBCCFuMN9RsmmRG8mf7lC4FSTbUDmxG/QlYK+0IV/luJkzxWa+rySkdpm0JdqumjegNRgObdXHAQDWlubWQHWyZyIQ2B4U7AxqSpcdJp6IS4Zds4wVLd1WE5pquYQ8vS2cNlDm4QNg8wTj58e3lKN47hXHMIb6CHxRnb947oJapg189LLPR5koh+EorNkA1wu5mAJtJvy5YMsppy2y/kIjp3lyY6AmPT1posgGk70ZCmToEZ5rbd7ARExtlh76A0cabMDFlEHDIK8RNUOSRr7L64+KxOUegKBfQHb9dADYqqiKqpCbKgvtWlds909Ms74JBgr2KwZCSY1HaOxnIr4CY43QRqAq5YHOay/mU+6whhmdF18vpyK0vfkvvGresWtSXbag7Hkt3XjaEw76BzxQH21EBDqU8WJVjHgU6ru+DJTs+SxgJbaT3hb/vyjlw0lK+hFfhWKRwgOXH8vqducF95NRSUxtS4fpqxWVaw3QV2OWSjbne99A5EPEySzryFTKbMGwaTlAwMCwYevt4YT6eb7NmFhTx0Fis4TalUs+j+c7Kg92pDx2uQ===OBAt-----END PGP PUBLIC KEY BLOCK-----
For reference, the following are the details of the public key.
Key ID: A6310ACC4672475CType: RSASize: 4096/4096Created: 2019-09-18Expires: 2026-07-07User ID: AWS CLI Team <aws-cli@amazon.com>Key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C
Import the AWS CLI public key with the following command, substitutingpublic-key-file-name
with the file name of the public key you created.
$
gpg --importpublic-key-file-name
gpg: /home/username
/.gnupg/trustdb.gpg: trustdb createdgpg: key A6310ACC4672475C: public key "AWS CLI Team <aws-cli@amazon.com>" importedgpg: Total number processed: 1gpg: imported: 1
Download the AWS CLI signature file for the package you downloaded. It has the same path and name as the.zip
file it corresponds to, but has the extension.sig
. In the following examples, we save it to the current directory as a file namedawscliv2.sig
.
For the latest version of the AWS CLI,use the following command block:
$
curl -o awscliv2.sighttps://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip.sig
Verify the signature, passing both the downloaded.sig
and.zip
file names as parameters to thegpg
command.
$
gpg --verify awscliv2.sig awscliv2.zip
The output should look similar to the following.
gpg: Signature made Mon Nov 4 19:00:01 2019 PSTgpg: using RSA key FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475Cgpg: Good signature from "AWS CLI Team <aws-cli@amazon.com>" [unknown]gpg: WARNING: This key is not certified with a trusted signature!gpg: There is no indication that the signature belongs to the owner.Primary key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C
The warning in the output is expected and doesn't indicate a problem. It occurs because there isn't a chain of trust between your personal PGP key (if you have one) and the AWS CLI PGP key. For more information, seeWeb of trust.
Unzip the installer. If your Linux distribution doesn't have a built-inunzip
command, use an equivalent to unzip it. The following example command unzips the package and creates a directory namedaws
under the current directory.
$
unzip awscliv2.zip
Run the install program. The installation command uses a file namedinstall
in the newly unzippedaws
directory. By default, the files are all installed to/usr/local/aws-cli
, and a symbolic link is created in/usr/local/bin
. The command includessudo
to grant write permissions to those directories.
$
sudo ./aws/install
You can install withoutsudo
if you specify directories that you already have write permissions to. Use the following instructions for theinstall
command to specify the installation location:
Ensure that the paths you provide to the-i
and-b
parameters contain no volume name or directory names that contain any space characters or other white space characters. If there is a space, the installation fails.
--install-dir
or-i
– This option specifies the directory to copy all of the files to.
The default value is/usr/local/aws-cli
.
--bin-dir
or-b
– This option specifies that the mainaws
program in the install directory is symbolically linked to the fileaws
in the specified path. You must have write permissions to the specified directory. Creating a symlink to a directory that is already in your path eliminates the need to add the install directory to the user's$PATH
variable.
The default value is/usr/local/bin
.
$
./aws/install -i/usr/local/aws-cli
-b/usr/local/bin
To update your current installation of the AWS CLI, add your existing symlink and installer information to construct theinstall
command with the--update
parameter.
$
sudo ./aws/install --bin-dir/usr/local/bin
--install-dir/usr/local/aws-cli
--update
To locate the existing symlink and installation directory, use the following steps:
Use thewhich
command to find your symlink. This gives you the path to use with the--bin-dir
parameter.
$
which aws
/usr/local/bin
/aws
Use thels
command to find the directory that your symlink points to. This gives you the path to use with the--install-dir
parameter.
$
ls -l /usr/local/bin/aws
lrwxrwxrwx 1 ec2-user ec2-user 49 Oct 22 09:49 /usr/local/bin/aws ->/usr/local/aws-cli
/v2/current/bin/aws
Confirm the installation with the following command.
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64
If theaws
command cannot be found, you might need to restart your terminal or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
We provide an official AWS supported version of the AWS CLI onsnap
. If you want to always have the latest version of the AWS CLI installed on your system, a snap package provides this for you as it auto-updates. There is no built-in support for selecting minor versions of AWS CLI and therefore it is not an optimal install method if your team needs to pin versions. If you want to install a specific minor version of the AWS CLI, we suggest you use the command line installer.
If your Linux platform does not already havesnap
installed, installsnap
on your platform.
For information on installingsnap
, seeInstalling the daemon in theSnap documentation.
You may need to restart your system so that yourPATH
variables are updated correctly. If you are having installation issues, follow steps inFix common issues in theSnap documentation.
To verify thatsnap
is installed correctly, run the following command.
$
snap version
Run the followingsnap install
command for the AWS CLI.
$
snap install aws-cli --classic
Depending on your permissions, you may need to addsudo
to the command.
$
sudo snap install aws-cli --classic
Verify that the AWS CLI installed correctly.
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64
If you get an error, seeTroubleshooting errors for the AWS CLI.
We support the AWS CLI on macOS versions 11 and later. For more information, seemacOS support policy updates for the AWS CLI v2 on theAWS Developer Tools Blog.
Because AWS doesn't maintain third-party repositories, we can’t guarantee that they contain the latest version of the AWS CLI.
macOS version support matrix
AWS CLI version | Supported macOS version |
---|---|
2.21.0 – current | 11+ |
2.17.0 –2.20.0 | 10.15+ |
2.0.0 – 2.16.12 | 10.14 and below |
If you are updating to the latest version, use the same installation method that you used in your current version. You can install the AWS CLI on macOS in the following ways.
The following steps show how to install the latest version of the AWS CLI by using the standard macOS user interface and your browser.
In your browser, download the macOSpkg
file:https://awscli.amazonaws.com/AWSCLIV2.pkg
Run your downloaded file and follow the on-screen instructions. You can choose to install the AWS CLI in the following ways:
For all users on the computer (requiressudo
)
You can install to any folder, or choose the recommended default folder of/usr/local/aws-cli
.
The installer automatically creates a symlink at/usr/local/bin/aws
that links to the main program in the installation folder you chose.
For only the current user (doesn't requiresudo
)
You can install to any folder to which you have write permission.
Due to standard user permissions, after the installer finishes, you must manually create a symlink file in your$PATH
that points to theaws
andaws_completer
programs by using the following commands at the command prompt. The default location for a symlink is/usr/local/bin/
:
$
ln -s /folder/installed
/aws-cli/aws /usr/local/bin
/aws$
ln -s /folder/installed
/aws-cli/aws_completer /usr/local/bin
/aws_completer
If you don't have write permissions to the folder, you may need to usesudo
in your command. The following example usessudo
with the default location for a symlink in/usr/local/bin/
:
$
sudo ln -s /folder/installed
/aws-cli/aws /usr/local/bin
/aws$
sudo ln -s /folder/installed
/aws-cli/aws_completer /usr/local/bin
/aws_completer
You can view debug logs for the installation by pressingCmd+L anywhere in the installer. This opens a log pane that enables you to filter and save the log. The log file is also automatically saved to/var/log/install.log
.
To verify that the shell can find and run theaws
command in your$PATH
, use the following commands.
$
which aws
/usr/local/bin/aws
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Darwin/23.3.0
If theaws
command cannot be found, you might need to restart your terminal or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
If you havesudo
permissions, you can install the AWS CLI for all users on the computer. We provide the steps in one easy to copy and paste group. See the descriptions of each line in the following steps.
$
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
$
sudo installer -pkg AWSCLIV2.pkg -target /
Download the file using thecurl
command. The-o
option specifies the file name that the downloaded package is written to. In this example, the file is written toAWSCLIV2.pkg
in the current folder.
$
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
Run the standard macOSinstaller
program, specifying the downloaded.pkg
file as the source. Use the-pkg
parameter to specify the name of the package to install, and the-target /
parameter for which drive to install the package to. The files are installed to/usr/local/aws-cli
, and a symlink is automatically created in/usr/local/bin
. You must includesudo
on the command to grant write permissions to those folders.
$
sudo installer -pkg ./AWSCLIV2.pkg -target /
After installation is complete, debug logs are written to/var/log/install.log
.
To verify that the shell can find and run theaws
command in your$PATH
, use the following commands.
$
which aws
/usr/local/bin/aws
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Darwin/23.3.0
If theaws
command cannot be found, you might need to restart your terminal or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
To specify which folder the AWS CLI is installed to, you must create an XML file with any file name. This file is an XML-formatted file that looks like the following example. Leave all values as shown, except you must replace the path/Users/myusername
in line 9 with the path to the folder you want the AWS CLI installed to.The folder must already exist, or the command fails. The following XML example, namedchoices.xml
, specifies the installer to install the AWS CLI in the folder/Users/myusername
, where it creates a folder namedaws-cli
.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"> <array> <dict> <key>choiceAttribute</key> <string>customLocation</string> <key>attributeSetting</key> <string>/Users/myusername
</string> <key>choiceIdentifier</key> <string>default</string> </dict> </array></plist>
Download thepkg
installer using thecurl
command. The-o
option specifies the file name that the downloaded package is written to. In this example, the file is written toAWSCLIV2.pkg
in the current folder.
$
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
Run the standard macOSinstaller
program with the following options:
Specify the name of the package to install by using the-pkg
parameter.
Specify installing to acurrent user only by setting the-target
parameter toCurrentUserHomeDirectory
.
Specify the path (relative to the current folder) and name of the XML file that you created in the-applyChoiceChangesXML
parameter.
The following example installs the AWS CLI in the folder/Users/myusername/aws-cli
.
$
installer -pkg AWSCLIV2.pkg \ -target CurrentUserHomeDirectory \ -applyChoiceChangesXMLchoices.xml
Because standard user permissions typically don't allow writing to folders in your$PATH
, the installer in this mode doesn't try to add the symlinks to theaws
andaws_completer
programs. For the AWS CLI to run correctly, you must manually create the symlinks after the installer finishes. If your$PATH
includes a folder you can write to and you specify the folder as the target's path, you can run the following command withoutsudo
. If you don't have a writable folder in your$PATH
, you must usesudo
for permissions to write to the specified target folder. The default location for a symlink is/usr/local/bin/
. Replacefolder/installed
with the path to your AWS CLI installation.
$
sudo ln -s /folder/installed
/aws-cli/aws /usr/local/bin
/aws$
sudo ln -s /folder/installed
/aws-cli/aws_completer /usr/local/bin
/aws_completer
After installation is complete, debug logs are written to/var/log/install.log
.
To verify that the shell can find and run theaws
command in your$PATH
, use the following commands.
$
which aws
/usr/local/bin/aws
$
aws --version
aws-cli/2.27.41 Python/3.11.6 Darwin/23.3.0
If theaws
command cannot be found, you might need to restart your terminal or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
We support the AWS CLI on Microsoft-supported versions of 64-bit Windows.
Admin rights to install software
To update your current installation of AWS CLI on Windows, download a new installer each time you update to overwrite previous versions. AWS CLI is updated regularly. To see when the latest version was released, see theAWS CLI version 2 Changelog onGitHub.
Download and run the AWS CLI MSI installer for Windows (64-bit):
https://awscli.amazonaws.com/AWSCLIV2.msi
Alternatively, you can run themsiexec
command to run the MSI installer.
C:\>
msiexec.exe /ihttps://awscli.amazonaws.com/AWSCLIV2.msi
For various parameters that can be used withmsiexec
, seemsiexec on theMicrosoft Docs website. For example, you can use the/qn
flag for a silent installation.
C:\>
msiexec.exe /ihttps://awscli.amazonaws.com/AWSCLIV2.msi/qn
To confirm the installation, open theStart menu, search forcmd
to open a command prompt window, and at the command prompt use theaws --version
command.
C:\>
aws --version
aws-cli/2.27.41 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
If Windows is unable to find the program, you might need to close and reopen the command prompt window to refresh the path, or follow the troubleshooting inTroubleshooting errors for the AWS CLI.
If you come across issues after installing or uninstalling the AWS CLI, seeTroubleshooting errors for the AWS CLI for troubleshooting steps. For the most relevant troubleshooting steps, seeCommand not found errors,The "aws --version" command returns a different version than you installed, andThe "aws --version" command returns a version after uninstalling the AWS CLI.
After you successfully install the AWS CLI, you can safely delete your downloaded installer files. After completing the steps inPrerequisites to use the AWS CLI version 2 and installing the AWS CLI, you should perform aSetting up the AWS CLI.