LinuxCommandLibrary

cargo-binstall

Install pre-built Rust binaries

TLDR

Install a package from

$ cargo binstall [package]
copy

Install a specific version of a package (latest by default)
$ cargo binstall [package]@[version]
copy

Install a package and disable confirmation prompts
$ cargo binstall [[-y|--no-confirm]] [package]
copy

SYNOPSIS

cargo binstall [OPTIONS] [CRATES]...

PARAMETERS

-h, --help
    Print help information

-V, --version
    Print version information

--dry-run
    Simulate installation without downloading or installing

-f, --force
    Force reinstallation, overwriting existing binaries

--git <URL>
    Install from Git repository URL instead of crates.io

--no-binary
    Fallback to source compilation if binary unavailable

--no-confirm
    Skip confirmation prompts

--no-symlinks
    Install binaries directly, no Cargo bin symlinks

--root <PATH>
    Custom installation root directory

-v, --verbose
    Enable verbose output

--index-mirror <URL>
    Use alternative binary index mirror

DESCRIPTION

Cargo-binstall is a Cargo subcommand that installs prebuilt binaries for Rust crates, serving as a faster alternative to cargo install. Instead of compiling from source—which requires a full Rust toolchain and can take minutes—it downloads ready-to-run executables from GitHub release assets (or other index sources). This results in near-instant installations, minimal disk usage, and no Rust dependencies on the target system.

Ideal for distributing tools like ripgrep, bat, or fd to end-users. It automatically resolves and installs dependencies first, supports crates.io and Git repositories, and handles platform-specific binaries (Linux, macOS, Windows). By default, it uses the official binstall index on GitHub, but custom indexes can be configured.

Usage mirrors Cargo: cargo binstall crate-name. It's secure, verifying downloads with checksums, and widely adopted in the Rust ecosystem for CI/CD and user-facing tools.

CAVEATS

Requires crates to publish prebuilt binaries to GitHub releases; not all crates support it. Network-dependent; verify checksums for security.

BOOTSTRAP INSTALL

Self-install with curl -sSfL https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

INDEX SOURCES

Defaults to https://github.com/cargo-bins/cargo-binstall-index; lists supported crates

HISTORY

Created by Mattias Sköld (mstorsjo) in 2022 as 'binstall', renamed to cargo-binstall. Rapidly adopted for efficient Rust tool distribution; version 1.0 released 2023 with official index support.

SEE ALSO

cargo(1), rustup(8)

Copied to clipboard