Easily install Debian Linux on Windows using WSL2

A Guide To Install Debian On Windows Using WSL2

Debian runs on Windows through Windows Subsystem for Linux (WSL), so you can use its shell and package tools without replacing Windows or creating a virtual machine. Microsoft documents wsl –install -d Debian as the direct installation command on supported Windows 10 and Windows 11 systems.

Install WSL and Debian

Open PowerShell as Administrator, then install WSL with Debian as the selected distribution. The command installs the WSL components and Debian when your Windows version supports the simplified installation path.

Windows Features dialog with Windows Subsystem for Linux enabled
The Windows Features dialog is useful when you need the manual WSL components.
wsl --install -d Debian

Restart Windows if the installer asks for it. On systems where wsl –install is unavailable, Microsoft’s manual WSL installation steps cover the required Windows components and kernel update.

Check the Windows requirements before using the command

Microsoft supports the one-command installation on Windows 10 version 2004 or later and Windows 11, with virtualization available to Windows, so update Windows or use Microsoft’s manual route when an older installation rejects the command.

WSL is the Windows feature that starts Linux distributions, while WSL 2 uses a managed Linux kernel and is the version to choose for current Debian development work unless a project specifically requires WSL 1 behavior.

Run wsl –status in PowerShell before troubleshooting an install because it reports the default distribution, the default WSL version, and the kernel details that tell you whether Windows has finished its WSL setup.

Enable virtualization in your computer’s firmware when Windows reports that the Virtual Machine Platform cannot start, then return to the WSL install command after Windows recognizes the setting.

Use wsl –update when Microsoft documents a WSL update for your installation, since the WSL package and kernel are maintained by Windows instead of Debian’s apt repositories.

Windows Start menu showing the option to run PowerShell as administrator
Run PowerShell as Administrator so WSL can enable the Windows features it needs.

Check the available WSL distributions

List the distributions that your WSL installation can download before choosing a name, because the online list shows the spelling that WSL accepts for Debian.

wsl --list --online
PowerShell output listing distributions available for WSL installation
Use the distribution name shown in the online list with the installation command.

If WSL is already installed, the same Debian command adds the distribution without reinstalling Windows features. Microsoft’s WSL command reference also shows how to inspect installed distributions and their WSL version.

Finish Debian’s first launch

Launch Debian from the Start menu or run wsl -d Debian from PowerShell, then create the Linux username and password that become the distribution’s default account.

PowerShell showing Debian being installed through WSL
WSL downloads and registers Debian before its first terminal launch.

Choose a username you will recognize in Linux commands because that Linux account is separate from your Windows account.

Debian terminal prompting for a new UNIX username during first launch
The first Debian launch creates the Linux account that runs your shell sessions.

Update Debian after installation

Update Debian’s package lists and install available upgrades with apt, because the packages in your WSL image are maintained through apt rather than a desktop ISO download.

sudo apt update
sudo apt full-upgrade
Debian terminal updating packages with apt
Run the update after creating your account so the Debian package index is current.

Package management on Linux explains what apt changes before you move on to a Linux command-line task.

Use this Linux command-line primer when you need navigation and file commands inside Debian.

Compare Linux shell options before changing the shell you use in the terminal.

Open Debian and use its filesystem deliberately

Start Debian from the Start menu when you want a dedicated terminal window, or use wsl -d Debian from PowerShell when you want to enter Debian from an existing Windows terminal session.

Each distribution has its own Linux filesystem, packages, and user account, so installing Debian beside another WSL distribution does not merge their home directories or package databases.

Run wsl –list –verbose from PowerShell to see every installed distribution and its WSL version before removing or changing one, because the command makes the target name explicit.

Use wsl –set-default Debian only when you want plain wsl to open Debian, since that setting changes which distribution PowerShell starts when no distribution name is supplied.

Keep source code that Linux tools compile or test in your Debian home directory when possible, then open that folder through a WSL-aware editor connection instead of treating the Windows mount as the default project location.

Use Windows files from Debian

WSL mounts Windows drives under /mnt, so your C drive is normally available at /mnt/c. Keep active Linux projects in your Linux home directory when you use Linux build tools, and use the mounted Windows filesystem for files that Windows applications must own.

If you need the opposite workflow, learn how to mount a Windows NTFS drive from Linux. WSL is not a replacement for a full virtualized Linux system when you need kernel modules or an isolated operating system, but it is a direct fit for command-line development and Linux package tooling on Windows.

Verify the Debian installation

Run these commands after the first update to confirm that WSL sees Debian and that the Debian shell is active.

  1. In PowerShell, run wsl –list –verbose and confirm Debian appears in the installed list.
  2. Open Debian and run cat /etc/os-release to inspect the distribution release.
  3. Run pwd and confirm that you start in your Linux home directory.

Start with a small shell task after that, such as navigating files or installing one development package. When you need containers rather than a single Debian environment, compare Docker and Podman on Linux before choosing the runtime.

References

Microsoft documents the WSL installation command and its distribution management commands. Debian’s release page identifies Debian 13 trixie as the stable release.