Install Rust on macOS
Homebrew note
Homebrew is the most convenient package manager on macOS for developer tools like Rust.
If Homebrew is already set up, the Rust install is a single command. If it is missing, set up Homebrew first and then return to this lesson.
Homebrew keeps the install isolated and makes future upgrades predictable for beginners.
Install with Homebrew
Install the rustup-init formula, then use it to provision the stable toolchain.
The formula provides the installer while rustup itself manages future compiler updates.
brew install rustup-init
rustup-init installed successfully
After the formula finishes, run the rustup-init program as plain text and accept the defaults.
rustc --version and cargo --version
Open a new terminal window and check both tools so you know the full toolchain works.
rustc --version
rustc 1.75.0 (ad2397f6f 2023-12-28) (aarch64-apple-darwin)
cargo --version
cargo 1.75.0 (4d4553a9 2023-11-14)
Intel and Apple Silicon machines report different host triples but the version numbers should match.
PATH notes
The installer adds the cargo binary directory to your shell startup files so every new terminal finds the tools.
If the version commands are not found, restart the terminal or open a new tab so the updated PATH loads. Shell changes only apply to sessions started after the install.
The code on this page was not run: it needs macOS.
Article author: Arthur Isaev