Install Avalanche-CLI

Build Your First Subnet

The first step of learning Subnet development is learning to use Avalanche-CLI.

The best way to get started is by jumping in and deploying your first Subnet.

This tutorial walks you through the process of using Avalanche-CLI for the first time by creating a Subnet, deploying it to the local network, and connecting to it with MetaMask.

Installation

The fastest way to install the latest Avalanche-CLI binary is by running the install script:

curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-cli/main/scripts/install.sh | sh -s

The binary installs inside the ~/bin directory. If the directory doesn't exist, it will be created.

You can run all of the commands in this tutorial by calling ~/bin/avalanche.

You can also add the command to your system path by running

export PATH=~/bin:$PATH

If you add it to your path, you should be able to call the program anywhere with just avalanche. To add it to your path permanently, add an export command to your shell initialization script (ex: .bashrc or .zshrc).

For more detailed installation instructions, see Avalanche-CLI Installation

To add it to your path permanently, add an export command to your shell initialization script. If you run bash, use .bashrc. If you run zsh, use .zshrc.

For example:

export PATH=~/bin:$PATH >> .bashrc

Checking Your Installation

You can test your installation by running avalanche --version. The tool should print the running version.

Updating

To update your installation, you need to delete your current binary and download the latest version using the preceding steps.

Building from Source

The source code is available in this GitHub repository.

After you've cloned the repository, checkout the tag you'd like to run. You can compile the code by running ./scripts/build.sh from the top level directory.

The build script names the binary ./bin/avalanche.

Last updated