Setting up Your Local Development Environment
Set up your local environment for Solana program development
Follow this guide to install all the dependencies required to build Solana programs.
Install Rust
You need Rust because Solana smart contracts are written in Rust and compiled to eBPF, which the Solana runtime can execute.
Run the command below to install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
If you’re using a Windows machine, consider these alternative methods for installing Rust.
Run the command below to set up the Rust environment by adding Cargo’s bin directory to your shell’s PATH:
. "$HOME/.cargo/env"
Confirm successful installation by running:
rustc --version
Install the Solana CLI
You need the Solana CLI to develop, test, deploy, and interact with Solana programs and accounts directly from your terminal.
Run the command below to install the Solana CLI:
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
Run the command below to add the Solana CLI tools to your system’s executable search path for the current shell session:
echo 'export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"' >> ~/.zshrc
Restart your terminal by running:
source ~/.bashrc
source ~/.zshrc
Confirm your installation by running the command below:
solana --version
Last updated on