Skip to content
Install each dependency separately when you need a specific version or when the quick installation does not complete successfully. Follow the sections in order for a new environment, or go directly to the tool you need to install or troubleshoot.

​Prerequisites

Pick your operating system. The steps after this section are the same on every system.
Rust needs a C compiler and linker. On macOS they come with Apple’s command-line developer tools. If you don’t have them yet, install them in Terminal:
Terminal
Then continue with Install Rust.
1

Install Rust

Developers build Solana programs using the Rust programming language.
  1. Install Rust using rustup by entering the following command in your terminal:
Terminal
After a successful installation you will see the following message:

Successful Rust Install Message

  1. Reload your PATH environment variable to include Cargo’s bin directory:
Terminal
  1. Verify that the installation was successful.
Terminal
The command prints the installed Rust version, for example:
2

Install Solana CLI

The Solana CLI provides all the tools required to build and deploy Solana programs.
  1. Install the Solana CLI tool suite by using the official install command:
Terminal
You can replace stable with a specific Agave release tag or with the beta or edge release channel.
  1. Make the Solana CLI available in your current terminal.
The installer updates your shell configuration and prints the command required to update the current session. The command is typically:
Terminal
If solana is still unavailable, restart your terminal. To confirm which shell configuration file the installer updated, check your current shell:
Terminal
  • If the output contains /bash, restart the terminal or run source ~/.bashrc.
  • If the output contains /zsh, restart the terminal or run source ~/.zshrc.
  1. Verify that the installation succeeded:
Terminal
The command prints the installed Solana CLI version, for example:
You can view all available versions on the Agave GitHub repository. Agave is the validator client from Anza, formerly known as Solana Labs validator client.
  1. To update the Solana CLI later, run:
Terminal
3

Install Anchor CLI

Anchor is a framework for developing Solana programs. The Anchor framework uses Rust macros to simplify the process of writing Solana programs.

​Prerequisites

Node.js and npm, which ships with Node.js, are required only when you select a TypeScript test template such as Mocha or Jest. Anchor uses pnpm or Yarn instead when either is installed. The default LiteSVM test template runs in Rust and does not require Node.js tooling.

Node Installation

  1. Install Node using Node Version Manager (nvm) by running the following command:
Terminal
  1. Restart your terminal and confirm that the nvm command runs successfully:
Terminal
  1. Use nvm to install Node:
Terminal
  1. Verify that the installation succeeded, by checking the Node version:
Terminal
The command prints the installed Node.js version, for example:

​Installation

You can install the Anchor CLI and tooling in two ways:
  • Anchor Version Manager (AVM) — Recommended installation method
  • Without AVM — Install directly from GitHub
The Anchor Version Manager (AVM) allows you to install and manage different Anchor versions on your system and easily update Anchor versions in the future. To install Anchor using AVM, follow the steps below:
  1. Install AVM with the following command:
Terminal
  1. Confirm that AVM installed successfully:
Terminal
  1. Install Anchor CLI using AVM. These docs and the Quickstart installer use Anchor CLI 1.1.2:
Terminal
To install the latest version instead:
Terminal
When you run anchor, AVM also installs and activates the Solana CLI release that matches the active Anchor version (Solana CLI 3.1.10 for Anchor 1.1.2), and prints 3.1.10 initialized when it switches.
When installing the Anchor CLI on Linux or WSL, you may encounter this error:
If you see this error message, follow these steps:
  1. Install the dependencies listed in the Linux tab at the top of this page.
  2. Retry installing the Anchor CLI.
  1. Verify that the installation succeeded, by checking the Anchor CLI version:
Terminal
The command prints the active Anchor CLI version, for example:
Run avm use to select the Anchor CLI version for your system.
  • If you installed the latest version, run avm use latest.
  • If you installed version 1.1.2, run avm use 1.1.2.
Error: canonicalizing AVM executable? If anchor fails with this error, AVM’s nightly channel is on. Anchor’s avm/install shell script installs the nightly AVM and turns the channel on. Turn it off, then select your version again:
Terminal
4

Install Surfpool CLI

Surfpool is a tool for local development and an improved replacement for solana-test-validator.
  1. Install Surfpool with the following command:
Terminal
  1. Verify that the installation was successful by checking the Surfpool CLI version:
Terminal
The command prints the installed Surfpool CLI version, for example: