ByteVerse
HomeBlogCategoriesAboutContact
Search...
Read Blog
ByteVerse

No-fluff guides on AI tools, coding, and productivity. We test everything before we write about it.

Quick Links

  • Home
  • Blog
  • Categories
  • About
  • Contact

Categories

  • AI Tools
  • Tech Guides
  • Productivity
  • Coding
  • Software Reviews

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • Contact

© 2026 ByteVerse. All rights reserved.

contact@byteverse.fyi
HomeBlogTech Guides
Tech Guides

Linux and WSL Setup Guide 2026: Complete Environment for Windows Developers

Set up a complete Linux development environment on Windows using WSL 2 in 2026. Terminal, package managers, Node.js, Python, Docker - everything configured step by step.

A
Ali RehmanAuthor
May 21, 202612 min read
Linux and WSL Setup Guide 2026: Complete Environment for Windows Developers cover image

If you're a developer on Windows, WSL (Windows Subsystem for Linux) is the best thing that happened to your workflow. It gives you a full Linux environment right inside Windows - no dual boot, no virtual machines, no compromises.

This guide walks you through setting up WSL 2 from scratch in 2026, installing essential developer tools, and configuring everything so it works perfectly.

Why WSL 2 in 2026?

Most servers, deployment environments, and DevOps tools run Linux. Docker, Kubernetes, and CI/CD pipelines assume Linux. If you develop on Windows and deploy to Linux, you've probably hit compatibility issues.

WSL 2 solves this by running a real Linux kernel inside Windows:

  • Full Linux compatibility - run bash scripts, Linux binaries, and server software natively
  • Fast file system - WSL 2 uses a real ext4 file system, much faster than WSL 1
  • Docker integration - Docker Desktop uses WSL 2 as its backend
  • VS Code integration - edit files in WSL directly from VS Code
  • No performance hit - near-native Linux performance for development tasks
  • Runs alongside Windows - no rebooting, no virtual machine overhead

Installing WSL 2

Prerequisites

  • Windows 10 version 2004+ or Windows 11
  • Virtualization enabled in BIOS (usually on by default)

One-Command Install

Open PowerShell as Administrator:

Code
wsl --install

This installs WSL 2 with Ubuntu by default. Restart your computer when prompted.

Choose a Different Distro

Want something other than Ubuntu?

Code
# List available distros
wsl --list --online

# Install a specific one
wsl --install -d Debian
wsl --install -d Ubuntu-24.04

Verify Installation

After restart, Ubuntu will open automatically and ask you to create a username and password. Then verify:

Code
wsl --version
lsb_release -a

Setting Up the Terminal

Windows Terminal (Recommended)

Windows Terminal is pre-installed on Windows 11. For Windows 10, install it from the Microsoft Store.

Configure it as your default terminal. It supports tabs, split panes, custom themes, and GPU-accelerated rendering.

Essential Terminal Settings

Open Windows Terminal settings (Ctrl+,) and set:

  • Default profile: Ubuntu (or your WSL distro)
  • Starting directory: //wsl$/Ubuntu/home/yourusername
  • Font: JetBrains Mono or Cascadia Code (ligature support)
  • Color scheme: One Half Dark or Dracula

Oh My Bash (Optional)

For a better-looking prompt:

Code
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"

Essential Developer Tools

Update System First

Code
sudo apt update && sudo apt upgrade -y

Install Build Essentials

Code
sudo apt install build-essential curl wget git unzip -y

Git Configuration

If you've followed our Git and GitHub beginners guide, you know the basics. Set up Git in WSL:

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

The core.autocrlf input setting is critical - it prevents Windows line-ending issues when working across WSL and Windows.

SSH Key for GitHub

Code
ssh-keygen -t ed25519 -C "your@email.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub

Copy the output and add it to your GitHub account → Settings → SSH Keys.

Installing Node.js

Using NVM (Recommended)

Never install Node.js with apt - use NVM for version management:

Code
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
source ~/.bashrc

# Install latest LTS
nvm install --lts
nvm use --lts

# Verify
node --version
npm --version

Enable Corepack for pnpm/yarn

Code
corepack enable
corepack prepare pnpm@latest --activate

Installing Python

Code
sudo apt install python3 python3-pip python3-venv -y

# Verify
python3 --version
pip3 --version

