Install the Aptos CLI on Linux
For Linux, the easiest way to install the Aptos CLI tool is via shell script, although if that does not work, you can also install manually via downloading pre-compiled binaries. The pre-compiled binaries approach is not generally recommended as updating is very manual.
Install via Script
Section titled “Install via Script”-
In the terminal, use one of the following commands:
Terminal window curl -fsSL "https://aptos.dev/scripts/install_cli.sh" | shOr use the equivalent
wget
command:Terminal window wget -qO- "https://aptos.dev/scripts/install_cli.sh" | sh -
(Optional) It can be helpful to add the Aptos CLI to a folder in your PATH, or to add it to your PATH directly.
- The steps to add a folder to your PATH are shell dependent.
- You can run
echo $SHELL
to print the default shell for your machine, then google specific steps to add a folder to your PATH for that shell.
-
Verify the script is installed by opening a new terminal and running aptos help
- You should see a list of commands you can run using the CLI.
- In the future, this is a helpful resource to learn exactly how each command works.
Install via Package Manager (Optional)
Section titled “Install via Package Manager (Optional)”Arch Linux
Section titled “Arch Linux”Install via AUR (Arch User Repository)
Section titled “Install via AUR (Arch User Repository)”git clone https://aur.archlinux.org/aptos-bin.gitcd aptos-binmakepkg -si
or use an AUR helper like yay
:
yay -S aptos-bin
Install via Pre-Compiled Binaries (Backup Method)
Section titled “Install via Pre-Compiled Binaries (Backup Method)”-
Go to the .
-
Click the “Assets” expandable menu for the latest release to see the pre-compiled binaries.
-
Download the zip file for Linux.
- It’ll have a name like:
aptos-cli-<version>-Linux-x86_64.zip
oraptos-cli-<version>-Linux-aarch64.zip
. - Make sure you choose the right zip file for your computer architecture (x86_64 for Intel / AMD or aarch64 for ARM).
- You will likely have to dismiss warnings that this is a suspicious file when downloading.
- It’ll have a name like:
-
Unzip the downloaded file.
-
Move the extracted Aptos binary file into your preferred folder.
-
Open a terminal and navigate to your preferred folder.
-
Make ~/aptos an executable by running chmod +x ~/aptos.
-
Verify that this installed version works by running ~/aptos help.
You should see instructions for how to use all CLI commands. These can be helpful in the future when you are trying to understand how to use specific commands.
-
(Optional) It can be helpful to add the Aptos CLI to a folder in your PATH, or to add it to your PATH directly.
- The steps to add a folder to your PATH are shell dependent.
- You can run
echo $SHELL
to print the default shell for your machine, then google specific steps to add a folder to your PATH for that shell.