How to Install Bash on Windows 11

To install Bash on Windows 11, open PowerShell with Run as administrator, type wsl –install, press Enter, and restart your PC when it finishes. That one command turns on Windows Subsystem for Linux (WSL) and installs Ubuntu, and Bash is Ubuntu’s default shell. Open Ubuntu from the Start menu, create a Linux user name and password, and you’re at a Bash prompt.

Applies to: Windows 11, all editions including Home (current release: version 26H2). The same command works on Windows 10 version 2004 (build 19041) and later. The steps follow Microsoft’s Install WSL page.

What “Bash on Windows 11” means

Bash is a text-based shell and command language. You type commands into it to run programs, tools and scripts, and it’s the default shell in Ubuntu and many other Linux distributions. Windows 11 doesn’t ship with Bash on its own. What it does include is WSL, a Windows feature that runs a real Linux environment next to your normal desktop apps, without dual-booting. Install a Linux distribution through WSL and Bash comes with it.

Two points clear up most beginner confusion:

  • Bash is not Command Prompt or PowerShell. It runs Linux commands, uses Linux paths such as /home/alex, and treats file names as case-sensitive. In Bash, Notes.txt and notes.txt are two different files; in Windows they’re the same file.
  • There are two kinds of “Bash on Windows.” WSL gives you full Linux with Bash. Git for Windows includes Git Bash, a smaller Bash emulation meant mainly for running Git. If you only need Git, skip to the Git Bash method.

Which method should you use?

WSL with Ubuntu (main method)Git Bash
What you getA real Linux distribution with Bash, its package manager and Linux toolsA Bash-style prompt for Git and common shell commands, running as a Windows program
Good forFollowing Linux tutorials, writing and testing shell scripts, development tools, learning LinuxUsing Git from the command line
NeedsAdministrator rights, virtualization support, a restartA normal app install
Install withwsl –installThe Git for Windows installer

If you aren’t sure, choose WSL. Most Bash instructions you’ll find online assume a Linux system, and WSL gives you one.

Before you start

  • An administrator account. The install command has to run in a PowerShell window opened with Run as administrator.
  • A supported Windows version. Any Windows 11 release qualifies. To check yours, press Windows logo key + R, type winver, and select OK.
  • Virtualization support. WSL uses a Windows component named Virtual Machine Platform (a subset of Hyper-V), which needs your processor’s virtualization feature. Many Windows PCs already have it turned on. If yours doesn’t, enable virtualization in Windows 11 first, or wait and see whether you get the error covered in Troubleshooting.
  • An internet connection for the download, and a few minutes for a restart. Save your open work before you begin.
  • Work or school PC? Organizations can turn WSL off with Intune or Group Policy. Check with your IT department before you change Windows features or firmware settings on a managed device.

Install Bash on Windows 11 with WSL

  1. Select Start and type PowerShell. Right-click the PowerShell result and select Run as administrator, then select Yes on the User Account Control prompt. A PowerShell window opens.
  2. Type wsl –install and press Enter. The command turns on the Windows features WSL needs and downloads Ubuntu. Leave the window open until it finishes. If you see a list of WSL options (help text) instead of a download, WSL is already partly installed: jump to Choose a different Linux distribution and install Ubuntu by name.
Administrator PowerShell window on Windows 11 running the wsl --install command with installation progress shown
Recreated wsl --install output at the VirtualMachinePlatform stage. In this example, Windows asks for a restart; installation output varies with the features already enabled on the PC.
  1. Restart your PC. The features WSL depends on don’t start working until Windows restarts.
  2. Select Start, type Ubuntu, and open it. The first launch opens a console window and asks you to wait while files are decompressed and stored on your PC. Later launches should take less than a second. Setup may also continue on its own in a window after the restart; if it does, carry on with the next step there.
  3. When asked, type a Linux user name (for example alex) and press Enter. Then type a password and press Enter, and type it again to confirm. Nothing appears on screen while you type the password. That’s normal, so type carefully.
