Set up a new machine
From a fresh Windows 11 install to a project running in WSL, in six steps. About 45 minutes, most of it downloads.
Do these in order: each step only uses what the steps before it installed. Tick them off as you go; ticks are saved in this browser only.
You need Windows 11 (or Windows 10 22H2), an administrator account, and virtualisation enabled in the BIOS/UEFI (it usually is).
Install and update WSL#
Open PowerShell as administrator (Start → type PowerShell → Run as administrator):
PowerShell · AdminInstall WSL with Ubuntu wsl --install -d UbuntuReboot when asked. Ubuntu opens by itself afterwards and asks for a Linux username and password; they are separate from your Windows login and only used for
sudo. Then, in a normal PowerShell:PowerShellUpdate WSL and check the version wsl --update wsl -l -v # Ubuntu, VERSION 2Update Ubuntu packages#
Open Ubuntu from the Start menu (or Windows Terminal → Ubuntu). Everything from here runs inside it.
WSLUpgrade packages and add build tools sudo apt update && sudo apt full-upgrade -y sudo apt install -y build-essential git curl unzipCreate a project directory on the Linux filesystem#
Keep code in your Linux home, never under
/mnt/c. Tools on the Linux disk run at native speed and file watchers work; on/mnt/cinstalls and builds are 5–20× slower and hot reload misses changes. Why, in detail.WSLYour code lives here mkdir -p ~/dev cd ~/devFrom Windows, the folder is at
\\wsl.localhost\Ubuntu\home\<you>\devin Explorer.Connect the Windows editor to WSL#
Install VS Code (or Cursor) on Windows, then add the WSL extension (
ms-vscode-remote.remote-wsl). Back in Ubuntu:WSLOpen the folder in VS Code, running against Linux cd ~/dev code .The first run installs a small server inside Linux. The bottom-left corner should say WSL: Ubuntu. JetBrains, Cursor and Windows Terminal: Open a WSL project in your editor.
Install your project's runtime and configure Git#
Use a version manager, not
apt install nodejs. mise handles Node, Python and most other runtimes, and switches versions per project:WSLInstall mise (bash, Ubuntu's default shell) curl https://mise.run | sh echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc exec bash mise use -g node@lts # or python@3.13, go, java… whatever your project needsThen tell Git who you are, and keep line endings as LF:
WSLGit identity and defaults git config --global user.name "Your Name" git config --global user.email "you@example.com" git config --global init.defaultBranch main git config --global core.autocrlf inputPrivate repositories need authentication: Connect Git to GitHub with SSH. More runtimes and pinning versions per project: Install runtimes with mise.
Run a project and verify the setup#
Clone your project into
~/devand start it, or create a throwaway one:WSLA test project cd ~/dev npm create vite@latest hello -- --template vanilla cd hello && npm install && npm run devOpen the printed address (
http://localhost:5173) in your Windows browser. Then check:which nodeprints a path under~/.local/share/mise, not/mnt/c/….code .from the project opens with WSL: Ubuntu in the status bar.- Editing
main.jsreloads the page in the browser within a second.
All three true: your baseline works. Something off? Fix a problem is ordered by symptom.
Optional next steps#
None of these are required. Pick what your work needs:
- DockerContainers and shared Postgres/Redis for all projects.
- Android and React NativeEmulator on Windows, toolchain in WSL.
- Shell customisationzsh, a fast prompt and modern CLI tools.
- BackupsSnapshot the distro before you need it.
- Performance tuningWatcher limits, memory caps, Defender exclusions.
- Phone and LAN accessMirrored networking, firewall rules, HTTPS on a phone.