# Create alias for convenience
echo "alias python=python3" >> ~/.bashrc
echo "alias pip=pip3" >> ~/.bashrc
source ~/.bashrc

Docker in WSL 2

Docker and WSL 2 work together perfectly. If you're following our Docker beginners guide, here's how to set it up on WSL:

Option 1: Docker Desktop (Easiest)

  1. Install Docker Desktop for Windows
  2. Go to Settings → General → enable "Use WSL 2 based engine"
  3. Go to Settings → Resources → WSL Integration → enable your distro

Now docker commands work directly from your WSL terminal.

Option 2: Docker Engine in WSL (No Desktop)

Code
# Add Docker's official GPG key
sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Add the repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" | sudo tee /etc/apt/sources.list.d/docker.list

# Install
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y

# Add your user to docker group
sudo usermod -aG docker $USER

VS Code + WSL Integration

This is where things get magical. Install the right VS Code extensions and then:

  1. Install the WSL extension in VS Code
  2. Open any project from WSL: code . in your WSL terminal
  3. VS Code opens with a remote connection to WSL

All extensions, terminal, and file operations now run inside Linux. You get the best of both worlds - Windows UI with Linux backend.

Recommended Workflow

Code
# Store all projects inside WSL (not /mnt/c/)
mkdir -p ~/projects
cd ~/projects
git clone your-repo
code .

Important: Keep your code inside the WSL file system (~/projects), not on the Windows drive (/mnt/c/). File operations are 5-10x faster on the native Linux file system.

Database Setup

PostgreSQL

Code
sudo apt install postgresql postgresql-contrib -y
sudo service postgresql start

# Create a user
sudo -u postgres createuser --interactive
# Answer the prompts

# Create a database
sudo -u postgres createdb mydb

MongoDB

Code
# Import MongoDB public key
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg

# Add repo and install
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt update
sudo apt install mongodb-org -y
sudo systemctl start mongod

Performance Optimization

WSL Memory Limit

WSL 2 can consume a lot of RAM. Create .wslconfig in your Windows home folder (C:\Users\YourName\.wslconfig):

Code
[wsl2]
memory=4GB
processors=4
swap=2GB

Then restart WSL:

Code
wsl --shutdown

File System Performance

  • Always work inside ~/projects (Linux file system)
  • Avoid accessing /mnt/c/ for active development
  • Use git to sync files between systems if needed

Common Issues and Fixes

DNS Resolution Fails

Code
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf

Clock Drift

Code
sudo hwclock -s

Service Won't Start

WSL doesn't use systemd by default. Enable it:

Code
echo -e "[boot]\nsystemd=true" | sudo tee /etc/wsl.conf

Then restart WSL from PowerShell: wsl --shutdown

FAQ

Is WSL 2 as fast as native Linux?

For most development tasks, yes. File I/O on the Linux file system is near-native speed. The main performance difference is in GPU-heavy tasks.

Can I run GUI apps in WSL?

Yes. WSL 2 on Windows 11 supports Linux GUI apps natively through WSLg - you can run browsers, file managers, and even IDEs.

Should I use WSL or just install Linux?

If you need Windows for daily use (Office, Adobe, gaming), WSL gives you the best of both worlds. If you're fully committed to Linux, a native install is slightly faster.

Final Thoughts

WSL 2 turns Windows into a legitimate development machine. You get a real Linux environment without any dual-boot hassle, and the VS Code integration makes it feel completely native.

Set it up once, configure your tools, and you'll have a development environment that matches what most companies use in production. No more "works on my machine" problems.

Share this article

Written by

Ali Rehman

Author at ByteVerse

A Full Stack Developer and Tech Writer specializing in React.js, Next.js, and modern JavaScript, sharing insights on web development, frontend technologies, backend APIs, and scalable applications.

View all posts

You Might Also Like

All Posts
Docker for Beginners 2026: Complete Getting Started Guide

Docker for Beginners 2026: Complete Getting Started Guide

May 21, 202613 min read
How to Learn Programming in 2026: Complete Beginner Roadmap

How to Learn Programming in 2026: Complete Beginner Roadmap

May 21, 20268 min read
Online Security Checklist 2026: Passkeys and 2FA

Online Security Checklist 2026: Passkeys and 2FA

May 20, 202610 min read