Updated: 4 November 2026 · Applies to: Ubuntu 24.04 (fish 3.7.0) and Ubuntu 26.04 (fish 4.2.1), fish 4.9.3 from the fish PPA; notes for Debian 13 and AlmaLinux and Rocky Linux

To install the fish shell on Ubuntu, run sudo apt install fish, start it by typing fish, and make it your default shell with chsh -s /usr/bin/fish. Ubuntu 24.04 installs fish 3.7.0 and Ubuntu 26.04 installs fish 4.2.1. For the newest release (4.9.3 at the time of writing), add the fish project's PPA first.

fish (the friendly interactive shell) is an alternative to bash for working at the command line. It suggests commands from your history as you type, colours commands as valid or invalid, and completes commands, options and file names with Tab, with almost no setup. We ran every command below in Ubuntu 24.04.5 and 26.04.1 test containers.

1. Install fish from the Ubuntu repositories

sudo apt update
sudo apt install fish
fish --version

Ubuntu 24.04 prints fish, version 3.7.0 and Ubuntu 26.04 prints fish, version 4.2.1. The package also adds /usr/bin/fish to /etc/shells, so it can be used as a login shell straight away.

2. Optional: the latest fish from the official PPA

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

The fish website points Ubuntu users to this PPA (~fish-shell/release-4), which has builds for Ubuntu 24.04 and 26.04. add-apt-repository refreshes the package lists itself; on a minimal install, get it first with sudo apt install software-properties-common. In our Ubuntu 24.04 test this upgraded fish from 3.7.0 to 4.9.3:

$ fish --version
fish, version 4.9.3

fish 4 moved the shell's core from C++ to Rust; according to the fish 4.0 release notes, this has no direct impact on users.

3. Try fish before you switch

  1. Type fish in your current terminal or SSH session.
  2. Start typing a command you used before. A grey suggestion appears after the cursor; press the right arrow key or Ctrl+F to accept all of it, or Alt+Right to accept one word.
  3. Press Tab to complete commands, file names and options.
  4. Type exit to go back to bash.

4. Make fish your default shell

chsh -s /usr/bin/fish

Enter your password, then log out and back in (or open a new SSH session). To change it for another user, run sudo chsh -s /usr/bin/fish USERNAME. Check the result with getent passwd USERNAME; the last field is the login shell. In our test:

root:x:0:0:root:/root:/usr/bin/fish

To switch back, run chsh -s /bin/bash. More options are in how to change the default shell in Linux and Ubuntu.

On servers, keep bash as the shell of root and of service accounts, and use fish in your own user account. The fish documentation warns that fish as a login shell can cause problems such as an incorrect PATH, because fish does not read /etc/profile, ~/.profile or ~/.bashrc.

5. What works differently from bash

  • Variables: set NAME value sets a variable and set -gx EDITOR nano exports it. export EDITOR=nano and NAME=value command also work in the versions we tested.
  • PATH: fish_add_path ~/.local/bin adds a folder for good (it is saved in the variable fish_user_paths). The folder must exist: in our test, fish ignored a path that did not exist yet, which matches the fish documentation.
  • Command substitution: (command) and $(command) both work; && and || work as in bash.
  • Loops and conditions use their own syntax and end with end, so bash syntax fails:
    $ for i in 1 2; do echo $i; done
    fish: Missing end to balance this for loop
    for i in 1 2; do echo $i; done
    ^~^
    In fish, the same loop is for i in 1 2; echo $i; end.
  • Aliases: use functions or abbreviations. abbr -a gs git status turns gs into git status when you press Space or Enter. A function is saved with funcsave:
    function ll
        ls -lh $argv
    end
    funcsave ll
    fish replied funcsave: wrote /root/.config/fish/functions/ll.fish.
  • Scripts: fish cannot run bash scripts. Keep #!/bin/bash as the first line of your scripts and they run in bash even when you start them from fish; bash script.sh works too.

6. Configure fish

  • Startup settings go in ~/.config/fish/config.fish. The Ubuntu package does not create it, so create it yourself. Put settings that only make sense when you type commands inside if status --is-interactive ... end, as the fish documentation recommends.
  • Variables set with set -U (universal) are stored in ~/.config/fish/fish_variables and apply to every fish session. Do not edit that file by hand.
  • Turn off the welcome message with set -U fish_greeting "".
  • Prompt and colours: on a desktop, fish_config starts a local web page in your browser. Over SSH, use fish_config prompt list, try one with fish_config prompt choose arrow and keep it with fish_config prompt save (confirm when asked). fish_config theme list lists the colour themes.

Remove fish

  1. Switch every user who uses fish back to bash first: chsh -s /bin/bash.
  2. Remove the package: sudo apt remove fish.
  3. If you added the PPA, remove it: sudo add-apt-repository --remove ppa:fish-shell/release-4.

Other distributions

  • Debian 13: sudo apt install fish installs fish 4.0.2.
  • AlmaLinux and Rocky Linux: fish comes from EPEL. Run sudo dnf install epel-release, then sudo dnf install fish (fish 4.2.0 for version 10, 3.7.1 for version 9).

Common problems

  • Commands or PATH entries are missing after switching: fish does not read your bash files. Move export lines from ~/.bashrc or ~/.profile to config.fish as set -gx, and folders to fish_add_path.
  • A copied command fails with a syntax error: it uses bash syntax. Run it with bash -c '...' or type bash to open a bash session for it.
  • The version is older than the fish website shows: Ubuntu keeps the version that came with each release. Use the PPA from step 2 for the latest.

Need an Ubuntu server for your own tools? Our KVM VPS plans come with full root access, so you can set up fish or any other shell for your user.

Official documentation: the fish documentation at fishshell.com (installation, configuration and fish_config).

Was this answer helpful?

Still stuck? Open a ticket