Windows 11

Install Rust on Windows 11 — setup guide & common fixes

Rust 1.79 is fully compatible with Windows 11. Install via rustup-init.exe — the process is identical to Windows 10. Windows 11 specific issues are usually related to Windows Defender SmartScreen or execution policy in PowerShell.

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)

    PowerShell — Administrator
    # 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

    PowerShell
    PS> .\rustup-init.exe
    # Accept defaults (option 1)
    # Open a NEW PowerShell window, then:
    PS> rustc --version
    rustc 1.79.0 (129f3b996 2024-06-10)

Windows 11 issues and fixes

SmartScreen blocks rustup-init.exe
Windows 11 SmartScreen is more aggressive than Windows 10
Click More info > Run anyway. The installer is signed.
cargo.exe blocked by Windows Security
Windows Security flags new executables
Settings > Privacy & security > Windows Security > allow the specific file
PowerShell execution policy blocks rustup scripts
Default Windows 11 policy restricts unsigned scripts
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Windows Defender scans slow down compilation
Real-time protection scans .rs and intermediate files
Add your cargo target folder to Defender exclusions

Add cargo target dir to Windows Defender exclusions

Windows Defender scanning build artifacts slows Rust compilation significantly. Add an exclusion:

PowerShell — Administrator
# Add cargo target directory to exclusions:
PS> Add-MpPreference -ExclusionPath "$env:USERPROFILE\.cargo"
PS> Add-MpPreference -ExclusionPath "C:\path\to\your\project\target"
Excluding the 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.