Setup guide

Build your Rust lab ๐Ÿงช

Pick your operating system below, or skip installs entirely and code in your browser. Either way, you'll be running real Rust in about ten minutes.

Rust on macOS

  1. Open the Terminal app Press โŒ˜ + Space, type Terminal, press Enter. This plain text window is your new laboratory: you type commands, the Mac obeys.
  2. Install Apple's command-line tools Rust needs Apple's linker (the tool that glues compiled code into an app). Paste this and press Enter; a dialog will guide you (takes a few minutes):
    xcode-select --install
    If it says "already installed", even better: skip ahead.
  3. Install Rust with rustup rustup is Rust's official installer and version manager. Paste:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    Press Enter to accept the default installation. It installs everything into your home folder: no admin password, easy to remove later.
    ๐Ÿบ Homebrew user? brew install rustup followed by rustup-init works too. Either route ends in the same place.
  4. Restart your terminal, then verify Close the Terminal window, open a new one, and type:
    rustc --version
    cargo --version
    Two version numbers = you're in. ๐ŸŽ‰

Rust on Windows

  1. Download rustup-init.exe Go to rustup.rs and download the 64-bit installer.
  2. Run it and follow the prompts Rust on Windows needs the Microsoft C++ Build Tools (the linker lives there). The installer detects if they're missing and offers to install them for you. Say yes and grab a coffee; it's the longest step.
  3. Choose the default installation When the console window asks, press 1 then Enter for "Proceed with standard installation".
  4. Open a fresh terminal and verify Open PowerShell (or Windows Terminal) from the Start menu and type:
    rustc --version
    cargo --version
    Two version numbers = mission accomplished. ๐ŸŽ‰
๐Ÿง Prefer WSL? If you use the Windows Subsystem for Linux, open your WSL terminal and follow the Linux tab instead; many Rustaceans on Windows work this way.

Rust on Linux

  1. Install a C compiler and linker Rust uses your system's linker. One line, depending on your distro:
    # Debian / Ubuntu / Mint
    sudo apt update && sudo apt install build-essential
    
    # Fedora
    sudo dnf group install c-development
    
    # Arch
    sudo pacman -S base-devel
  2. Install Rust with rustup
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    Press Enter for the default install. Everything lands in ~/.cargo and ~/.rustup: no root needed.
    ๐Ÿ“ฆ Why not apt install rust? Distro packages are often months out of date and don't ship rustup's easy updates. The official installer is the recommended path.
  3. Load Rust into your current shell
    source "$HOME/.cargo/env"
    (New terminals do this automatically from now on.)
  4. Verify
    rustc --version
    cargo --version
    Two version numbers = welcome aboard. ๐ŸŽ‰

Zero-install: Rust in your browser

Not ready to install anything? The official Rust Playground runs real Rust on real servers, free, no account needed.

  1. Open the Playground Visit play.rust-lang.org. You'll see a code editor pre-loaded with a tiny program.
  2. Press Run The output appears below the editor. That's it. You're compiling and running Rust on a server somewhere, right now.
  3. Use it with our lessons Every code example on this site has a copy button. Copy, paste into the Playground, press Run, then break it on purpose and see what the compiler says. Breaking things safely is 80% of learning.
โœ… Great for lessons 1-14 The Playground is perfect for almost the whole curriculum. You'll only need a real install for multi-file projects and to run this website's own Rust server; by then you'll be ready.

Pick your editor ๐Ÿ“

๐ŸŸฆ

VS Code recommended

Free, works everywhere. Install the rust-analyzer extension and you get autocomplete, inline errors, and hover documentation: a tutor inside your editor.

โšก

Zed

A blazing-fast editor written in Rust, with Rust support built in. Poetic, really.

๐Ÿง 

RustRover / Helix

JetBrains' dedicated Rust IDE (free for non-commercial use), or Helix if you like living in the terminal (also written in Rust).


Your first project (2 minutes) ๐Ÿš€

Installed? Let's make sure everything works end to end.

# 1. Create a brand-new project called hello_rusty
cargo new hello_rusty

# 2. Step inside it
cd hello_rusty

# 3. Compile and run it
cargo run

You should see:

   Compiling hello_rusty v0.1.0
    Finished `dev` profile [unoptimized + debuginfo]
     Running `target/debug/hello_rusty`
Hello, world!

That's a real, compiled, native program, and you just built it. Head to Lesson 1 to find out what those files actually do.


Troubleshooting ๐Ÿ”ง

SymptomLikely fix
command not found: cargo Open a new terminal window (the installer edits your shell config, which only loads on startup). On Linux/macOS you can also run source "$HOME/.cargo/env".
linker `cc` not found The C build tools are missing. macOS: xcode-select --install. Linux: install build-essential (or your distro's equivalent). Windows: re-run rustup and accept the Visual Studio Build Tools.
Corporate proxy / offline rustup respects https_proxy environment variables; ask your IT team. Or use the browser Playground while you sort it out.
Old Rust version One command updates everything: rustup update.
Want it gone? rustup self uninstall removes Rust completely. (We'll miss you.)
๐ŸŽ“ Lab ready? Time for class: start the curriculum โ†’