LinuxWindowsmacOS

Where Does rustup Store Toolchains?

Where rustup keeps toolchains, targets, and settings via RUSTUP_HOME, plus where cargo bins live.

Last updated

rustup installs every toolchain under one home directory, RUSTUP_HOME, which defaults to ~/.rustup on Linux and macOS and %USERPROFILE%/.rustup on Windows. Each toolchain gets its own subfolder with cargo, rustc, and docs inside.

Settings and update state sit beside the toolchains in settings.toml. The cargo side (~/.cargo) holds registries and your installed binaries, so the two folders split compiler from packages. Move both together if you relocate Rust with env vars.

Where rustup stores this, by platform

Linux
~/.rustup/

Toolchains plus settings.toml. Override with RUSTUP_HOME. Binaries you installed via cargo live separately under CARGO_HOME (~/.cargo/bin).

Windows
%USERPROFILE%\.rustup\

Same toolchains layout. Default under the user profile; override with the RUSTUP_HOME variable. Keep paths short to dodge Windows length limits on deep toolchain trees.

macOS
~/.rustup/

Same layout as Linux. Xcode CLT must exist for linking, but toolchains themselves stay inside RUSTUP_HOME regardless of Xcode updates.

Frequently asked questions

How do I remove an old toolchain?

Delete the toolchain folder under toolchains/ for the version you want gone, or run rustup toolchain uninstall <name>. Never delete the whole RUSTUP_HOME unless you plan to reinstall Rust entirely.

Is that the same as the cargo folder?

No. rustup manages compilers in RUSTUP_HOME while cargo keeps packages, registries, and binaries in CARGO_HOME (~/.cargo). Back up both for a full Rust setup, or just the project plus Cargo.lock for code alone.

Notice an outdated path? Let us know.