How to Install and Configure Starship Cross-Shell Prompt in Linux for a Fast and Aesthetic Terminal

The standard command prompt provided by Bash, Zsh, or Fish in Linux distributions is typically sparse: a basic user and host string followed by the current path (e.g. user@host:~$). While functional, it fails to convey essential developer context—such as active Git branch names, uncommitted file changes, active Python virtual environments, Node.js versions, Kubernetes clusters, or execution status. While legacy prompt customisers (like Oh My Zsh themes) exist, they are often notorious for introducing noticeable input latency when hitting Enter. To eliminate latency while providing rich contextual information, millions of developers rely on Starship. Built in Rust, Starship is a minimal, blazing-fast, and infinitely customizable cross-shell prompt.

Why Starship Outperforms Legacy Prompt Themes

Starship was engineered specifically to solve prompt latency and cross-shell portability:

  • Blazing-Fast Performance: Renders in mere milliseconds because it compiles to native machine code in Rust, avoiding slow shell script evaluations.
  • Cross-Shell Consistency: Uses an identical configuration file whether you launch Bash, Zsh, Fish, NuShell, or PowerShell.
  • Smart Asynchronous Context: Displays programming runtime versions (Rust, Go, Python, Node, Java, PHP) only when entering directories containing relevant project files.
  • Rich Git Status Integration: Visualises staged files, modified lines, stashes, and commit divergency directly in your command line.
  • Declarative TOML Configuration: All styling, colour schemes, and module arrangements are configured in a clean ~/.config/starship.toml file.

Prerequisites: Installing a Nerd Font

Starship utilizes glyph icons (such as Git branches, language logos, and directory symbols) that require a patched font. Install any popular Nerd Font (such as FiraCode Nerd Font, JetBrainsMono Nerd Font, or MesloLGS Nerd Font) on your workstation and configure your terminal emulator to use it.

Installing Starship on Linux

Starship can be installed via an automated installer, distribution package managers, or Cargo.

Method 1: Automated Official Installer (Universal)

Run the official installation script:

curl -sS https://starship.rs/install.sh | sh

Method 2: Package Managers (Arch, Fedora, and Homebrew)

On Arch Linux and Manjaro:

sudo pacman -S starship

On Fedora:

sudo dnf install -y starship

Using Linuxbrew:

brew install starship

Confirm the binary is functional:

starship --version

Step 2: Initialising Starship in Your Shell

To enable Starship, add the initialization hook to your shell’s startup script.

For Bash Users

Append the hook to ~/.bashrc:

echo 'eval "$(starship init bash)"' >> ~/.bashrc
source ~/.bashrc

For Zsh Users

Append the hook to ~/.zshrc:

echo 'eval "$(starship init zsh)"' >> ~/.zshrc
source ~/.zshrc

For Fish Users

Append the hook to ~/.config/fish/config.fish:

echo 'starship init fish | source' >> ~/.config/fish/config.fish

Your prompt updates instantly with Starship’s modern visual styling.

Step 3: Customising Your Prompt with starship.toml

Starship is configured through a central TOML file located at ~/.config/starship.toml. Create the configuration file:

mkdir -p ~/.config
touch ~/.config/starship.toml

Open the file in a text editor and add custom module arrangements:

# Insert a blank line between shell commands
add_newline = true

# Replace default character with a clean arrow
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"

# Customise directory display
[directory]
truncation_length = 3
truncate_to_repo = true
style = "bold cyan"

# Git branch and status styling
[git_branch]
symbol = "🌱 "
style = "bold purple"

[git_status]
style = "bold red"
format = '([[$all_status$ahead_behind]]($style) )'

# Show command execution duration if exceeding 2 seconds
[cmd_duration]
min_time = 2_000
format = "took [$duration](bold yellow) "

# Package versions
[nodejs]
symbol = "⬢ "
style = "bold green"

[python]
symbol = "🐍 "
style = "bold yellow"

Save the file. Starship reloads changes instantaneously without restarting your terminal session.

Applying Official Community Presets

If you prefer a pre-designed aesthetic (such as pure pastel, gruvbox rainbow, or bracketed segments), apply an official Starship preset:

starship preset pastel-powerline -o ~/.config/starship.toml

This transforms your terminal into a sleek powerline ribbon display.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.