Ubuntu first-launch window on Windows 11 asking for a new Linux user name and password, with alex entered as the user name
Ubuntu asks for a Linux user name, followed by New password. This recreated first-launch example uses alex; the password line stays empty because characters are not echoed.
  1. You now see a Linux command prompt with your user name in it. That prompt is Bash, ready for commands.
Illustration of the path to install Bash on Windows 11: open PowerShell with Run as administrator, run wsl --install, restart, open Ubuntu, then create a Linux user name and password
Illustration: the path from an administrator PowerShell window to a working Bash prompt in Ubuntu on Windows 11.

The Linux account you just created is separate from your Windows account and has no connection to your Windows user name or password. It becomes the default user, signs in automatically whenever you open Ubuntu, and counts as the Linux administrator, so it can run sudo commands. Each distribution you add gets its own accounts, and distributions are installed per Windows user, so other people who sign in to the same PC won’t see yours.

New installs made with wsl –install use WSL 2, the current version of WSL that runs a real Linux kernel. You don’t need to choose a version yourself.

Check that Bash is installed

Two quick checks confirm everything worked:

  1. In your Ubuntu window, type bash –version and press Enter. Bash prints its version information, including the version number, and returns you to the prompt.
  2. In PowerShell, type wsl –list –verbose (short form: wsl -l -v). You’ll see each installed distribution, whether it’s running or stopped, and whether it uses WSL 1 or WSL 2. If Ubuntu is listed, the install succeeded.
Windows Terminal showing bash --version output in Ubuntu and wsl -l -v in PowerShell listing Ubuntu with WSL version 2
In Ubuntu, bash --version reports Bash. In PowerShell, wsl -l -v lists the distribution and WSL version. These separate recreated excerpts use an Ubuntu 24.04 LTS example with Bash 5.2.21 and WSL 2; your version number may differ.

For more detail, wsl –status shows your default distribution and kernel version, and wsl –version shows the version of WSL and its components.

Choose a different Linux distribution

Ubuntu is the default and a sensible pick for beginners. Using it day to day is covered in installing Ubuntu on Windows 11. Other distributions come with their own default shells, and Bash is available in them too. To pick one yourself:

  1. Open PowerShell with Run as administrator.
  2. Enter wsl –list –online (or wsl -l -o). PowerShell prints the distributions you can download, with a short NAME column on the left.
  3. Enter wsl –install -d followed by a name from that NAME column, for example wsl –install -d Debian.
  4. Open the new distribution from the Start menu and create its user name and password.

You can also open the Microsoft Store, search for a distribution such as Debian or openSUSE, and select Get. WSL lets you keep several distributions side by side. To choose which one opens when you type wsl, enter wsl –set-default followed by its name.

If you want the WSL features without a distribution yet, wsl –install –no-distribution installs only WSL. For a broader look at the Linux options on a PC, including WSL versus dual-booting, see how to install Linux on Windows 11.

Open Bash later

  • Start menu: type the distribution’s name, such as Ubuntu, and open it.
  • Terminal: Microsoft recommends Windows Terminal, which runs PowerShell, Command Prompt and Linux shells in tabs or panes. Each WSL distribution you install gets its own profile in Terminal, so you can open it in a new tab.
  • From PowerShell or Command Prompt: type wsl to open your default distribution inside the same window. Type exit to return to PowerShell.
  • One command at a time: put wsl in front of a Linux command to run it without staying in Linux. For example, wsl ls -la lists the files in the current Windows folder using the Linux ls command.

First things to do in Bash

Update your Linux software first. Windows doesn’t update or upgrade your Linux distributions for you, so this is your job from now on. In Ubuntu or Debian, enter:

sudo apt update && sudo apt upgrade

Type your Linux password when asked (again, nothing appears as you type). Run the same command regularly to stay current. To install a program, use sudo apt install followed by the package name, for example sudo apt install curl.

