If you’re tired of the default Bash prompt and want a more powerful, customizable shell, Zsh paired with Oh My Zsh is the perfect solution. This guide walks you through installing Zsh, turning it into your default shell, and supercharging it with Oh My Zsh – all in plain English and real commands you can copy‑paste.
What You’ll Need
- A Linux machine (Ubuntu, Fedora, Arch, Debian, etc.)
- Internet connection
- Basic familiarity with the terminal
- sudo privileges
Step 1: Install Zsh
Most modern Linux distributions ship Zsh in their official repositories. Open a terminal and run the command that matches your distro:
- Ubuntu/Debian:
sudo apt update && sudo apt install zsh -y - Fedora:
sudo dnf install zsh -y - Arch Linux:
sudo pacman -S zsh
After the installation finishes, verify the version with zsh --version. You should see something like zsh 5.8 (x86_64‑linux‑gnu).
Step 2: Make Zsh Your Default Shell
Changing the default shell ensures every new terminal session starts with Zsh. Run:
chsh -s $(which zsh)
You’ll be prompted for your password. After you log out and log back in (or simply restart the terminal emulator), the prompt will switch to Zsh. If you see a “command not found” error, double‑check that which zsh returns a valid path, typically /usr/bin/zsh or /bin/zsh.
Step 3: Install Oh My Zsh
Oh My Zsh is a community‑driven framework that ships with themes, plugins, and a sane default configuration. The official installation script pulls the latest release from GitHub:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
The script will back up any existing ~/.zshrc, clone the repository into ~/.oh-my-zsh, and generate a fresh .zshrc. When the installer asks “Change default shell to zsh? (Y/n)”, type Y if you haven’t already run chsh.
If you prefer wget over curl, replace the command with:
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Step 4: Choose a Theme
Oh My Zsh ships with dozens of themes that control how your prompt looks. The default is robbyrussell, but many users love agnoster or powerlevel10k (the latter requires extra fonts). To change the theme, edit ~/.zshrc and set the ZSH_THEME variable:
ZSH_THEME="agnoster"
Save the file and reload the configuration with source ~/.zshrc. If the prompt looks garbled, you probably need a Powerline‑compatible font. Install one (e.g., sudo apt install fonts-powerline) and set your terminal’s font accordingly.
Step 5: Enable Useful Plugins
Plugins add autocomplete, syntax highlighting, git integration, and more. Open ~/.zshrc and locate the plugins=(...) line. A solid starter set looks like this:
plugins=(git docker kubectl zsh-autosuggestions zsh-syntax-highlighting)
After editing, you need to install the two external plugins that aren’t bundled with Oh My Zsh:
- zsh-autosuggestions:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions - zsh-syntax-highlighting:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Finally, reload: source ~/.zshrc. You should now see suggestions appear in a faint color as you type, and syntax errors highlighted in real time.
Step 6: Fine‑Tune Your .zshrc
The .zshrc file is where you keep personal aliases, environment variables, and custom functions. Here are a few beginner‑friendly tweaks:
- Aliases:
alias ll='ls -alF'andalias gs='git status' - Path additions:
export PATH="$HOME/.local/bin:$PATH" - Prompt customization: If you stick with
agnoster, you might want to hide the username on local machines:DEFAULT_USER=$(whoami)
After editing, always run source ~/.zshrc to apply changes without restarting the terminal.
Common Mistakes to Avoid
Even beginners can trip over a few pitfalls:
- Skipping the font installation: Themes like
agnosterrely on Powerline symbols. Without the right font, your prompt will display odd characters. - Forgetting to reload: After changing
.zshrc, you must runsource ~/.zshrcor open a new terminal. Otherwise you’ll keep seeing the old configuration. - Using the wrong path for plugins: The
${ZSH_CUSTOM}variable points to~/.oh-my-zsh/custom. Cloning plugins elsewhere will cause “module not found” errors. - Running
chshwithout sudo: On some distributions only root can change the default shell. Usesudo chsh -s $(which zsh) $USERif you hit a permission error.
Tips and Tricks
Here are a few extra ideas to make your Zsh experience even smoother:
- Powerlevel10k: If you crave a lightning‑fast, highly configurable theme, install
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10kand setZSH_THEME="powerlevel10k/powerlevel10k". The first launch walks you through a visual configuration wizard. - Auto‑update Oh My Zsh: The framework checks for updates daily, but you can force a refresh with
omz update. - History sharing across terminals: Add
setopt SHARE_HISTORYto.zshrcso commands typed in one window appear in another. - Conditional loading: To keep startup fast, load heavy plugins only when needed, e.g.,
if [[ $TERM == xterm* ]]; then plugins+=(docker); fi.
Frequently Asked Questions
Do I still need Bash?
No. Zsh can run any Bash script because it’s largely compatible. You can keep Bash installed for scripts that explicitly call /bin/bash, but your interactive work will be in Zsh.
How do I revert back to Bash?
Run chsh -s $(which bash) and log out/in. Your .zshrc will remain untouched, so you can switch back later without losing configuration.
Why does my prompt freeze after installing a plugin?
Some plugins, especially those that query external services (like zsh-autosuggestions with a slow network), can introduce latency. Disable the plugin in .zshrc and reload to confirm. If the issue disappears, consider updating the plugin or checking your network.
Conclusion
Zsh paired with Oh My Zsh transforms a plain terminal into a vibrant, productivity‑boosting workspace. By following the six steps above, you’ll have a fully functional, personalized shell that works on any Linux distribution. Remember to choose a readable font, keep your plugins tidy, and enjoy the speed and flexibility that Zsh brings. Happy hacking!
Photo by Microsoft Copilot on Unsplash






