On this page
Installing Rust
Windows
- Visit the official Rust website and download the installer.
- Run the installer and follow the on-screen instructions.
- Rustup, the Rust installer, will manage the installation and updates for you.
To verify your installation, open Command Prompt or PowerShell and type:
rustc --version
macOS
-
Open a terminal window.
-
Run the following command to download and run the installer script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Follow the on-screen instructions. Rustup will download the necessary files and set up the environment.
To ensure Rust is installed correctly, open a new terminal window and type:
rustc --version
Linux (using yum for CentOS/RHEL)
Rust is not typically available directly via yum due to the rapid pace of Rust’s development. It’s recommended to install Rust using rustup:
- Install rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Follow the on-screen instructions to complete the installation.
-
Add Rust to your PATH:
source $HOME/.cargo/env
- Verify Rust installation:
rustc --version
Linux (using apt for Debian/Ubuntu)
- Ensure curl is installed:
sudo apt update
sudo apt install curl
- Install rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Follow the on-screen instructions to complete the installation.
-
Add Rust to your PATH:
source $HOME/.cargo/env
- Verify Rust installation:
rustc --version