Then try some basic commands:

CommandWhat it does
pwdShows the folder (directory) you’re in
lsLists the files and folders in the current directory
ls -lAdds details such as file size, permissions and last modified time
mkdir practiceCreates a folder named practice
cd practiceMoves into that folder
touch notes.txtCreates an empty file
cat notes.txtPrints a file’s contents
grep word notes.txtShows the lines in a file that contain a word

Run your first Bash script

A script is just a text file of commands. Inside the practice folder, enter these two lines one at a time:

  1. echo ‘echo “Hello from Bash”‘ > hello.sh creates a file named hello.sh that contains one command.
  2. bash hello.sh tells Bash to read the file and run the commands in it. You should see “Hello from Bash”.

For longer scripts, open the file in a text editor, add one command per line, save it, and run it the same way.

Use Windows files from Bash, and Linux files from Windows

Your Windows drives appear inside Linux under /mnt. To reach the C: drive, enter cd /mnt/c. A Windows folder such as C:\Users\Alex\Documents appears in Bash as /mnt/c/Users/Alex/Documents. Paths in Bash use forward slashes and are case-sensitive.

Going the other way, enter explorer.exe . in Bash (include the period) to open the current Linux folder in File Explorer. You can also type \\wsl$ in the File Explorer address bar to see every installed distribution and its files.

WSL can run Windows programs too: type notepad.exe at the Bash prompt and Notepad opens. Windows program names must include the .exe extension.

Keep files on the same side as the tools that use them. If you work on a project with Linux tools in Bash, store it in your Linux home folder (for example /home/alex/projects). Opening Windows files from Linux works, but it can be much slower.

Alternative: Git Bash for Git-only work

If all you want is a Bash-style prompt for Git, you don’t need WSL. Git for Windows includes Git Bash, which the project describes as a BASH emulation used to run Git from the command line. It’s a native Windows program rather than a Linux system, so it doesn’t need WSL, but it also doesn’t come with a Linux distribution’s package manager or software.

  1. Go to the Git for Windows download page and download the Standalone Installer (x64 for most PCs, ARM64 for Arm-based PCs).
  2. Run the installer. The default choices suit most people; the setup screens are explained in installing Git on Windows 11.
  3. Open Git Bash from the Start menu. A window opens with a prompt where you can run Git commands.

The same page offers a winget install –id Git.Git -e –source winget command for people who prefer installing from the command line, but it notes that the winget package isn’t maintained by the Git for Windows project and might lag behind the latest release. If Python is all you were after, you can install Python on Windows 11 without WSL or Git Bash.

Troubleshooting

wsl –install shows help text instead of installing

The plain command only works when WSL isn’t installed at all. Run wsl –list –online, then wsl –install -d followed by the name of the distribution you want.

The download sits at 0.0%

Run wsl –install –web-download -d Ubuntu (or another distribution name) instead. The –web-download option downloads from an online source instead of the Microsoft Store.

“The term ‘wsl’ is not recognized”

The Windows Subsystem for Linux optional component isn’t installed, or you’re using PowerShell on an ARM64 (Arm-based) PC. Make sure the component is installed (see error 0x8007019e below). On ARM64, run wsl.exe from Command Prompt or PowerShell Core instead.

Error 0x8007019e

The Windows Subsystem for Linux feature isn’t turned on. Select Start, type Windows features, and open Turn Windows features on or off. Check Windows Subsystem for Linux, select OK, and restart.

Error 0x80370102, or “a required feature is not installed”

