Quick installation
On Mac and Linux, run this single command to install all dependencies:If the quick installation doesn’t work, refer to the Install Dependencies section below for instructions to install each dependency individually.If the quick install succeeds, skip to Solana CLI Basics and Anchor CLI Basics.
Install dependencies
The instructions below guide you through installing each dependency individually.- Windows users: First install WSL (Windows Subsystem for Linux), then install the dependencies specified in the Linux section
- Linux users: First install the dependencies specified in the Linux section below
- Mac users: Start with the Rust installation instructions
Windows Subsystem for Linux (WSL)
To develop Solana programs on Windows, you must use WSL. All additional dependencies must be installed through the Linux terminal. To install WSL, run this command in Windows PowerShell:If you’re using VS Code, the WSL extension enables you to use WSL and VS Code together.
Linux dependencies
The following dependencies are required for the Anchor CLI installation. First, update your package manager:Solana programs are written in the Rust programming language.
The recommended installation method for Rust is rustup.
If prompted, add the PATH environment variable:
On Mac using Then refresh your terminal session:
zsh, add the PATH to your shell configuration:Anchor is a framework for developing Solana programs. The Anchor framework leverages Rust macros to simplify the process of writing Solana programs.
The Anchor version manager (AVM) allows you to install and manage different Anchor versions.Install AVM:Check that AVM was installed successfully:Install the latest version of Anchor CLI:Alternatively, install a specific version:
Don’t forget to run
avm use to declare which Anchor CLI version should be used on your system.Install a specific version of the Anchor CLI:
Node.js and Yarn are required to run the default Anchor project test file (TypeScript) created with the
anchor init command.The recommended way to install Node.js is using Node Version Manager (nvm):
Solana CLI basics
This section walks through common Solana CLI commands to get you started.Config File: /Users/test/.config/solana/cli/config.yml
RPC URL: https://api.mainnet-beta.solana.com
WebSocket URL: wss://api.mainnet-beta.solana.com/ (computed)
Keypair Path: /Users/test/.config/solana/id.json
Commitment: confirmed
solana config set --url mainnet-beta
solana config set --url devnet
solana config set --url localhost
solana config set --url testnet
solana config set -um # For mainnet-beta
solana config set -ud # For devnet
solana config set -ul # For localhost
solana config set -ut # For testnet
The
solana airdrop command is limited to 5 SOL per request on devnet. Alternatively, use the Solana Web Faucet.