docs/src/cli/install.md
There are multiple ways to install the Solana tools on your computer depending on your preferred workflow:
Open your favorite Terminal application
Install the Solana release LATEST_SOLANA_RELEASE_VERSION on your machine by running:
sh -c "$(curl -sSfL https://release.solana.com/LATEST_SOLANA_RELEASE_VERSION/install)"
You can replace LATEST_SOLANA_RELEASE_VERSION with the release tag matching
the software version of your desired release, or use one of the three symbolic
channel names: stable, beta, or edge.
The following output indicates a successful update:
downloading LATEST_SOLANA_RELEASE_VERSION installer
Configuration: /home/solana/.config/solana/install/config.yml
Active release directory: /home/solana/.local/share/solana/install/active_release
* Release version: LATEST_SOLANA_RELEASE_VERSION
* Release URL: https://github.com/solana-labs/solana/releases/download/LATEST_SOLANA_RELEASE_VERSION/solana-release-x86_64-unknown-linux-gnu.tar.bz2
Update successful
Please update your PATH environment variable to include the solana programs:
PATHsolana installed by running:solana --version
solana-install update may be used to easily
update the Solana software to a newer version at any time.Open a Command Prompt (cmd.exe) as an Administrator
Copy and paste the following command, then press Enter to download the Solana installer into a temporary directory:
cmd /c "curl https://release.solana.com/LATEST_SOLANA_RELEASE_VERSION/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs"
C:\solana-install-tmp\solana-install-init.exe LATEST_SOLANA_RELEASE_VERSION
When the installer is finished, press Enter.
Close the command prompt window and re-open a new command prompt window as a normal user
Confirm you have the desired version of solana installed by entering:
solana --version
solana-install update may be used to easily
update the Solana software to a newer version at any time.If you would rather not use solana-install to manage the install, you can
manually download and install the binaries.
Download the binaries by navigating to https://github.com/solana-labs/solana/releases/latest, download solana-release-x86_64-unknown-linux-gnu.tar.bz2, then extract the archive:
tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
cd solana-release/
export PATH=$PWD/bin:$PATH
Download the binaries by navigating to https://github.com/solana-labs/solana/releases/latest, download solana-release-x86_64-apple-darwin.tar.bz2, then extract the archive:
tar jxf solana-release-x86_64-apple-darwin.tar.bz2
cd solana-release/
export PATH=$PWD/bin:$PATH
Download the binaries by navigating to https://github.com/solana-labs/solana/releases/latest, download solana-release-x86_64-pc-windows-msvc.tar.bz2, then extract the archive using WinZip or similar.
Open a Command Prompt and navigate to the directory into which you extracted the binaries and run:
cd solana-release/
set PATH=%cd%/bin;%PATH%
If you are unable to use the prebuilt binaries or prefer to build it yourself from source, follow these steps, ensuring you have the necessary prerequisites installed on your system.
Before building from source, make sure to install the following prerequisites:
Rust Programming Language: Check "Install Rust" at https://www.rust-lang.org/tools/install, which recommends the following command.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install build dependencies:
apt-get install \
build-essential \
pkg-config \
libudev-dev llvm libclang-dev \
protobuf-compiler
Replace apt with your distribution's package manager (e.g., yum, dnf,
pacman) and adjust package names as needed.
Install Homebrew (if not already installed), check "Install Hombrew" at https://brew.sh/, which recommends the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install the necessary tools and libraries using Homebrew:
brew install rust pkg-config libudev protobuf llvm coreutils
Follow the instructions given at the end of the brew install command about
PATH configurations.
Rust Programming Language: Check "Install Rust" at https://www.rust-lang.org/tools/install, which recommends the following command.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
protoc from the
GitHub releases page of Protocol Buffers,
and add it to your PATH.:::info
Users on Windows 10 or 11 may need to install Windows Subsystem for Linux (WSL) in order to be able to build from source. WSL provides a Linux environment that runs inside your existing Windows installation. You can then run regular Linux software, including the Linux versions of Solana CLI.
After installed, run wsl from your Windows terminal, then continue through the
Debian and Other Linux Distributions
above.
:::
After installing the prerequisites, proceed with building Solana from source, navigate to Solana's GitHub releases page, and download the Source Code archive. Extract the code and build the binaries with:
./scripts/cargo-install-all.sh .
export PATH=$PWD/bin:$PATH
You can then run the following command to obtain the same result as with prebuilt binaries:
solana-install init
This option requires you to have Homebrew package manager on your MacOS or Linux machine.
Homebrew formulae
is updated after each solana release, however it is possible that the Homebrew
version is outdated.
solana installed by entering:solana --version