Introduction
rustup is the official installer and version manager for the Rust programming language. It manages multiple Rust toolchain versions side by side, handles cross-compilation targets, and installs companion tools like clippy and rustfmt. It is the recommended way to install Rust on any platform.
What rustup Does
- Installs and updates stable, beta, and nightly Rust toolchains with a single command
- Manages cross-compilation targets like WebAssembly, ARM, and RISC-V
- Installs and updates components including clippy, rustfmt, rust-src, and rust-analyzer
- Supports per-directory toolchain overrides via
rust-toolchain.tomlfiles - Provides proxy binaries that route
rustc,cargo, and other tools to the active toolchain
Architecture Overview
rustup installs itself as a set of proxy binaries (rustc, cargo, rustup) that detect which toolchain to use based on directory overrides, environment variables, or the default setting. When invoked, the proxy resolves the correct toolchain path and executes the real binary. Toolchains are downloaded as compressed archives from Rust's official distribution servers and stored in ~/.rustup/toolchains/. Each toolchain is self-contained with its own compiler, standard library, and installed components.
Self-Hosting & Configuration
- Install on Unix with the one-liner:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - On Windows, download and run
rustup-init.exefrom https://rustup.rs - Set a project-specific toolchain by creating a
rust-toolchain.tomlwith[toolchain] channel = "nightly" - Configure the default toolchain with
rustup default stableorrustup default nightly-2026-01-15 - Set
RUSTUP_HOMEandCARGO_HOMEenvironment variables to customize installation directories
Key Features
- Seamless switching between stable, beta, nightly, and dated nightly toolchains
- Cross-compilation target management with
rustup target addfor dozens of platforms - Component management for optional tools like miri, rust-src, and llvm-tools
- Automatic toolchain selection per project via rust-toolchain.toml
- Self-update capability that keeps rustup itself current alongside toolchains
Comparison with Similar Tools
- asdf — generic version manager for many languages; rustup is Rust-specific with deeper component and target management
- Nix — reproducible package manager; rustup provides Rust-specific ergonomics like target and component management
- mise — polyglot dev tool manager; rustup remains the canonical way to manage Rust with full component support
- Manual download — pre-built binaries are available but lack multi-version and cross-target management
- cargo-binstall — installs Rust binaries; rustup manages the compiler toolchain itself
FAQ
Q: How do I install a specific nightly version?
A: Use rustup install nightly-2026-01-15 to pin a dated nightly, then set it as default or add a rust-toolchain.toml file.
Q: Can I use rustup in CI/CD?
A: Yes. Most CI services pre-install rustup. Use rustup show to verify the toolchain and rustup target add to set up cross-compilation targets.
Q: Does rustup work offline?
A: Not for installation, but once toolchains are downloaded they work fully offline. You can also set up a local mirror with RUSTUP_DIST_SERVER.
Q: How do I uninstall a toolchain I no longer need?
A: Run rustup toolchain uninstall nightly to remove a specific toolchain and free disk space.