Zsh Shell Installation and Configuration on Linux: A Comprehensive Guide
If you’ve been using Linux for a while, you’re likely familiar with the Bash (Bourne Again Shell)—the default shell for most Linux distributions. While Bash is reliable, it lacks many modern features that power users crave. Enter Zsh (Z Shell)—a robust, highly customizable shell that builds on Bash’s functionality with enhanced auto-completion, theme support, plugin ecosystems, and more.
Whether you’re a developer, system administrator, or casual Linux user, Zsh can transform your terminal experience. In this guide, we’ll walk through installing Zsh on various Linux distributions, setting it as your default shell, and configuring it to unlock its full potential—including themes, plugins, and custom workflows.
For RHEL 8+, AlmaLinux, Rocky Linux, or CentOS Stream:
sudo dnf install zsh -y
Note: CentOS 7 reached end-of-life on June 30, 2024. If you are still using CentOS 7, consider migrating to AlmaLinux or Rocky Linux—community-driven, RHEL-compatible successors. For RHEL-based systems, enable the EPEL repository first if needed:
When you launch Zsh for the first time, you’ll see a configuration wizard:
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 .zshrc, .zprofile, .zshlogin, .zlogout in your home directory).
...
For a truly polished Zsh experience, use Oh My Zsh—a community-driven framework that simplifies theme management, plugin installation, and configuration.
agnoster: Colorful theme with Git branch, current directory, and user@hostname. Requires Nerd Fonts or Powerline fonts (see below).
ys: Minimalist theme with Git status and path.
powerlevel10k: Feature-rich theme with Git status, execution time, and an interactive configuration wizard. Includes an "instant prompt" feature that renders the prompt immediately while plugins load in the background. Requires Nerd Fonts. Note: the project is currently in maintenance mode.
spaceship: Modular prompt showing Git status, runtime versions, and more.
Alternative: Starship — A cross-shell prompt written in Rust that works with Zsh, Bash, Fish, and PowerShell. It is actively maintained, fast, and configured via a single TOML file. If you want a consistent prompt across multiple shells, Starship is an excellent choice. Install with curl -sS https://starship.rs/install.sh | sh and add eval "$(starship init zsh)" to your .zshrc.
The agnoster theme uses special characters that require Nerd Fonts or Powerline fonts. Nerd Fonts patches developer fonts with a large number of glyphs (icons, symbols) and is the more comprehensive option. Powerline fonts provide a smaller set of glyphs sufficient for most prompt themes.
Option A: Nerd Fonts (recommended)
Download your preferred font from nerdfonts.com and install it manually, or use a package manager:
# Example: Install JetBrainsMono Nerd Font on Archparu -S nerd-fonts-jetbrains-mono
docker/docker-compose: Auto-completion for Docker commands.
python: Aliases for Python/pip (e.g., pipup=pip install --upgrade pip).
you-should-use: Reminds you of existing aliases whenever you type a full command that has a shorter alias. Great for building the habit of using your shortcuts.
Install:
If Oh My Zsh feels slow to start (especially with many plugins), consider switching to Zinit—a lightweight plugin manager with turbo mode that defers plugin loading until after the prompt appears, reducing perceived startup time by 50–80%:
Zsh is more than just a shell—it’s a productivity tool that adapts to your workflow. By following this guide, you’ve installed Zsh, set it as your default shell, and configured it with Oh My Zsh themes and plugins.
The journey doesn’t end here: explore more themes, plugins, and customizations to make Zsh truly your own. The Zsh ecosystem is vast, so experiment and find what works best for you!