Step 9: Install Anchor on Windows and WSL

Anchor is a framework for Solana smart contract development. It simplifies the process of writing, testing, and deploying programs on SVM blockchains. To ensure compatibility and flexibility in your development environment, it's recommended to install Anchor both on your Windows system and within WSL. This section covers the installation process for both environments.

Install Anchor in Windows Terminal

  1. Open Windows Terminal as Administrator:

    • This is necessary to ensure that the installation process has the required permissions.

  2. Install Anchor CLI:

    • Run the following command in the terminal:

      cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
    • This command downloads and installs the latest version of Anchor CLI from the official GitHub repository.

  3. Verify Installation:

    • To check that Anchor was installed correctly, type:

      anchor --version
    • The terminal should display the version of Anchor CLI installed.

Install Anchor in WSL

To install Anchor within your WSL environment, follow these steps:

  1. Open WSL Terminal:

    • Launch your WSL terminal from the Start menu or through VS Code's Remote - WSL extension.

  2. Install Anchor CLI:

    • Execute the same Cargo command within your WSL terminal:

      cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
    • This ensures that Anchor CLI is available in your Linux environment, offering consistency across your development platforms.

  3. Verify Installation:

    • Confirm the installation by checking the Anchor version in WSL:

      anchor --version
    • The version number indicates that Anchor CLI is ready for use within WSL.

Last updated