Skip to content

How to install and use Zsh in Windows 10?

  • by
  • 6 min read

Windows 10 can run Ubuntu and other popular Linux distributions natively using the Bash shell for those of you who don’t know. If you want, however, you can use other shells like Zsh as well. 

Think of it as Wine but for Windows. While Wine allows you to run Windows programs on Linux, Windows also allows you to run Linux subsystems. It’s not the whole package, but you can still do a lot.

In this article, we’re talking about how you can install and use the Zsh shell on Windows 10.

Also read: Top 7 Procreate alternatives for Windows


Installing Bash

Before we get started with the Zsh shell, we need to install Bash and get a Linux subsystem up and running. The process for this is actually quite simple, but it’s divided into two main steps.

  • Enabling the Windows Subsystem for Linux.
  • Download the Linux distro of your choice from the Microsoft Store.

Enabling the Windows Subsystem for Linux

You can enable this feature just like you would any other optional Windows feature from the Control Panel. Here’s how.

Step 1: Press the Windows key and search for Control Panel. 

How to install and use Zsh in Windows 10?

Step 2: Click on Programs.

How to install and use Zsh in Windows 10?

Step 3: Click on Turn Windows Features On Or Off.

How to install and use Zsh in Windows 10?

Step 4: Find the Windows Subsystem for Linux in the list and click the checkbox.

How to install and use Zsh in Windows 10?

Step 5: Wait for Windows to finish the installation. Once done, you’ll be prompted for a restart. Click on the Restart now button to proceed. 

How to install and use Zsh in Windows 10?

Also read: Teamspeak vs Discord: Which one should you use and why?

Downloading a Linux distro from the Microsoft Store

Once you’ve enabled the Linux subsystem, all you need to do is download the distro of your choice from Microsoft Store, and you’re good to go. Many major distributions, including Ubuntu, Debian, Kali, openSUSE Leap, and openSUSE Enterprise, are available on the store.

If you’re not sure which distro you should pick, we recommend starting with Ubuntu.

Step 1: Head over to the Microsoft Store and search for your distro of choice. Click on the distro you want to proceed with.

How to install and use Zsh in Windows 10?

Step 2; Click on the Get button to download the distro.

How to install and use Zsh in Windows 10?

Wait for the download to finish. You can now launch the distro just like any other app downloaded from the store. You’ll be prompted for login credentials on the first launch. Note that these don’t have to be the same as your Windows credentials. 

Also read: How to fix ‘DISM error 87’ on Windows 10?


How to install Zsh?

From here on, the steps are pretty much the same as they’d be on Linux. You can download Zsh using the apt-get command. Launch your distro and type in the following command.

sudo apt-get install zsh
How to install and use Zsh in Windows 10?

If you’re using another Linux distro, use the distro’s software installation command followed by the shell’s name. It doesn’t have to be Zsh. 

Wait for the download to finish. You can now launch the Zsh shell using the zsh command. The first time you launch Zsh, you’ll be prompted to go through the first-time setup. Just press 2 to create a configuration profile with the recommended default settings. 

How to install and use Zsh in Windows 10?

Also read: How to delete Metadata from photos on Windows and Android?


Launching Zsh directly

You don’t always have to first open your distro and then Zsh. You can launch the shell directly from the Command Prompt as well. Just type in any of the following commands into the prompt, and you’re good to go.

wsl zsh
bash -c zsh
ubuntu -c zsh
opensuse-42 -c zsh
sles-12 -c zsh
How to install and use Zsh in Windows 10?

Also read: How to view and change Microsoft Store install location in Windows 10?


How to make Bash automatically launch Zsh?

You can also have Bash launch Zsh automatically every time you open your distro. The process involves making some simple changes to the bashrc file.

Step 1; Launch your distro and type in the following command to open the bashrc file with the Nano text editor. 

Note that you can use any editor you want, we’re using Nano for simplicity. 

nano .bashrc
How to install and use Zsh in Windows 10?

Step 2: Add the following lines to the file.

#These lines are here to automatically launch Zsh every time the Bash shell launches.
if [ -t 1 ]; then
exec zsh
fi
How to install and use Zsh in Windows 10?

You could get away with just writing exec zsh, but the other lines ensure that Zsh is only launched when you open a Bash window to avoid conflicts with any other software or Linux distros you might have. 

If you want to execute a different shell, simply type in the shell’s name instead of zsh in the exec zsh line.

Step 3: When you’re done making changes, press Ctrl + X to exit the file followed by to save the modified buffer. 

How to install and use Zsh in Windows 10?

Should you want to reverse these changes, just remove the lines added in step 2.

Also read: Where are Chrome bookmarks located in Windows 10?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>