---
title: "How to Install Fish Shell on Ubuntu (Latest Version 4)"
description: "Step-by-step guide to install the latest Fish Shell 4.x on Ubuntu from the official PPA, with initial configuration and tips for getting started."
date: 2026-02-24
categories: ["vps"]
tags: ["fish-shell"]
---

import Notice from "@components/widgets/Notice.astro";
import Accordion from "@components/widgets/Accordion.astro";

Ubuntu ships with Bash by default, and the Fish version in Ubuntu's repositories is usually old. At the time of writing, the latest Fish is **4.5.0** (released February 17, 2026) while Ubuntu's repos may still carry a 3.x version. The official Fish PPA gives you the current release.

Here's how to get Fish 4.x installed and running on Ubuntu. If you're on a Mac, see my [Fish Shell macOS setup guide](/fish-shell-macos-setup/) instead.

## Install Fish from the official PPA

The Fish team maintains a PPA that tracks the latest stable release. Three commands and you're done:

```bash
sudo apt-add-repository ppa:fish-shell/release-4
sudo apt update
sudo apt install fish
```

Verify it installed correctly:

```bash
fish --version
```

You should see something like `fish, version 4.5.0`.

<Notice type="info" title="Ubuntu version support">
The Fish PPA supports Ubuntu 22.04, 23.04, 23.10, 24.04, and newer. If you're on an older Ubuntu release, you may need to build from source or use the standalone binary from the GitHub releases page.
</Notice>

## Try Fish without switching your default shell

You don't have to commit right away. Just type:

```bash
fish
```

This drops you into a Fish session. You get [autosuggestions](/fish-shell-autocomplete-suggestions/), [syntax highlighting](/fish-shell-syntax-highlighting/), and tab completions immediately. Play around. Type a few commands. If you don't like it, type `exit` and you're back in Bash.

## Set Fish as your default shell

Once you're ready to commit:

```bash
which fish
```

This should return `/usr/bin/fish`. Now set it as your login shell:

```bash
chsh -s /usr/bin/fish
```

Log out and back in (or open a new terminal). Fish is now your default.

To switch back to Bash later:

```bash
chsh -s /usr/bin/bash
```

<Notice type="warning" title="Keep Bash installed">
Don't remove Bash. Many system scripts depend on it, and you'll want it around for running POSIX shell scripts. Fish replaces your interactive shell, not your system's script interpreter.
</Notice>

## Initial configuration

Fish's config file lives at `~/.config/fish/config.fish`. If it doesn't exist, Fish creates it on first run. Here's a basic starting config:

```fish
# ~/.config/fish/config.fish

# Add custom paths
fish_add_path ~/bin
fish_add_path ~/.local/bin

# Disable the greeting message
set -g fish_greeting

# Set your preferred editor
set -gx EDITOR vim
```

A few things to note:

- `fish_add_path` is the Fish way to add directories to your `$PATH`. Don't try to use `export PATH=...` like in Bash.
- `set -g` sets a global variable for the current session. `set -gx` also exports it to child processes.
- `set -g fish_greeting` with no value suppresses the default "Welcome to fish" message.

### Modular configuration with conf.d

Fish sources every `.fish` file in `~/.config/fish/conf.d/` at startup. This is cleaner than dumping everything into one file. For example, you could create:

```fish
# ~/.config/fish/conf.d/aliases.fish
abbr -a gst git status
abbr -a gco git checkout
abbr -a gp git push
```

I cover abbreviations vs aliases in detail in [Fish Shell abbreviations vs aliases](/fish-shell-abbreviations-vs-aliases/). Short version: Fish abbreviations expand into the full command before executing, which is better than aliases in most cases.

## Install a plugin manager

Fish works fine without plugins, but a plugin manager lets you add things like better git integration, fzf search, and [Node version management](/nvm-fish-shell/).

**Fisher** is the most popular choice:

```fish
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
```

Now you can install plugins with `fisher install`. For example:

```fish
fisher install PatrickF1/fzf.fish
fisher install jorgebucaran/nvm.fish
```

I have a full guide on [the best Fish Shell plugins and tools](/best-fish-shell-plugins/) if you want recommendations.

## Set up your prompt

