Currently viewing the human version
Switch to AI version

Why AVM Exists (And Why You Need It)

Before AVM, managing Anchor versions was a nightmare. You'd have one project that needed Anchor 0.29.0, another that broke unless you used 0.30.1, and your latest side project that required bleeding-edge 0.31.x features. Switching between them meant manually installing and uninstalling Anchor versions, which inevitably led to:

  • PATH conflicts where the wrong version was being used
  • Broken builds because dependencies got mixed up
  • Hours wasted debugging environment issues instead of writing Solana programs
  • Team members using different versions and builds mysteriously failing in CI

AVM fixes this the same way nvm fixes Node.js version hell. Install multiple Anchor versions, switch between them with a single command, and stop losing your mind over dependency management.

What Actually Breaks Without AVM

Version Lock-In Hell

You start a project with Anchor 0.29.0. Six months later, you want to use a new feature from 0.31.0, but updating breaks half your existing code. With AVM, you can keep 0.29.0 for the old project and use 0.31.0 for new features.

Verifiable Build Requirements

If you're building anything users will actually interact with, you need verifiable builds. This means using exact Anchor versions, not "whatever was latest when I ran cargo install." AVM lets you pin exact versions and even install from specific Git commits.

Team Synchronization Issues

"Works on my machine" becomes "works with my Anchor version." AVM makes it trivial to ensure everyone on the team uses the exact same Anchor version. Add the version to your README and everyone runs avm use 0.31.1.

CI/CD Reproducibility

Building different binaries from the same source code depending on which Anchor version the CI runner happened to have installed is a recipe for production bugs. With AVM, your CI scripts can pin the exact version: avm install 0.31.1 && avm use 0.31.1.

Integration Reality Check

AVM works with your existing Solana toolchain setup. It doesn't care about your Solana CLI version or how you installed Rust. It just manages the anchor binary and gets out of your way.

The official Anchor docs recommend AVM installation because the alternatives (npm package, cargo direct install) all have gotchas that waste your time. The npm package is often outdated, and cargo installs can conflict with system packages.

Getting AVM Installed (Without Breaking Everything)

Installing AVM is pretty straightforward, assuming your Rust setup isn't completely fucked. If you don't have Rust installed yet, you'll need it first - but if you're doing Solana development and don't have Rust, you've got bigger problems than version management.

Prerequisites (The Boring But Necessary Stuff)

You need:

  • Rust/Cargo: Obviously. If cargo --version doesn't work, install Rust first.
  • Git: For cloning repos during install. If you don't have git, what are you even doing?
  • A brain: Windows users need WSL. Trust me on this one.

Don't try to install AVM directly on Windows. I've seen too many people waste hours fighting PATH issues and weird compilation errors. Just use WSL and save yourself the headache.

The One Command That Actually Works

cargo install --git https://github.com/coral-xyz/anchor avm --force

The --force flag is important - it overwrites any existing AVM install. Without it, you might end up with a broken installation that fails silently.

This downloads the AVM source, compiles it (takes 1-2 minutes), and installs the binary to ~/.cargo/bin/. If that directory isn't in your PATH, add it to your .bashrc or .zshrc:

export PATH=\"$HOME/.cargo/bin:$PATH\"

Rust Installation on Ubuntu

