How to Install Zsh on Debian 13, 12 and 11

Last updated Friday, May 22, 2026 10:30 am Joshua James 7 min read

Zsh becomes easier to live in than plain Bash once you want better completion, shared history, and prompts that surface useful context without extra busywork. Debian’s default APT sources already make it straightforward to install Zsh on Debian 13, 12, and 11.

From there, you can keep the shell lean, add Debian-packaged plugins for suggestions and syntax highlighting, or layer Oh My Zsh on top when you want faster theme and plugin management.

Install Zsh on Debian

Debian’s default APT sources already package Zsh on Debian 13, 12, and 11, so the main choice is how much customization you want on top of the shell itself.

MethodSource or ChannelUpdate BehaviorBest For
Basic ZshDebian default APT sourcesUpdates with Debian packagesA better interactive shell with a light config
Zsh + packaged pluginsDebian default APT sourcesZsh and plugin packages update through APTAPT-managed suggestions and syntax highlighting
Zsh + Oh My ZshDebian zsh package plus Oh My Zsh’s upstream installerZsh updates through APT; the framework and cloned plugins update separatelyThemes, plugin management, and faster prompt customization
  • Pick Basic Zsh if you want the shell upgrade without adding another framework.
  • Pick the Debian plugin packages if you want history suggestions and syntax highlighting while keeping everything under APT.
  • Pick Oh My Zsh if you want themes, a larger plugin ecosystem, and easier prompt customization. Oh My Zsh manages your user configuration; Debian’s zsh package still provides the shell binary.

Install Zsh from Debian’s Default Repositories

Refresh APT metadata first, then install the shell package.

sudo apt update

These commands use sudo for tasks that need root privileges. If your account does not have sudo access yet, follow the guide to add a user to sudoers on Debian before you continue.

sudo apt install zsh -y

The -y flag answers the confirmation prompt automatically so the command finishes without waiting for input. Relevant output includes:

Installing:
  zsh

Installing dependencies:
  zsh-common

Setting up zsh-common (5.9-8) ...
Setting up zsh (5.9-8+b23) ...

Check the installed version next:

zsh --version
zsh 5.9 (x86_64-debian-linux-gnu)

Debian 13 currently packages zsh 5.9-8+b23, while Debian 12 packages 5.9-4+b15. Debian 11 reports Zsh 5.8, but the install, plugin, and Oh My Zsh steps stay the same.

Run the Zsh First-Start Wizard on Debian

The first time you launch Zsh without a ~/.zshrc file, Debian starts the built-in zsh-newuser-install wizard.

zsh

Relevant output begins with:

This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~).  This function can help you with a few settings that should
make your use of the shell easier.

You can:

(q)  Quit and do nothing.  The function will be run again next time.

(0)  Exit, creating the file ~/.zshrc containing just a comment.
     That will prevent this function being run again.

(1)  Continue to the main menu.

(2)  Populate your ~/.zshrc with the configuration recommended
     by the system administrator and exit (you will need to edit
     the file by hand, if so desired).
  • Use q if you only want to test Zsh and decide later.
  • Use 0 if you want an empty ~/.zshrc and plan to build the config yourself.
  • Use 1 if you want to tune history, completion, and key bindings from the interactive menus.
  • Use 2 if you want Debian’s starter configuration right away.

If you plan to move straight to Oh My Zsh, q or 0 keeps the transition simple. The Oh My Zsh installer can replace an existing ~/.zshrc after backing it up.

Set Zsh as the Default Shell on Debian

Once you decide to keep Zsh, change your login shell so new terminals open in Zsh automatically.

chsh -s /usr/bin/zsh

The command asks for your account password. Open a new terminal, or log out and back in, before you check the result.

echo $SHELL
/usr/bin/zsh

Install Zsh Plugin Packages on Debian

Debian packages the two most common quality-of-life Zsh plugins, so you can keep auto-suggestions and syntax highlighting under APT instead of managing them by hand.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting -y

Relevant lines include:

Installing:
  zsh-autosuggestions  zsh-syntax-highlighting

Setting up zsh-autosuggestions (0.7.1-1) ...
Setting up zsh-syntax-highlighting (0.8.0-2) ...

