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
- Type
fishin your current terminal or SSH session. - Start typing a command you used before. A grey suggestion appears after the cursor; press the right arrow key or
Ctrl+Fto accept all of it, orAlt+Rightto accept one word. - Press
Tabto complete commands, file names and options. - Type
exitto 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 valuesets a variable andset -gx EDITOR nanoexports it.export EDITOR=nanoandNAME=value commandalso work in the versions we tested. - PATH:
fish_add_path ~/.local/binadds a folder for good (it is saved in the variablefish_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 isfor i in 1 2; echo $i; end. - Aliases: use functions or abbreviations.
abbr -a gs git statusturnsgsintogit statuswhen you press Space or Enter. A function is saved withfuncsave:function ll ls -lh $argv end funcsave llfish repliedfuncsave: wrote /root/.config/fish/functions/ll.fish. - Scripts: fish cannot run bash scripts. Keep
#!/bin/bashas the first line of your scripts and they run in bash even when you start them from fish;bash script.shworks 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 insideif status --is-interactive...end, as the fish documentation recommends. - Variables set with
set -U(universal) are stored in~/.config/fish/fish_variablesand 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_configstarts a local web page in your browser. Over SSH, usefish_config prompt list, try one withfish_config prompt choose arrowand keep it withfish_config prompt save(confirm when asked).fish_config theme listlists the colour themes.
Remove fish
- Switch every user who uses fish back to bash first:
chsh -s /bin/bash. - Remove the package:
sudo apt remove fish. - If you added the PPA, remove it:
sudo add-apt-repository --remove ppa:fish-shell/release-4.
Other distributions
- Debian 13:
sudo apt install fishinstalls fish 4.0.2. - AlmaLinux and Rocky Linux: fish comes from EPEL. Run
sudo dnf install epel-release, thensudo 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
exportlines from~/.bashrcor~/.profiletoconfig.fishasset -gx, and folders tofish_add_path. - A copied command fails with a syntax error: it uses bash syntax. Run it with
bash -c '...'or typebashto 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).