Actually Using AVM (The Commands You'll Run 100 Times)

Install Anchor versions:

## Get the latest version (usually what you want)
avm install latest

## Install a specific version for compatibility
avm install 0.31.1

## Install from a specific commit for verifiable builds
avm install 0.31.0-d1ca820

Each version is ~100-200MB, so don't go crazy installing every version that ever existed.

Switch between versions:

## Use latest for new projects
avm use latest

## Switch to specific version for old projects
avm use 0.31.1

## Check what's currently active
anchor --version

See what you have installed:

## List all installed versions
avm list

## Update AVM itself when new features come out
cargo install --git https://github.com/coral-xyz/anchor avm --force

Things That Will Break (And How to Fix Them)

"Command not found: avm"

Your PATH is missing ~/.cargo/bin. Add it to your shell config and restart your terminal.

"Command not found: anchor" after installing

You installed a version but didn't activate it. Run avm use latest or whatever version you installed.

Multiple anchor installations fighting each other

If you had Anchor installed via npm before using AVM, uninstall it first:

npm uninstall -g @project-serum/anchor-cli

Compilation fails during AVM install

Your Rust version is probably ancient. Update it:

rustup update stable

For more help with Rust issues, check Stack Overflow or update your Rust version first.

Windows Users: Just Use WSL

Windows support exists as of 2025, but every Windows user I know who tries native installation ends up switching to WSL anyway. The Solana ecosystem assumes a Unix-like environment, and fighting that assumption isn't worth your time.

Install WSL, install Rust inside WSL, then install AVM inside WSL. Your future self will thank you.

CI/CD Integration

In your build scripts, pin the exact version:

avm install 0.31.1
avm use 0.31.1
anchor build

Don't use avm install latest in CI unless you enjoy builds that randomly break when new Anchor versions come out.

Verifiable Builds and Real-World Usage

If you're building anything that handles real money (which is most Solana programs), you need verifiable builds. Without this, users have to trust that you didn't backdoor their funds. That's not happening in 2025.

Why Verifiable Builds Matter

In traditional software, you can trust developers. In DeFi, trusting developers is how you lose millions of dollars. Verifiable builds let anyone rebuild your program and verify it matches what's on-chain.

AVM makes this possible by letting you install exact commit hashes, not just version tags:

## Install from the exact commit used for the deployment
avm install 0.31.0-d1ca820
avm use 0.31.0-d1ca820
anchor build --verifiable

The --verifiable flag ensures the build is reproducible. Different machines should produce identical bytecode, which users can verify against your deployment.

Team Workflow That Actually Works

Here's how teams use AVM without constantly breaking each other's environments:

Document the version in your README:
### Development Setup
1. Install AVM: `cargo install --git https://github.com/coral-xyz/anchor avm --force`
2. Install project Anchor version: `avm install 0.31.1 && avm use 0.31.1`
3. Build: `anchor build`
Add version checks to your build scripts:
#!/bin/bash
required_version="0.31.1"
current_version=$(anchor --version | cut -d' ' -f2)

if [ "$current_version" != "$required_version" ]; then
    echo "Wrong Anchor version. Run: avm use $required_version"
    exit 1
fi

anchor build

This prevents the classic "it works on my machine" problems when team members use different Anchor versions.

Managing Multiple Projects

The reality: you'll have 3-4 Solana projects in different stages, each requiring different Anchor versions because the ecosystem moves fast and breaks things.

## Old project stuck on 0.29.0 because updating breaks everything
cd legacy-project
avm use 0.29.0
anchor build

## New project using latest features
cd new-hotness
avm use latest
anchor build

## Production project using specific commit for verifiable builds
cd production-app
avm use 0.31.0-d1ca820
anchor build --verifiable

AVM doesn't auto-switch like nvm does for Node.js - you have to remember to switch manually. This is actually good because accidentally building with the wrong version can be catastrophic.

Your SSD Will Fill Up Fast

Each Anchor version is 200MB. If you install 10 versions, that's 2GB. AVM doesn't have a built-in cleanup command yet, so you manually delete versions from `/.avm/` when you don't need them anymore.

## See what's taking up space
du -sh ~/.avm/*

## Remove old versions manually
rm -rf ~/.avm/0.28.0

Pro tip: Keep the last 3-4 versions and delete the rest unless you have specific reasons to keep older ones.

Common Fuck-Ups and Fixes

Building with the wrong version

Symptom: Mysterious compilation errors or different behavior than expected.
Fix: Always check anchor --version before building. Make it a habit.

PATH conflicts with old installations

Symptom: anchor --version shows a different version than avm list indicates is active.
Fix: Uninstall all non-AVM Anchor installations:

npm uninstall -g @project-serum/anchor-cli
cargo uninstall anchor-cli
CI builds not reproducible

Symptom: CI produces different artifacts than local builds.
Fix: Pin the exact AVM version and Anchor version in CI:

cargo install --git https://github.com/coral-xyz/anchor avm --force
avm install 0.31.1
avm use 0.31.1
Windows weirdness

Symptom: Everything breaks in subtle ways on Windows.
Fix: Use WSL. Seriously, just use WSL. Native Windows support exists but it's not worth the pain.

CI/CD Integration That Doesn't Break

In production CI/CD, use exact versions, not latest:

## GitHub Actions example
- name: Install AVM
  run: cargo install --git https://github.com/coral-xyz/anchor avm --force

- name: Install specific Anchor version
  run: |
    avm install 0.31.1
    avm use 0.31.1

- name: Verify version
  run: anchor --version

- name: Build verifiable
  run: anchor build --verifiable

Never use avm install latest in CI unless you want random build failures when new Anchor versions drop.

Questions You'll Actually Ask

Q

Why use AVM instead of just installing Anchor normally?

A

Because "installing Anchor normally" is a fucking nightmare.

Try working on 3 different Solana projects that need different Anchor versions and see how long it takes before you want to switch careers. AVM is like nvm for Node.js

  • it lets you have multiple versions installed and switch between them without breaking everything.Also, if you ever need verifiable builds (which you do if you're building anything that handles real money), you need exact version control that only AVM provides.
Q

Do I really need this for just one project?

A

Probably not right now, but you will eventually. New Solana projects use latest Anchor versions. Old projects break when you update. Side projects need experimental features. It's easier to install AVM now than to fight version conflicts later.Plus, the official docs recommend AVM installation anyway, so just use it.

Q

Can't I just use `cargo install anchor-cli` like normal?

A

You can, but it sucks. Here's what happens:

  • You can only have one version installed at a time
  • Updating breaks old projects
  • No verifiable builds (cargo picks whatever dependencies it feels like)
  • Version conflicts when working on multiple projects
  • The npm package @project-serum/anchor-cli is abandoned and randomly breaks

Use AVM. It's not worth the pain.

Q

"anchor: command not found" - what the fuck?

A

You either didn't install an Anchor version or didn't activate it:

## Install and activate latest version
avm install latest
avm use latest

## Check if it worked
anchor --version

If it still doesn't work, your PATH is missing ~/.cargo/bin. Add this to your .bashrc or .zshrc:

export PATH="$HOME/.cargo/bin:$PATH"

Then restart your terminal.

Q

Which Anchor version should I use?

A

For new projects in 2025: use latest (avm install latest && avm use latest).

For existing projects: use whatever version the project was built with. Check the README or ask whoever started the project. Using the wrong version will break builds in subtle, annoying ways.

For production: use the exact commit hash for verifiable builds.

Q

How do I update AVM?

A

Same command as installation:

cargo install --git https://github.com/coral-xyz/anchor avm --force

The --force flag overwrites the old version. Do this when new AVM features come out or when it stops installing new Anchor versions.

Q

Does this work on Windows?

A

Technically yes, but you'll have a better life using WSL. The Solana ecosystem assumes Unix-like environments. Fighting this assumption is not worth your time.

If you insist on native Windows, follow the official guide, but don't come crying when random shit breaks.

Q

This is eating my SSD - how much space does it need?

A

Each Anchor version is ~200MB. Install 10 versions and you're looking at 2GB. AVM doesn't auto-clean old versions, so you manually delete them:

## See what's installed
avm list

## Remove old versions manually
rm -rf ~/.avm/0.28.0

Keep the last 3-4 versions and delete the rest.

Q

My builds aren't reproducible between machines - help?

A

Use exact versions, not latest:

## Bad - this gives different results on different machines
avm use latest

## Good - everyone gets the same version
avm use 0.31.1

## Best - exact commit for verifiable builds
avm use 0.31.0-d1ca820

For CI/CD, pin everything:

avm install 0.31.1
avm use 0.31.1
anchor build
Q

I'm getting version conflicts with old Anchor installs

A

Clean up old installations first:

## Remove npm version
npm uninstall -g @project-serum/anchor-cli

## Remove cargo version
cargo uninstall anchor-cli

## Then install via AVM
avm install latest
avm use latest

If anchor --version still shows a different version than avm list, your PATH has the wrong directory first. Fix your shell config.

Q

Can I auto-switch versions per project like nvm?

A

No. AVM doesn't have .avm-version files or auto-switching. You manually run avm use <version> when switching projects. This is actually good - accidentally building with the wrong version can be catastrophic in blockchain development.

Document the required version in your project README so people know what to run.

Version Management Tool Comparison

Feature

AVM (Just Use This)

Manual Installation

NPM Installation

Cargo Direct Install

Multiple Versions

Works like it should

Nightmare fuel

Broken half the time

Doesn't work

Verifiable Builds

Actually works

Pain in the ass

Doesn't work

Doesn't work

Official Support

Recommended by actual devs

Deprecated for good reason

Abandoned garbage

Bare minimum

Installation Command

avm install 0.31.1

Manual compilation hell

npm install -g @coral-xyz/anchor-cli

cargo install anchor-cli

Version Switching

avm use <version>

Manual PATH hell

Doesn't exist

Reinstall every time

Disk Usage

~200MB per version

Depends on your mistakes

~100MB

~100MB single

Update Process

avm install latest

Start from scratch

npm update -g (maybe)

cargo install --force

Stability

Stable

Depends on your sanity

Random conflicts

Usually works

Team Collaboration

Everyone uses same version

Good luck syncing

Version conflicts guaranteed

Impossible to sync

Related Tools & Recommendations

tool
Popular choice

jQuery - The Library That Won't Die

Explore jQuery's enduring legacy, its impact on web development, and the key changes in jQuery 4.0. Understand its relevance for new projects in 2025.

jQuery
/tool/jquery/overview
60%
tool
Popular choice

Hoppscotch - Open Source API Development Ecosystem

Fast API testing that won't crash every 20 minutes or eat half your RAM sending a GET request.

Hoppscotch
/tool/hoppscotch/overview
57%
tool
Similar content

Anchor Framework - Solana Development Framework for Smart Contracts

Simplify Solana Program Development with Rust-based Tools and Enhanced Security Features

Anchor Framework
/tool/anchor/overview
56%
tool
Popular choice

Stop Jira from Sucking: Performance Troubleshooting That Works

Frustrated with slow Jira Software? Learn step-by-step performance troubleshooting techniques to identify and fix common issues, optimize your instance, and boo

Jira Software
/tool/jira-software/performance-troubleshooting
55%
tool
Recommended

GitHub Actions - CI/CD That Actually Lives Inside GitHub

integrates with GitHub Actions

GitHub Actions
/tool/github-actions/overview
55%
integration
Recommended

GitHub Actions + AWS Lambda: Deploy Shit Without Desktop Boomer Energy

AWS finally stopped breaking lambda deployments every 3 weeks

GitHub Actions
/brainrot:integration/github-actions-aws/serverless-lambda-deployment-automation
55%
integration
Recommended

Docker + GitHub Actions CI/CD Pipeline Integration - Stop Building Containers Like a Caveman

Docker + GitHub Actions: Because Manual Deployments Are for Psychopaths

Docker
/brainrot:integration/docker-github-actions/ci-cd-workflow-automation
55%
howto
Recommended

Install Node.js with NVM on Mac M1/M2/M3 - Because Life's Too Short for Version Hell

My M1 Mac setup broke at 2am before a deployment. Here's how I fixed it so you don't have to suffer.

Node Version Manager (NVM)
/howto/install-nodejs-nvm-mac-m1/complete-installation-guide
54%
tool
Similar content

AVM - Stop Fighting Anchor Version Hell

Fix those \"it works on my machine\" problems where you waste your entire afternoon

Anchor Version Manager (AVM)
/tool/avm/overview
53%
tool
Popular choice

Northflank - Deploy Stuff Without Kubernetes Nightmares

Discover Northflank, the deployment platform designed to simplify app hosting and development. Learn how it streamlines deployments, avoids Kubernetes complexit

Northflank
/tool/northflank/overview
52%
tool
Similar content

Anchor Security - Lessons from $320M in Production Disasters

The exact security patterns that keep protocols from getting drained

Anchor Framework
/tool/anchor/security-best-practices
51%
howto
Similar content

Build a DePIN That Won't Bankrupt You - Production Deployment Guide

Why centralized infrastructure fails and how to not fuck it up yourself

/howto/depin-development/complete-setup-guide
51%
tool
Similar content

Solana Web3.js - JavaScript SDK That Won't Make You Quit Programming

Master Solana Web3.js: Understand v1.x vs v2.0, installation, and real-world development. Get practical tips for building Solana dApps and Anchor compatibility.

Solana Web3.js
/tool/solana-web3js/overview
50%
tool
Popular choice

LM Studio MCP Integration - Connect Your Local AI to Real Tools

Turn your offline model into an actual assistant that can do shit

LM Studio
/tool/lm-studio/mcp-integration
50%
howto
Recommended

Tired of Python Version Hell? Here's How Pyenv Stopped Me From Reinstalling My OS Twice

Stop breaking your system Python and start managing versions like a sane person

pyenv
/howto/setup-pyenv-multiple-python-versions/overview
49%
tool
Recommended

pyenv-virtualenv - Stops Python Environment Hell

similar to pyenv-virtualenv

pyenv-virtualenv
/tool/pyenv-virtualenv/overview
49%
tool
Recommended

Pyenv - Stop Fighting Python Version Hell

Switch between Python versions without your system exploding

Pyenv
/tool/pyenv/overview
49%
tool
Popular choice

CUDA Development Toolkit 13.0 - Still Breaking Builds Since 2007

NVIDIA's parallel programming platform that makes GPU computing possible but not painless

CUDA Development Toolkit
/tool/cuda/overview
47%
tool
Similar content

Anchor Framework Performance Optimization - The Shit They Don't Teach You

No-Bullshit Performance Optimization for Production Anchor Programs

Anchor Framework
/tool/anchor/performance-optimization
45%
tool
Recommended

Cargo - Rust's Build System That Actually Works (When It Wants To)

The package manager and build tool that powers production Rust at Discord, Dropbox, and Cloudflare

Cargo
/tool/cargo/overview
45%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization