0.6Installing Rust

Last updated June 11, 2026

Time to install the toolchain: rustc, Cargo, and their supporting cast. If you've ever followed a programming-language install guide through competing downloads, version matrices, and three ways to do everything, you can relax. There is exactly one official way to install Rust, it's the same on every platform, and it's the one everybody uses. The lack of choices here is a feature. Every tutorial, forum answer, and coworker assumes the same setup you're about to have.

The one way is a small program called rustup. It installs the toolchain, and afterward it stays around as the manager: one command updates everything, and another removes it all cleanly if you ever want out.

Find your operating system below; we'll verify the install together at the end.

Installing on Windows

Windows needs one prerequisite first. Remember from lesson 0.5 that building an executable ends with a linker. On Windows, the standard linker comes from Microsoft, inside a free package called the Build Tools for Visual Studio. (Despite the name, you are not installing the Visual Studio IDE, just its command-line build machinery.)

  1. Download the Build Tools from visualstudio.microsoft.com/downloads. The package is named Build Tools for Visual Studio (search the page; Microsoft enjoys rearranging it).
  2. Run it, and when the installer asks what to install, check the workload named Desktop development with C++. The default selections within it are fine.
  3. Let it finish; it's a few gigabytes, so this is a good tea break.

Now Rust itself:

  1. Go to rustup.rs and download rustup-init.exe. The site offers a 64-bit and an ARM64 version; pick the one matching your machine (most Windows PCs are 64-bit x86, some newer laptops are ARM64, and Settings → System → About will tell you, under "System type").
  2. Run it. You'll get a console window that checks for the Build Tools (and points you back at them if they're missing), then offers install options. Choose option 1, Proceed with standard installation; the defaults are exactly what you want.
  3. When it reports success, close the console, and open a fresh terminal so it picks up the new PATH.

Installing on macOS and Linux

On macOS, install Apple's Command Line Tools first if you haven't (they provide the linker; same idea as Windows's Build Tools, smaller download). In the Terminal:

xcode-select --install

If it says the tools are already installed, even better. On Linux, the equivalent is a C compiler and friends: on Ubuntu or Debian, sudo apt install build-essential covers it, and most other distributions have an analogous package group.

Then, on either system, run the official install command from rustup.rs:

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

That downloads rustup and starts it. Choose option 1, Proceed with standard installation, and when it finishes, open a fresh terminal (or run the source command it suggests) so the tools are on your PATH.

Tip

If "download a script from the internet and run it" makes you pause — good instinct. This particular command is the official installation method, documented at rustup.rs, and you're welcome to download the script and read it before running it. The instinct will serve you well; this is the rare case where the answer is "yes, it's really fine."

Verifying the install

Whatever your platform, open a new terminal and run:

rustc --version

You should get back one line naming the installed version, something like:

rustc 1.96.0 (ac68faa20 2026-05-25)

(That's the current version as this lesson is written; yours may well be newer.) If you see a version line, congratulations: you have a working Rust toolchain. If you instead get "command not found" (or Windows's "not recognized"), the fix is almost always just opening a fresh terminal; lesson 0.9 has the full checklist.

Everything lives in a .cargo/bin folder in your home directory, and rustup installed the stable toolchain, the current six-week release we discussed in lesson 0.3. (Beta and experimental "nightly" toolchains exist for people who test the future; everything in this course runs on stable, which is where you should stay.)

Keeping it current, and other rustup chores

When a new Rust version ships, updating is one command:

rustup update

Curious whether you're behind? rustup check tells you without changing anything. And should you ever want Rust gone, rustup self uninstall removes the toolchain cleanly: no registry archaeology, no orphaned files. Install, update, uninstall. That's the entire lifecycle, and you've now seen all of it.

Best practice

Run rustup update every few weeks. New stable releases arrive every six, updates take under a minute, and staying current means compiler improvements (including ever-better error messages) arrive while they're still improvements rather than archaeology.

Toolchain: installed. In the next lesson, we'll give you a proper place to write code. Then, at last, you'll compile something.