Install Rust on Windows 11
- 1
Download rustup-init.exe
Get it from the download page. On Windows 11 you may see a SmartScreen warning — click More info → Run anyway. The installer is signed by Mozilla.
- 2
Allow in PowerShell (if blocked)
# If PowerShell blocks execution of rustup scripts:PS> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser# This allows local scripts to run for your user - 3
Run installer and verify
PS> .\rustup-init.exe# Accept defaults (option 1)# Open a NEW PowerShell window, then:PS> rustc --versionrustc 1.79.0 (129f3b996 2024-06-10)
Windows 11 issues and fixes
Add cargo target dir to Windows Defender exclusions
Windows Defender scanning build artifacts slows Rust compilation significantly. Add an exclusion:
target directory from Defender scans can reduce incremental build times by 30–60% on Windows 11.Windows 11 questions
Does Rust work on Windows 11 ARM (Surface Pro X)?
Yes. Add the ARM64 target with rustup target add aarch64-pc-windows-msvc. You can also install rustup natively on Windows 11 ARM — use the aarch64-pc-windows-msvc host toolchain. Most crates compile without changes on ARM64 Windows.
Rust compile times are very slow on Windows 11
The main cause is Windows Defender scanning build artifacts. Add your target folder and ~/.cargo to Defender exclusions (see above). Also ensure your project is on an NTFS drive, not a network share or OneDrive-synced folder, which adds significant I/O overhead.