🖥️ Setting Up Your Zsh Terminal
Introduction
A modern shell setup with Zsh, Oh My Zsh, and Atuin gives you fast startup, syntax-highlighted prompts, autosuggestions, and a searchable history database. This guide covers every step, plus a workaround if your account is directory-based (and not in /etc/passwd).
1. Install Prerequisites
sudo apt-get update
sudo apt-get install -y zsh git curl
2. Install Zsh
sudo apt-get install -y zsh
Tip: You normally set your shell with
chsh -s $(which zsh), but if your user is managed via LDAP/AD (and not listed in/etc/passwd), you can’t usechsh. Skip to Step 8 for a fallback.
3. Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- This creates
~/.oh-my-zsh/and a fresh~/.zshrc.
4. Add Essential Plugins
# Autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions \
~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
# Syntax highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
5. Configure ~/.zshrc
Open ~/.zshrc and adjust:
ZSH_THEME="agnoster"
- plugins=(git)
+ plugins=(
+ git
+ zsh-autosuggestions
+ zsh-syntax-highlighting
+ )
# Optional: speed up prompts
# DISABLE_UPDATE_PROMPT="true"
Reload:
source ~/.zshrc
6. Install Atuin (Shell-History DB)
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
Alternatively, via APT:
sudo apt-get install -y atuin
7. Hook Atuin into Zsh
Add to the end of ~/.zshrc:
eval "$(atuin init zsh)"
Reload again:
source ~/.zshrc
8. Fallback if You Can’t Change Your Login Shell
If chsh fails because your account lives in an external directory:
-
Edit your default shell’s startup file—for Bash it’s usually
~/.bash_profile,~/.profile, or~/.bashrc. -
Add at the very top:
# Auto-switch to Zsh for interactive sessions
if [ -t 1 ] && [ -f "$(which zsh)" ]; then
exec zsh -l
fi -
Save and log out & back in (or start a new terminal).
- Your login shell remains Bash, but it immediately executes Zsh on each interactive session.
- All your Oh My Zsh and Atuin config will load as if Zsh were your default.
9. Import & Use Your History
atuin import auto # pulls in your old history
- Press Ctrl + R or run
atuin searchto fuzzy-find past commands.
Conclusion
You’re now running:
- Zsh (even without
chsh) - Oh My Zsh with autosuggestions & syntax highlighting
- Atuin for a powerful, searchable history DB
Enjoy your smarter, faster terminal!