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
-
Open the Terminal app
Press
โ + Space, type Terminal, press Enter. This plain text window is your new laboratory: you type commands, the Mac obeys. -
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):
If it says "already installed", even better: skip ahead.xcode-select --install -
Install Rust with rustup
rustupis Rust's official installer and version manager. Paste:
Press Enter to accept the default installation. It installs everything into your home folder: no admin password, easy to remove later.curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh๐บ Homebrew user?brew install rustupfollowed byrustup-initworks too. Either route ends in the same place. -
Restart your terminal, then verify
Close the Terminal window, open a new one, and type:
Two version numbers = you're in. ๐rustc --version cargo --version
Rust on Windows
- Download rustup-init.exe Go to rustup.rs and download the 64-bit installer.
- 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.
-
Choose the default installation
When the console window asks, press
1then Enter for "Proceed with standard installation". -
Open a fresh terminal and verify
Open PowerShell (or Windows Terminal) from the Start menu and type:
Two version numbers = mission accomplished. ๐rustc --version cargo --version
Rust on Linux
-
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 -
Install Rust with rustup
Press Enter for the default install. Everything lands incurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh~/.cargoand~/.rustup: no root needed.๐ฆ Why notapt install rust? Distro packages are often months out of date and don't shiprustup's easy updates. The official installer is the recommended path. -
Load Rust into your current shell
(New terminals do this automatically from now on.)source "$HOME/.cargo/env" -
Verify
Two version numbers = welcome aboard. ๐rustc --version cargo --version
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.
- Open the Playground Visit play.rust-lang.org. You'll see a code editor pre-loaded with a tiny program.
- Press Run The output appears below the editor. That's it. You're compiling and running Rust on a server somewhere, right now.
- 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.
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 ๐ง
| Symptom | Likely 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.) |