Recommended Installation
The recommended way to install Rust is through rustup, the official Rust installer and version management tool.Read the full installation guide in The Rust Book for detailed instructions.
Quick Install
- Unix/Linux/macOS
- Windows
Open your terminal and run:This will download and run the rustup installer. Follow the on-screen instructions.
Verifying Installation
After installation, verify Rust is installed correctly:Updating Rust
Keep Rust up to date with rustup:Uninstalling Rust
If you ever need to uninstall Rust:Installing from Source
The Rust build system uses a Python script calledx.py to build the compiler, which manages the bootstrapping process.
Prerequisites
Before building from source, ensure you have the required dependencies installed.- Unix/Linux/macOS
- Windows
Required dependencies:
- Python 3 or 2.7
- Git
- A C compiler (e.g.,
gccorclang) curl(not needed on Windows)pkg-config(Linux only)- OpenSSL development headers (
libssl-devoropenssl-devel)
g++,clang++, or MSVCninjaor GNUmake3.81 or latercmake3.13.4 or later
Build Steps (Unix/Linux/macOS)
Configure the build
Run the interactive setup:This will guide you through selecting a configuration profile and setting up your development environment.Alternatively, use the configure script for advanced configurations:
Build Steps (Windows - MSVC)
Install prerequisites
- Install Visual Studio 2022 with “C++ build tools” workload
- Install Python, CMake, and Git (see Prerequisites tab above)
Build Steps (Windows - MinGW)
Install MSYS2
Download and install MSYS2
Install Git for Windows
Download Git for Windows and ensure it’s in your PATH.
Install build tools
Open a MINGW64 shell and run:
For 32-bit, replace
x86_64 with i686 in the package names.Platform Support
Rust supports a wide variety of platforms. Since the compiler is written in Rust, it must be built by a precompiled “snapshot” version of itself.Source builds require an internet connection to fetch snapshots, and an OS that can execute the available snapshot binaries.
- Tier 1 platforms (guaranteed to work)
- Tier 2 platforms (guaranteed to build)
- Tier 3 platforms (experimental support)
Building Documentation
If you’re building from source and want to build the documentation:build/<triple>/doc directory, where <triple> is your build target (e.g., x86_64-pc-windows-msvc).