← Table of contents

0.1 The Empty Workbench

Experienced people rarely explain the first step. For them it stopped being a step long ago - it is simply something that was done at some point, no one remembers when, and has been ready ever since. The apprentice who walks into the workshop for the first time finds an empty workbench and understands something important: before the work can begin, there is other work to do. Tools do not appear on their own.

What You Need

The Rust workshop has three main tools. rustc is the compiler: it takes source code and turns it into an executable. cargo is the helper: it builds projects, manages dependencies, and runs tests. rustup is the installer and keeper: it knows how to fetch both tools and keep them up to date.

You do not need to install rustc or cargo directly. rustup will bring them.

Installation

On Linux and macOS, one command is enough:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

The script will ask about installation options. The default works for most cases - press 1 and Enter. Once it finishes, either restart your terminal or run:

source "$HOME/.cargo/env"

On Windows, download and run rustup-init.exe from the official rustup.rs page - the process is the same, but in a graphical installer.

When installation is complete, confirm the tools respond:

rustc --version
cargo --version

The output looks something like this:

rustc 1.95.0 (59807616e 2026-04-14)
cargo 1.95.0 (f2d3ce0bd 2026-03-21)

The exact numbers depend on when you installed. What matters is that the commands return a version, not an error.

The Result

Tools on the wall. rustc and cargo respond when called. The workbench is ready.


Lore: Starting Fresh

Sometimes it is useful to confirm the installation is clean - especially if Rust was already on the machine in some unknown state. rustup can remove itself entirely: the tools, all installed compiler versions, the cache - everything.

rustup self uninstall

The command deletes the ~/.rustup and ~/.cargo directories and removes the entries from your shell profile. After it runs, the system is back to the state it was in before Rust was ever installed. No traces remain.


Lore: rustup and Rust Versions

rustup is not just an installer. It manages multiple versions of Rust simultaneously and knows how to update them without manual intervention.

Rust has three release channels: stable, beta, and nightly. Stable ships every six weeks and guarantees backward compatibility - code written today will compile a year from now. Nightly is built daily from the latest compiler; it carries experimental features not yet ready for stable. Beta is the next stable cycle going through its final checks.

Stable is enough for all the work in this book. You can update the toolchain at any time with one command:

rustup update