Installing Rust via rustup

Step-by-step guide to installing Rust on Windows, macOS, and Linux with rustup, selecting the correct toolchain for Tauri v2, verifying the installation, and handling common problems.

rustup is the official toolchain manager for Rust. It installs the Rust compiler (rustc), the package manager and build tool (cargo), and the version manager itself (rustup). Using rustup gives you the latest stable Rust release and the ability to switch between toolchains — exactly what Tauri v2 expects. System package managers often ship outdated versions without cargo, so rustup is the correct route for development.

Pick your operating system below. The steps are ordered: each one depends on the one before it.

1

Download and run the rustup installer

Visit rust-lang.org/tools/install and download rustup-init.exe for your architecture (x64 or ARM64). Run the executable.

Alternatively, use winget or Chocolatey from PowerShell:

winget install --id Rustlang.Rustup
choco install rustup.install

During the installation, the prompt asks for a default host triple. Choose x86_64-pc-windows-msvc (or i686-pc-windows-msvc / aarch64-pc-windows-msvc if your system is 32‑bit or ARM64).

MSVC toolchain is mandatory for Tauri:

Tauri on Windows compiles Rust code with the MSVC linker. If the installer sets stable-gnu (the GNU toolchain), Tauri builds will fail. After installation, enforce the correct default by running:

rustup default stable-msvc

Verify with rustup show. The active toolchain must end with -msvc, not -gnu.

2

Reload your shell environment

The installer usually updates the PATH environment variable, but the change may not take effect until you restart the terminal. Open a new Command Prompt or PowerShell window.

If rustc still isn't found, add %USERPROFILE%\.cargo\bin to PATH manually through Edit environment variables in the Control Panel, then restart the terminal.

3

Confirm the installation

Run both commands below. They should print the version numbers and a commit hash:

rustc --version
cargo --version

If you see something like rustc 1.80.0 (xxxxxxxxx 20xx-xx-xx), the installation succeeded.

If you see version output, Rust is installed successfully:

Both rustc and cargo print the version, a commit hash, and a build date. That exact format means rustup has set everything up correctly. You can now proceed to the rest of the environment setup.

What rustup actually installed

Running the installer places three core tools in ~/.cargo/bin (or %USERPROFILE%\.cargo\bin on Windows):

  • rustup — the toolchain manager itself. Use it to install, update, and switch between Rust releases.
  • rustc — the Rust compiler. It turns .rs source files into native executables.
  • cargo — the Rust package manager and build system. It creates projects, fetches dependencies, and invokes rustc with the correct flags.

All three are versioned together and kept in sync by rustup. The ~/.cargo directory also stores the registry of community crates and build caches.

Managing your Rust toolchain

Updating Rust

Rust ships a new stable version every six weeks. Keeping it current is a single command:

rustup update

This updates rustup itself, the active toolchain, and any installed components like clippy or rustfmt. Run it periodically so you always have the latest improvements and security patches.

Switching between stable, beta, and nightly

The default installation gives you the stable channel — what most projects should use. If you need nightly features (for example, for some Tauri plugins that require a newer compiler), install and switch:

rustup toolchain install nightly
rustup default nightly

To go back to stable:

rustup default stable

If you need nightly only for a single command without changing the global default, use rustup run:

rustup run nightly cargo build

Pinning a specific version

For reproducible builds in CI or Docker, pin the exact version your project requires. Create a rust-toolchain.toml file in the project root:

[toolchain]
channel = "1.80.0"

Anyone with rustup who enters the directory will automatically use that version.

Uninstalling Rust

To remove Rust and rustup entirely:

rustup self uninstall

Confirm with y. This deletes ~/.cargo and ~/.rustup (or their Windows equivalents) and reverts any shell profile changes.

Common installation problems

rustc is not recognized after installation

This almost always means the shell does not know where the binaries live. On macOS and Linux, run source "$HOME/.cargo/env" in the current terminal or open a new one. On Windows, restart the terminal. If the problem persists, manually add the bin directory to PATH and reload.

Forgetting to restart the terminal causes 'command not found' errors:

The installer edits your shell profile, but the change does not take effect in already-open windows. Until you restart or source the environment file, rustc and cargo will not be found. This is the most frequent issue after a fresh install.

Linker errors when building a program

When you try to compile a Rust project and see:

error: linker `cc` not found

it means the system lacks a C compiler and linker. Rust uses the platform’s linker to produce final executables.

The linker is not part of Rust itself:

Rust does not ship its own linker. You must have the platform’s development tools installed. If you skip this, compilation fails even though Rust itself is installed correctly.

error: toolchain 'stable-x86_64-pc-windows-gnu' is not installed or Tauri build failures

This happens when the default toolchain on Windows is set to the GNU ABI instead of MSVC. Tauri requires the MSVC toolchain.

Check which toolchain is active:

rustup show

If the line starts with stable-x86_64-pc-windows-gnu, switch to MSVC:

rustup default stable-msvc

After the switch, rustup show should list stable-x86_64-pc-windows-msvc as the default.

Next Steps

With Rust installed and verified, proceed to setup Node.js and package managers in Installing Node.js.