Introduction / Why This Is Needed
Setting up a development workspace on Windows is a task almost every programmer has to tackle. A properly configured environment saves hours of time in the future, eliminating headaches with dependencies, paths, and configurations. After completing this guide, you will have a full-fledged, modern environment comparable to macOS or Linux, for working on projects in Python, JavaScript/Node.js, .NET, Go, Rust, and many other languages. You will be able to run Docker containers, use Linux tools via WSL2, and commit code to Git.
Requirements / Preparation
Before you begin, ensure that:
- You have Windows 10 (version 2004, build 19041 or higher) or Windows 11.
- You have administrator privileges on the computer (required for installing components and software).
- You have at least 10 GB of free space on the system drive (20+ GB recommended).
- You have an internet connection to download installers and components.
- Virtualization is enabled in BIOS/UEFI (Intel VT-x / AMD-V). It is usually enabled in the motherboard's security/processor settings.
Step-by-Step Guide
Step 1: Enabling Virtualization and Windows Components
WSL2 and Hyper-V require processor-level virtualization support and the enabling of corresponding OS components.
- Check if virtualization is enabled: Open Task Manager → Performance tab → CPU. In the bottom right, look for the line "Virtualization: Enabled". If it says "Disabled", restart your computer, enter BIOS/UEFI, and find the option Intel Virtualization Technology (VT-x) or SVM Mode (AMD-V) and enable it.
- Enable Windows components via PowerShell (Administrator):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
These commands activate the Linux Subsystem and the virtualization platform. - Restart your computer. This is a mandatory step to apply the changes.
Step 2: Installing WSL2 and a Linux Distribution
- Set WSL2 as the default version:
In PowerShell (Administrator), run:
wsl --set-default-version 2 - Install a Linux distribution (Ubuntu):
- Open the Microsoft Store.
- Search for "Ubuntu" (an LTS version like Ubuntu 22.04 LTS is recommended).
- Click "Install".
- After installation, click "Launch".
- On first launch, you will need to create a user account (not root) and set a password. Remember the password.
- Update Ubuntu packages:
Open Ubuntu (via the Start menu or search) and run:
sudo apt update && sudo apt upgrade -y
Step 3: Installing Git for Windows
Git is a version control system essential for any developer.
- Download the installer from the official website.
- Run the installer. On the "Select Components" screen, it is recommended to keep the following options checked:
- Git Bash Here (console with Git commands).
- Git GUI Here (graphical client).
- Git LFS (Large File Support).
- *Associate .git configuration files...**.
- On the "Choosing the default editor used by Git" screen, select your primary editor (VS Code, Notepad++, or leave it as Vim).
- On the "Adjusting your PATH environment" screen, select "Git from the command line and also from 3rd-party software" (recommended). This allows you to call
gitfrom any console (PowerShell, CMD, WSL). - Complete the installation.
Verification: Open PowerShell or Git Bash and run git --version. The version should be displayed (e.g., git version 2.45.0.windows.1).
Step 4: Installing Docker Desktop
Docker Desktop provides a convenient GUI for working with containers and integrates with WSL2.
- Download the Docker Desktop installer for Windows from the official website.
- Run the installer. Follow the instructions, leaving the default settings.
- Critical step: During installation, the system will prompt you to enable WSL2 integration. Be sure to check the box for your installed Ubuntu (e.g.,
Ubuntu-22.04). This allows Docker to run on top of WSL2. - After installation, restart your computer.
- Launch Docker Desktop from the Start menu. On first launch, it will finish setup and request WSL privileges. Agree.
- Wait until the Docker icon in the system tray (next to the clock) turns white (operational).
Verification: Open PowerShell or WSL (Ubuntu) and run docker --version and docker run hello-world. If the hello-world command completes successfully, Docker is working.
Step 5: Installing Programming Languages and Package Managers
Install the runtimes you need. It is recommended to install both for Windows (for native .exe) and in WSL (Ubuntu) for compatibility.
Python
- For Windows: Download the installer from python.org. On the first installation screen, be sure to check the box "Add python.exe to PATH".
- For WSL (Ubuntu): In the Ubuntu terminal, run
sudo apt install python3 python3-pip python3-venv -y. - Verification:
python --version(Windows) orpython3 --version(WSL).
Node.js (npm)
- For Windows: Download the LTS version installer from nodejs.org. The installer will automatically add
nodeandnpmto PATH. - For WSL (Ubuntu): It is better to use nvm for version management:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc nvm install --lts - Verification:
node --version,npm --version.
Go, Rust, Java, etc.
Install from official websites, following the instructions for Windows. For tools actively used in the terminal (Go, Rust), also install them in WSL for better performance.
Step 6: Installing and Configuring the IDE
Visual Studio Code (recommended for most)
- Download the installer from code.visualstudio.com.
- Install it, checking all offered options (adding to PATH, file associations).
- After launching, install key extensions:
- Python (Microsoft)
- Docker (Microsoft)
- ESLint (for JavaScript/TypeScript)
- Remote - WSL (Microsoft) — mandatory! Allows you to open folders from WSL directly in VS Code with correct paths and interpreters.
- GitLens (for working with Git)
- Configure
settings.json(Ctrl+Shift+P → "Preferences: Open Settings (JSON)") for convenience:{ "terminal.integrated.defaultProfile.windows": "Git Bash", "editor.tabSize": 4, "files.autoSave": "afterDelay" }
Visual Studio Community 2022 (for .NET/C++)
- Download from visualstudio.microsoft.com.
- Run the Visual Studio Installer.
- Select a Workload:
- .NET desktop development (for C#, F#, VB.NET).
- Desktop development with C++ (if needed).
- Python development (if you work with Python in VS).
- Node.js development (if you work with Node.js in VS).
- On the "Individual components" tab, you can add Git for Windows if it is not already installed.
- Begin the installation (takes 30-60 minutes and a lot of space).
Verification
- WSL: Open Ubuntu from the Start menu. Run
lsb_release -a. Information about Ubuntu should be displayed. - Git: In PowerShell, run
git --version. - Docker: In PowerShell, run
docker ps(should show an empty list of containers without errors). - Languages: Check the versions of installed Python, Node.js, and others.
- IDE: Launch VS Code and ensure the extensions are active. Try opening a folder from WSL: in VS Code (F1) →
WSL: New Window. In the opened WSL window, open the folder/home/<your_user>/projects.
Potential Issues
Error: "WSL 2 requires an update to its kernel"
Cause: Outdated version of the Linux kernel for WSL2. Solution: Download and install the latest WSL2 Linux kernel update package from the official Microsoft page.
Error: "Docker Desktop requires a newer WSL kernel version"
Cause: Same as above. Docker Desktop checks the kernel version. Solution: Install the kernel update as described above, then restart Docker Desktop.
Error: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock"
Cause: The Docker daemon is not running in WSL2 or the user lacks permissions. Solution:
- Ensure Docker Desktop is running (icon in the tray).
- In WSL (Ubuntu), run
sudo service docker start. - To avoid constant
sudo, add the current user to thedockergroup:sudo usermod -aG docker $USER. Log out of the terminal and log back in.
Error: "The command 'git' could not be found"
Cause: Git is not installed or its path is not added to the PATH environment variable. Solution: Reinstall Git for Windows, and on the "Adjusting your PATH" screen, select "Git from the command line and also from 3rd-party software". Restart the terminal (PowerShell/WSL).
Slow WSL2 Filesystem Performance
Cause: Accessing files located on the Windows partition (/mnt/c/...) from WSL2 is slow due to the bridge between systems.
Solution: Store your projects inside the WSL2 filesystem, i.e., in Ubuntu's home directory (~/projects), not on the Windows drive. To access them from Windows, use \\wsl$\Ubuntu\home\<user>\projects in File Explorer. For work in VS Code, use the Remote - WSL extension.