🌐 Detecting your location…
📢 Advertisement — Configure AdSense in Appearance → Customize → AdSense Settings

WSL2 Complete Setup Guide 2026: Linux on Windows the Right Way

⏱️2 min read  ·  392 words
WSL2 Complete Setup Guide 2026: Linux on Windows the Right Way

WSL2 (Windows Subsystem for Linux 2) runs a full Linux kernel inside Windows 11 with near-native performance. In 2026, WSL2 is the standard dev environment for Windows developers using Python, Node, Docker, and cloud tools.

Install WSL2

Open PowerShell as Administrator and run one command. Windows installs WSL2 + Ubuntu automatically.

# Install WSL2 with Ubuntu (default)
wsl --install

# Choose specific distro
wsl --install -d Ubuntu-24.04

# List available
wsl --list --online

Restart after install. Open Ubuntu from Start, set username and password.

Update and Install Essentials

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential curl git wget unzip

# Python 3.12
sudo apt install -y python3.12 python3.12-venv python3-pip

# Node.js 22 via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22 && nvm use 22

Configure Git

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global core.autocrlf input
git config --global init.defaultBranch main

# SSH key for GitHub
ssh-keygen -t ed25519 -C "you@example.com"
cat ~/.ssh/id_ed25519.pub  # add to GitHub Settings > SSH Keys

Docker in WSL2

Install Docker Desktop on Windows, enable WSL2 integration. Or install Docker Engine directly in WSL2.

# After Docker Desktop WSL2 integration enabled:
docker --version
docker run hello-world

# Or install Docker Engine directly
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

Access Windows Files

# C: drive at /mnt/c
ls /mnt/c/Users/YourName/Desktop

# Navigate to Windows project
cd /mnt/c/Users/YourName/Projects/myapp

# Open VS Code from WSL2
code .

# Open Windows Explorer from WSL2
explorer.exe .

Optimize WSL2 Performance

Create %USERPROFILE%\.wslconfig in Windows to cap RAM and CPU usage.

[wsl2]
memory=8GB
processors=4
swap=2GB
localhostForwarding=true

# Apply new config
wsl --shutdown
# Reopen Ubuntu

WSL2 and VS Code

Install the WSL extension in VS Code. Run code . from any WSL2 folder. VS Code runs its server inside Linux — full IntelliSense and debugging in Linux.

Conclusion

WSL2 eliminates dual-boot. With Docker, VS Code, and Git running natively in Linux on Windows, you get the best of both worlds. Set it up once and you will never look back.

✍️ Leave a Comment

Your email address will not be published. Required fields are marked *

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা