Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On an existing FreeBSD system, install Bash with pkg install bash. This adds Bash but does not change your login shell; to make it your shell, run chsh -s /usr/local/bin/bash separately. Keep root’s default shell unchanged, as FreeBSD recommends.

Install Bash with pkg

Bash is not included in the default FreeBSD installation, but FreeBSD makes it available through Packages and Ports, as documented in the FreeBSD Quickstart Guide for Linux Users.

  1. Open a terminal and become root or use an account with administrative privileges.

  2. Run pkg install bash.

  3. Review the package actions and confirm the installation when prompted.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If FreeBSD says the package-management tool is not installed and asks to bootstrap it, confirm the prompt. The bootstrap downloads and installs pkg, then continues with the requested installation; an internet connection is required. See the FreeBSD Handbook’s package-management guidance.

Set Bash as your login shell (optional)

Installing Bash does not select it as your login shell. If you want Bash to start when you log in as your regular user, run:

Rank #2
chsh -s /usr/local/bin/bash

Enter your account password if prompted, then log out and back in for the change to take effect. The shell path must be listed in /etc/shells for chsh to accept it. The Handbook says shells installed from Ports should be added automatically; if the entry is missing, add /usr/local/bin/bash to /etc/shells and try again. See the Quickstart Guide’s shell-change instructions.

Why you should leave root’s shell alone

FreeBSD recommends keeping root’s default shell. Bash is installed under /usr/local/bin, outside the base system. If the filesystem containing that path is unavailable during a problem, root may be unable to log in to repair the system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The default root shell varies by release: the Quickstart Guide records tcsh for FreeBSD 13 and earlier, and sh for FreeBSD 14 and later. Check your installed release rather than assuming one default applies to every FreeBSD system. The guide describes sh as POSIX-compatible and similar to Bash, though with fewer features.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to use Ports instead of pkg

pkg installs a prebuilt binary package, which is the straightforward choice when the available Bash package meets your needs. Use the Ports collection when you need to build from source or customize build options. The FreeBSD Handbook explains the distinction between package and Ports workflows.

Quick Recap

SaleBestseller No. 2
The Complete FreeBSD: Documentation from the Source
The Complete FreeBSD: Documentation from the Source
Used Book in Good Condition
$19.60
SaleBestseller No. 3
SaleBestseller No. 4

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.