Debian 13 packages zsh-autosuggestions 0.7.1 and zsh-syntax-highlighting 0.8.0. Debian 12 packages 0.7.0 and 0.7.1, while Debian 11 keeps 0.6.4 and 0.7.1.

Add the Debian Zsh Plugin Scripts to .zshrc

Debian installs both plugin entry files under /usr/share, so add these lines near the end of ~/.zshrc:

source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Start a new Zsh session to test the change:

zsh

If you are already in Zsh, run source ~/.zshrc there instead. Do not source this file from Bash, because both plugin scripts use Zsh-specific syntax and error out in a Bash shell.

Auto-suggestions shows recent commands as faint inline text, and syntax highlighting colors valid commands, options, and paths before you press Enter.

Install Oh My Zsh on Debian

Oh My Zsh is the fast path when you want themes, a larger plugin catalog, and a cleaner structure for managing your Zsh configuration on Debian.

Install the Oh My Zsh Prerequisites on Debian

The installer clones the framework with Git and downloads the setup script with curl -fsSL. Install both prerequisites before you run it. If you want the Git workflow background, the Debian article to install Git on Debian covers the package separately, and the curl command in Linux examples explain the -f, -s, -S, and -L flags used by the installer command.

sudo apt install git curl -y

Run the Oh My Zsh Installer on Debian

Run the upstream installer from a normal user account, not from root:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

If ~/.zshrc already exists, the default installer backs it up to ~/.zshrc.pre-oh-my-zsh before it writes the new template. The framework itself is placed under ~/.oh-my-zsh.

Confirm the framework directory exists after the installer finishes:

test -d "$HOME/.oh-my-zsh" && echo "Oh My Zsh installed"
Oh My Zsh installed

Enable Common Oh My Zsh Plugins on Debian

Clone the two popular plugins into Oh My Zsh’s custom plugin directory:

ZSH_CUSTOM_DIR=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions"
git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting"

The --depth 1 flag downloads only the latest snapshot instead of the full Git history.

Replace the default plugin line in ~/.zshrc with this version:

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Open a new terminal after you save the file, or run source ~/.zshrc from an existing Zsh prompt.

Change the Oh My Zsh Theme on Debian

Set the theme in ~/.zshrc if you want something more informative than the default prompt:

ZSH_THEME="agnoster"

Restart Zsh after the change, or reload the file from an existing Zsh prompt. If the prompt symbols render as empty boxes instead of arrows or Git markers, install the fonts-powerline package and reopen the terminal before you judge the theme itself.

sudo apt install fonts-powerline -y

Troubleshoot Zsh on Debian

These checks cover the most common Debian-side problems after the shell change: the login shell still opening in Bash, Zsh missing before Oh My Zsh starts, plugin files being sourced from the wrong shell, or cloned Oh My Zsh plugins missing from the custom plugin directory.

Fix Zsh Not Becoming the Default Shell on Debian

If a new terminal still opens in Bash after the shell change, make sure Zsh is listed in the allowed shells file before you rerun chsh. If grep is unfamiliar, the grep command in Linux examples use the same simple text filter you need here.

grep zsh /etc/shells
/bin/zsh
/usr/bin/zsh

If both entries are present, rerun chsh -s /usr/bin/zsh and log out completely before you test again with echo $SHELL. Opening another terminal tab without a full logout can keep the old login shell active.

Fix Zsh Is Not Installed Errors on Debian

If Oh My Zsh or another setup step reports zsh is not installed. please install zsh first., check whether Debian can find the shell binary.

command -v zsh || echo "zsh missing"

A working install prints the Zsh path, usually /usr/bin/zsh. If the command prints zsh missing, install the package and repeat the version check from the install section.

sudo apt install zsh -y
zsh --version

Fix Oh My Zsh Loading from sh on Debian

If you see Error: Oh My Zsh can't be loaded from: sh. You need to run zsh instead., bad substitution, alias: -L: invalid option, or similar errors after loading ~/.zshrc, the file was sourced from Bash or another POSIX shell instead of Zsh.

[ -n "$ZSH_VERSION" ] && echo zsh || echo bash
zsh

If the command prints bash, start a Zsh shell first and then reload the file from that Zsh prompt:

zsh
source ~/.zshrc

A successful rerun produces no error output.

Fix Missing Oh My Zsh Plugin Errors on Debian