The Linux virtual machine couldn’t start. Work through these in order:

  1. In Turn Windows features on or off, check Virtual Machine Platform, select OK, and restart.
  2. Make sure the hypervisor is allowed to start. In an administrator PowerShell window, enter bcdedit /enum | findstr -i hypervisorlaunchtype. If the result says Off, enter bcdedit /set hypervisorlaunchtype Auto and restart.
  3. Turn on virtualization in your PC’s UEFI firmware (often called the BIOS). Save your work first, because the PC restarts. Open Settings > System > Recovery and select Restart now next to Advanced startup. Then choose Troubleshoot > Advanced options > UEFI Settings and select Restart. The setting’s name and location vary by manufacturer, usually under CPU options. Microsoft’s steps are in Enable virtualization on Windows.
  4. If you use other virtual machine software, update it to a version that works alongside Hyper-V.

Very old processors can’t run WSL 2 at all. It needs a CPU feature called Second Level Address Translation (SLAT), which first appeared in Intel Core 1st generation and AMD Opteron processors.

Error 0x80070003

WSL only runs on your system drive, usually C:. Open Settings > System > Storage > Advanced storage settings > Where new content is saved, set new apps to save to C:, and install the distribution again. This error can also mean virtualization is off; see the previous section.

“Windows Subsystem for Linux has no installed distributions”

Open the distribution from the Start menu at least once before calling it from the command line. Also check which Windows account you’re using: the built-in Administrator account is a separate account and won’t show distributions installed under your own account.

You forgot your Linux password

  1. Open PowerShell and enter wsl -u root. This opens your default distribution as the root user, with no password needed. (For a distribution that isn’t your default, use wsl -d Debian -u root, swapping in its name.)
  2. Enter passwd followed by your Linux user name, for example passwd alex.
  3. Type a new password twice, then enter exit.

If you still know the password and only want to change it, open the distribution and enter passwd.

No internet inside Bash on a work PC

Company firewall policies can block WSL’s network traffic. That needs a firewall rule from your administrator, so contact IT rather than changing settings yourself.

WSL acts up after working before

Enter wsl –update in PowerShell to update WSL. Then enter wsl –shutdown to stop all running distributions; they start fresh the next time you open one. For anything not covered here, Microsoft keeps a WSL troubleshooting page.

Remove Bash again

To remove a distribution, enter wsl –unregister followed by its name, for example wsl –unregister Ubuntu. Before you do: unregistering permanently deletes all data, settings and software in that distribution, so copy any files you want to keep into a Windows folder first (for example with cp to a folder under /mnt/c). You can also uninstall the distribution’s app the same way you uninstall any other Store app. To remove WSL itself as well, follow uninstalling WSL in Windows 11. Git Bash is removed like any other app, by uninstalling Git.

Frequently asked questions

Does Windows 11 come with Bash?

Not out of the box. Windows 11 includes WSL as a feature you can turn on, but the Bash shell arrives only when you install a Linux distribution through WSL, or when you install Git for Windows, which brings Git Bash.

Does it work on Windows 11 Home?

Yes. Microsoft states that WSL 2 is available on all desktop editions where WSL is available, including Windows 11 Home. You don’t need Windows 11 Pro or the full Hyper-V Manager.

Is WSL a virtual machine?

Sort of. WSL 2 runs Linux in a lightweight utility virtual machine that Windows starts, stops and manages for you, using less memory and storage than a full virtual machine. You never create or configure the virtual machine yourself.

Can I use Bash in Command Prompt or PowerShell?

Yes, once WSL is installed. Type wsl in either window to drop into your default distribution’s Bash shell, or type wsl followed by a single Linux command to run just that command.

Can I run .sh scripts I downloaded?

Yes, from Bash in WSL. Copy the script into your Linux home folder, read it first so you know what it does, and run it with bash scriptname.sh. Scripts written for Linux may not behave the same in Git Bash, which is an emulation rather than a full Linux system.

Do I need to know Linux first?

No. A handful of commands such as pwd, ls and cd are enough to move around, and you can pick up the rest as you need them.

Once your Bash prompt is working, run the update command, then practice the commands in the table inside a test folder in your Linux home directory. For more about the Windows side of the setup, including WSL versions and settings, read installing WSL on Windows 11.