Published on

How to install Rust, Solana CLI and Anchor

Howdy! 👋

Today, I just started to take a course on "Build a Web3 app on Solana with React and Rust" by Buildspace, then I decided to take some short notes here, so all installation based on my machine only (Macbook Pro). It will doesn't work on other OS.


Install Rust

We can use rustup to install Rust Language.

curl --proto '=https' --tlsv1.2 -sSf | sh

All tools are installed to ~/.cargo/bin with : rustc, cargo and rustup

Verify that Rust installed correctly.

rustc --version

We can update Rust to the latest version with rustup command:

rustup update

Install Solana CLI

sh -c "$(curl -sSfL"

After installing, the installer messaging may prompt you to add the PATH in ~/.profile and ~/.zprofile, but it automatically adds already.

Then I restart the terminal and its works.

To verify Solana installed:

solana --version

We can get/set the configuration of Solana by running:

solana config get
solana set <COMMAND> <OPTION>

Install Anchor

The prerequisite on their website should make sure to set up all tools, including Rust, Solana and Yarn.

Installing Yarn

npm install -g yarn

There are a few options to install Anchor, but install via NPM Package only x86_64 Linux is supported currently. Then the only option is to install via cargo:

cargo install --git --tag v0.21.0 anchor-cli --locked

This process takes longer than all the above installations because it has to download and compile so many packages.

To verify Anchor:

anchor --version

Cool, I'm very excited to be a part of this journey :)

Additional Resources

The resources that I bookmarked and will use for my learning resource in the future (I think most of the list are already mentioned on the Solana Developer website.)



Happy Coding ❤️