rustup(1)
rustup is the Rust toolchain installer and version manager for managing multiple Rust versions and targets.
Synopsis
rustup [COMMAND] [OPTIONS]Description
rustup is the official tool for installing and managing Rust compiler versions, targets, and components. It handles downloading, installing, and switching between stable, beta, and nightly Rust releases, as well as managing cross-compilation targets and additional tools.
rustup maintains multiple toolchains (compiler versions) simultaneously and allows you to set a default toolchain globally or override it per-project using a rust-toolchain.toml file. It also installs and manages rustup itself through automatic self-updates.
Common options
| Flag | What it does |
|---|---|
default <toolchain> | Set the default Rust toolchain (e.g., stable, nightly, 1.70.0) |
install <toolchain> | Install a specific Rust toolchain version or channel |
uninstall <toolchain> | Remove a toolchain and its associated binaries |
update | Update all installed toolchains and rustup itself to latest versions |
target list | List all available cross-compilation targets |
target add <target> | Install a cross-compilation target (e.g., wasm32-unknown-unknown) |
component list | List available components (rustfmt, clippy, rust-src, etc.) |
component add <component> | Install an additional component like rustfmt or clippy |
show | Display the currently active toolchain and target information |
toolchain list | List all installed toolchains |
-v, --verbose | Enable verbose output for debugging |
--no-self-update | Disable automatic rustup self-updates |
Examples
Set the stable Rust release as your default toolchain
rustup default stableInstall the latest nightly Rust compiler
rustup install nightlyUpdate all installed toolchains and rustup to the latest versions
rustup updateAdd WebAssembly compilation target to the current toolchain
rustup target add wasm32-unknown-unknownInstall rustfmt code formatter component
rustup component add rustfmtDisplay the active toolchain and currently selected targets
rustup showList all installed Rust toolchains with the active one marked
rustup toolchain listUse nightly Rust specifically for a particular project directory
rustup override set nightly --path /path/to/project