If Oh My Zsh reports plugin 'zsh-syntax-highlighting' not found or the same message for zsh-autosuggestions, the plugin name is present in ~/.zshrc but the matching cloned directory is missing.

ZSH_CUSTOM_DIR=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
ls "$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions"
ls "$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting"

If either directory is missing, clone only the missing plugin into Oh My Zsh’s custom plugin directory:

ZSH_CUSTOM_DIR=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
test -d "$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions" || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions"
test -d "$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting" || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting"

Reload the file from a Zsh prompt after the directories exist:

source ~/.zshrc

Update Zsh on Debian

Debian-managed Zsh, packaged plugins, and the optional fonts-powerline package update through APT, while Oh My Zsh uses its own updater after the framework is installed.

Update the Debian Zsh Packages

Use Debian’s package manager when you want to refresh Zsh and the optional packaged plugins without upgrading unrelated packages.

sudo apt install --only-upgrade zsh zsh-autosuggestions zsh-syntax-highlighting -y

Relevant lines include:

zsh is already the newest version (5.9-8+b23).
zsh-autosuggestions is already the newest version (0.7.1-1).
zsh-syntax-highlighting is already the newest version (0.8.0-2).

Update Oh My Zsh on Debian

Run the framework updater from a Zsh session after Oh My Zsh is already installed.

omz update

The updater prints an Oh My Zsh banner, then finishes with a status line similar to this when no update is available:

Oh My Zsh is already at the latest version.

If you cloned the optional plugins from Git, update those repositories separately:

ZSH_CUSTOM_DIR=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
git -C "$ZSH_CUSTOM_DIR/plugins/zsh-autosuggestions" pull
git -C "$ZSH_CUSTOM_DIR/plugins/zsh-syntax-highlighting" pull

Remove Zsh and Oh My Zsh from Debian

Switch your login shell back to Bash before you remove Zsh, otherwise future logins can still point to a shell that is no longer installed.

Switch from Zsh Back to Bash on Debian

Run the shell change first, then close the session completely before you remove the packages.

chsh -s /bin/bash

Remove the Debian Zsh Packages

Remove the shell, the shared zsh-common package, and the packaged plugins with APT:

sudo apt remove zsh zsh-common zsh-autosuggestions zsh-syntax-highlighting -y

Relevant lines include:

REMOVING:
  zsh  zsh-autosuggestions  zsh-common  zsh-syntax-highlighting

Removing zsh-syntax-highlighting (0.8.0-2) ...
Removing zsh-autosuggestions (0.7.1-1) ...
Removing zsh (5.9-8+b23) ...
Removing zsh-common (5.9-8) ...

If you installed fonts-powerline only for the Agnoster prompt and no other application needs it, remove that package separately:

sudo apt remove fonts-powerline -y

APT may also report packages that are no longer required after removal. Review that list before accepting it, especially on reused systems where old automatic packages can predate this Zsh install.

sudo apt autoremove

Confirm that none of the Zsh packages remain installed:

dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' zsh zsh-common zsh-autosuggestions zsh-syntax-highlighting 2>/dev/null | grep '^ii' || echo "Zsh packages removed"
Zsh packages removed

Remove Oh My Zsh Files on Debian

APT removal does not touch your per-user framework files or configuration. Check which Oh My Zsh files exist before deleting anything:

ls -d ~/.oh-my-zsh ~/.zshrc ~/.zshrc.pre-oh-my-zsh 2>/dev/null || echo "No Oh My Zsh files found"

The next command deletes the Oh My Zsh framework and the listed Zsh startup files for your current user. Back up any custom aliases, functions, themes, or plugin settings before you run it.

rm -rf ~/.oh-my-zsh ~/.zshrc ~/.zshrc.pre-oh-my-zsh

If you had a hand-edited ~/.zshrc before installing Oh My Zsh, keep ~/.zshrc.pre-oh-my-zsh and restore it instead of deleting it.

Conclusion

Zsh is installed on Debian and ready for daily shell work with better completion, shared history, and clearer prompt customization. Keep the Debian plugin packages if you want the light APT-managed path, or move to Oh My Zsh when you want themes and a larger plugin ecosystem without rebuilding your shell setup from scratch.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: