Mohan pd.
Mohan pd. Author of The Coders Blog. Also a professional fullstack javascript developer working with various tech company and client around world.

Installing ZSH & Oh-my-zsh on Linux

Apr 27, 2020 · 4 minutes
Installing ZSH &  Oh-my-zsh on Linux

ZSH is one of the most powerful interactive UNIX shell Zsh was developed by ‘Paul Fastad’ since 1990, and the name ‘zsh’ comes from the Yale professor Zong Shao.

How to install zsh on many platforms


Try zsh --version before installing it from Homebrew. If it’s newer than 4.3.9 you might be OK. Preferably newer than or equal to 5.0.

brew install zsh zsh-completions

To set zsh as your default shell, execute the following for macOS High Sierra

chsh -s /bin/zsh

Assuming you have Homebrew installed. If not, most versions of macOS ship zsh by default, but it’s normally an older version. Alternatively, you may also use MacPorts

sudo port install zsh zsh-completions

Ubuntu, Debian & derivatives (Windows 10 WSL | Native Linux kernel with Windows 10 build 1903)

apt install zsh

If you don’t have apt, the recommended package manager for end users [1] [2] [3] [4] , you can try apt-get or aptitude.

Other distributions that apply include: Linux Mint, elementary OS, Zorin OS, Raspbian, MX Linux, Deepin.


zypper install zsh

Arch Linux

pacman -S zsh

Void Linux

xbps-install zsh


dnf install zsh


To install the package:

pkg_add zsh


To install the package:

pkg install zsh

To install the port:

cd /usr/ports/shells/zsh/ && make install clean

To reduce memory usage, optionally enable zsh-mem options with

make config

before running “make install”.


sudo yum update && sudo yum -y install zsh


Install the zsh package using the installer. Unfortunately Cygwin doesn’t have a standard command line interface.

The easiest way to change the default shell is to set your SHELL user environment variable. Search for “Edit Environment variables for your account” to bring up the environment variables window, create a new variable named “SHELL” and give it the value “/usr/bin/zsh/”.

Alternatively: Open Cygwin (in BASH) then type:

sudo nano ~/.bashrc

Once the .bashrc file is open, add this line to the very top:

exec zsh

Close and save the file. Close and reopen Cygwin. It will execute the command every time you load the terminal and run your zsh shell.


eopkg it zsh


emerge app-shells/zsh

Alpine Linux

apk add zsh


pacman -S zsh

Termux (Android)

Termux is an terminal emulator for Android but has modern feature like Debian and Ubuntu (Termux has Bash shell and Busybox GNU-like programs). For the package manager, Termux using an Debian/Ubuntu package manager, APT. To install the package, run this command:

pkg install zsh

The command looks like FreeBSD package manger (pkg). Or you can run this command:

apt update && apt upgrade
apt install zsh

To set zsh as your default shell, run this command:

chsh -s /data/data/com.termux/files/usr/bin/zsh


chsh -s $(which zsh)

Add yours

If you know a platform that is not covered, edit this page and add it!

Setup ZSH with help from oh-my-zsh

iTerm in action

Installing oh-my-zsh

Clone repository

git clone git:// ~/.oh-my-zsh

Optional backup .zshrc config

cp ~/.zshrc ~/.zshrc.orig

Create a new zsh config by copying the zsh template oh-my-zsh provided

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Set zsh as your default shell

chsh -s /bin/zsh

Installing Powerline Themes

Clone repository

git clone ~/.oh-my-zsh-powerline-theme

Create symlink to oh-my-zsh themes folder

ln -f powerline.zsh-theme ~/.oh-my-zsh/themes/powerline.zsh-theme

Configure the theme in your .zshrc file


Install powerline fonts (pre-patched and adjusted fonts for usage with the new Powerline plugin). Download fonts from this repository:

MAC: copy fonts to folder ~/Library/Fonts/

Linux: copy fonts to folder ~/.fonts/

Installing Custom Plugins for oh-my-zsh

Create custom plugins directory

mkdir ~/.oh-my-zsh/custom/plugins


cd ~/.oh-my-zsh/custom/plugins
git clone git://


Screenshot shown above:

custom color schemes (based on Zenburn color schemes)
Menlo Regular for Powerline - 11pt

Example .zshrc

    # Path to your oh-my-zsh configuration.

    # Configuration for powerline theme
    # Look in ~/.oh-my-zsh-powerline-theme

    # Set name of the theme to load.
    # Look in ~/.oh-my-zsh/themes/

    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(colored-man git history-substring-search sublime vagrant zsh-syntax-highlighting)

    source $ZSH/

    # Customize to your needs...
    export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

    # Set 256 Color
    export TERM=xterm-256color

    # VirtualEnv
        source /usr/local/bin/

comments powered by Disqus