TL;DR:
rustupis the official installer and version manager for Rust. It installsrustc,cargo,clippy,rustfmt, and the standard library in one command. Userustup updateto get the latest stable Rust. Userustup target addfor cross-compilation. Userustup override set nightlyto use nightly Rust in specific directories.rustupreplaces the need for system package managers to install Rust; always install Rust throughrustup, notapt/brew.
What Is rustup?
rustup installs and manages Rust toolchains; the compiler (rustc), package manager (cargo), and associated tools; and lets you switch between stable, beta, and nightly versions.
# Install rustup (and Rust) on Linux/macOS
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Verify installation
rustc --version # rustc 1.xx.0 (...)
cargo --version # cargo 1.xx.0 (...)
rustup --version # rustup 1.xx.x (...)What Are the Essential rustup Commands?
rustup update # update all installed toolchains to latest
rustup show # show installed toolchains and active one
rustup toolchain list # list installed toolchains
# Install specific versions
rustup toolchain install stable
rustup toolchain install nightly
rustup toolchain install 1.75.0 # exact version
# Set default toolchain
rustup default stable
rustup default nightly
# Override toolchain for a specific directory (stored in rust-toolchain.toml)
rustup override set nightly
# Add components
rustup component add clippy
rustup component add rustfmt
rustup component add rust-analyzer # LSP for IDEs
rustup component add rust-src # source for stdHow Do You Add Cross-Compilation Targets?
rustup target add downloads the standard library precompiled for a target platform so you can cross-compile.
# Add common targets
rustup target add wasm32-unknown-unknown # WebAssembly
rustup target add x86_64-unknown-linux-musl # Static Linux binary
rustup target add aarch64-apple-darwin # Apple Silicon
rustup target add aarch64-unknown-linux-gnu # ARM Linux (Raspberry Pi, etc.)
rustup target add x86_64-pc-windows-gnu # Windows from Linux
# List all available targets
rustup target list
# Cross-compile
cargo build --target wasm32-unknown-unknown
cargo build --target x86_64-unknown-linux-muslHow Do You Pin a Rust Version With rust-toolchain.toml?
Add a rust-toolchain.toml file to your project to pin the Rust version for all contributors and CI.
# rust-toolchain.toml (in project root)
[toolchain]
channel = "stable" # or "nightly", "1.75.0"
components = ["clippy", "rustfmt"]
targets = ["wasm32-unknown-unknown"]rustup reads this file automatically; anyone running cargo build in the project gets the pinned toolchain installed silently.
What Is the Difference Between Stable, Beta, and Nightly?
| Channel | Release cadence | Use case |
|---|---|---|
stable | Every 6 weeks | Production code; always recommended |
beta | 6-week release candidate | Testing upcoming stable features |
nightly | Every night | Unstable features (#![feature(...)]) |
Most projects should use stable. Use nightly only when a dependency or feature requires it; lock it in rust-toolchain.toml so the build is reproducible.
Frequently Asked Questions
Never. System package managers often ship outdated Rust versions and don't manage toolchains, components, or targets. Always install Rust via rustup; it's the official, supported method.
rustup updateThis updates all installed toolchains. The Rust stable release ships every 6 weeks.
rustup self uninstallThis removes rustup, all toolchains, and all installed components cleanly.
rust-analyzer is the Rust Language Server; it powers IDE features (autocomplete, go-to-definition, inline errors) in VS Code, JetBrains, Neovim, etc. Install it with:
rustup component add rust-analyzerThen install the corresponding IDE extension.
Run rustup default stable to set the default. This is usually a fresh install without a completed setup.
Sources
Related Glossary Terms
- Cargo: The package manager installed alongside Rust via rustup
- Clippy: Linter installed as a rustup component
- WASM: WASM targets are added via
rustup target add
Keep Reading
- Learn Rust in 2026: rustup is the first command in every Rust setup guide
- Best Way to Learn Rust in 2026: configuring your toolchain correctly from the start
- Rust 2024 Edition: What's New: switching editions via rustup