Fish comes with a decent default prompt, but you have several options for customizing it:

**Option 1: Built-in themes.** Run `fish_config` and a browser window opens where you can pick from several built-in prompt styles and color schemes.

**Option 2: Tide.** This is a popular Fish-native prompt with a configuration wizard. Install it via Fisher:

```fish
fisher install IlanCosman/tide@v6
```

Then run `tide configure` to walk through the setup.

**Option 3: Starship.** A cross-shell prompt written in Rust that works with Fish, Zsh, Bash, and others. I have a dedicated guide on [setting up Starship with Fish Shell](/fish-shell-starship-prompt/). If you've used Starship with Zsh before (like in my [Starship and Ghostty setup guide](/starship-ghostty-terminal/)), the Fish setup is almost identical. For a full comparison of all Fish prompt options, see my [Fish Shell themes and prompts guide](/fish-shell-themes-prompts/).

## Useful things to know right away

**Command history search.** Press `Ctrl+R` to search your history. Fish uses glob syntax by default, so `git*commit` matches any history entry containing "git" followed later by "commit". I cover history management in depth in my [Fish Shell history and persistence guide](/fish-shell-history-persistence/).

**Autosuggestions.** As you type, Fish shows grayed-out suggestions based on your history and available completions. Press the right arrow key to accept, or `Alt+Right` to accept one word at a time.

**Tab completions.** Fish generates completions from man pages automatically. Try typing `git checkout` and pressing tab. You'll see branch names, flags, and more without installing anything extra.

**Web configuration.** Run `fish_config` to open a browser-based tool for changing your colors, prompt, and viewing defined functions. It's genuinely useful for exploring what's available.

## Common issues

<Accordion label="Fish doesn't appear in /etc/shells" group="issues" expanded="true">
If `chsh` complains, you may need to add Fish to the allowed shells manually:

```bash
echo /usr/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/bin/fish
```
</Accordion>

<Accordion label="Bash scripts don't work in Fish" group="issues">
That's expected. Fish has its own syntax. Run Bash scripts with `bash script.sh` or add `#!/bin/bash` at the top and make them executable. Your existing scripts don't need to change, just run them explicitly with Bash.
</Accordion>

<Accordion label="Environment variables from .bashrc are missing" group="issues">
Fish doesn't read `.bashrc` or `.bash_profile`. You need to set your environment variables in `~/.config/fish/config.fish` using `set -gx`:

```fish
set -gx JAVA_HOME /usr/lib/jvm/java-21
set -gx GOPATH ~/go
fish_add_path $GOPATH/bin
```
</Accordion>

## Where to go from here

- [Fish Shell vs Bash vs Zsh](/fish-shell-vs-bash-vs-zsh/) - see how Fish compares to the other popular shells
- [Fish Shell vs Zsh](/fish-shell-vs-zsh/) - a focused comparison if you're choosing between these two
- [Best Fish Shell plugins and tools](/best-fish-shell-plugins/) - Fisher, Tide, fzf.fish, and more
- [Fish Shell abbreviations vs aliases](/fish-shell-abbreviations-vs-aliases/) - why abbreviations are usually the better choice
- [Set up Starship prompt with Fish Shell](/fish-shell-starship-prompt/) - cross-shell prompt that looks great
- [Fish Shell autocomplete and suggestions](/fish-shell-autocomplete-suggestions/) - get the most out of Fish's completion system
- [Fish Shell syntax highlighting](/fish-shell-syntax-highlighting/) - understand how Fish highlights your commands
- [Fish Shell functions and custom commands](/fish-shell-functions-custom-commands/) - write your own Fish functions
- [Fish Shell history and persistence](/fish-shell-history-persistence/) - manage and customize your command history
- [Fish Shell themes and prompts](/fish-shell-themes-prompts/) - compare Tide, Starship, Pure, and Hydro
- [NVM with Fish Shell](/nvm-fish-shell/) - manage Node.js versions in Fish
- [Oh My Fish guide](/oh-my-fish-install-themes-plugins/) - alternative plugin framework for Fish
- [Fish Shell macOS setup](/fish-shell-macos-setup/) - install and configure Fish on Mac
- [Zoxide: smarter terminal navigation](/zoxide/) - works great with Fish too