How to Fix bash: starship: command not found in Minimal Linux Distributions

The starship prompt is a cross-shell, lightning-fast prompt generator written in Rust that displays Git status, package manager versions, container contexts, and execution durations with minimal resource footprint. In newly deployed minimal Linux installations, container base images, or remote VPS servers, running starship or opening a terminal session where starship init is scripted yields bash: starship: command not found because the binary is not part of default Linux distributions.

Install starship via Official Automated Install Script

The cleanest approach for minimal systems fetches the pre-compiled static binary directly without compiling Rust dependencies:

# Download and install starship to /usr/local/bin
curl -sS https://starship.rs/install.sh | sh -s -- -y

# Verify executable execution permissions
sudo chmod +x /usr/local/bin/starship

# Verify installation
starship --version

Configure Starship Shell Hook in Bash Profile

Installing the binary alone does not render the custom prompt; the shell hook must be appended to your profile:

  1. Append the shell initialization hook to your user configuration:
    echo 'eval "$(starship init bash)"' >> ~/.bashrc
    source ~/.bashrc
  2. For Zsh environments, append eval "$(starship init zsh)" to ~/.zshrc instead.
  3. For Fish users, add starship init fish | source to ~/.config/fish/config.fish.
  4. Your terminal prompt will instantly transform into the dynamic Starship prompt.

Install via Linux Distribution Package Managers

Modern Linux package registries also include starship natively:

# On Arch Linux:
sudo pacman -S starship

# On Alpine Linux:
apk add starship

# On systems with Homebrew:
brew install starship

Get the best tech tips delivered straight to your inbox.

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