How to Install FreeBSD 14 Step-by-Step (With Screenshot)

The new FreeBSD 14.0 has been released, let’s now install it. In this guide, I will show you step-by-step how to install FreeBSD 14.

If you want to know what changes in FreeBSD 14, check some notable changes below:

  • OpenSSH updated to new version 9.5p1.
  • Major update of OpenSSL to version 3.0.12.
  • The new bhyve hypervisor now supports TPM (Trusted Platform Module) and GPU Passthrough.
  • ZFS with OpenZFS has been upgraded to version 2.2, which produces significant improvement in performance.
  • CUBIC has become the default congestion control algorithm for TCP protocol.

In addition, there are also some merged features from FreeBSD 13.1 and 13.2, including:

  • Bhyve hypervisor supports 16 vCPUs on guest via the vmm kernel module.
  • FIDO/U2F hardware authenticators support for SSH.
  • Added new daemons rpc.tlsclntd and rpc.tlsservd that support NFS-over-TLS.
  • KTLS (Kernel TLS implementation) now supports TLS 1.3.
  • Reintegrated Wireguard driver with small bug fixes and API changes.

Check out the FreeBSD release note to get details information.

Prerequisites

Before you begin, below the bare minimum system that you must have – bare-metal or virtual machine:

  • 64-bit system architecture.
  • 2 vCPUs.
  • 25 GB of disk space.
  • 2 or 4 GB of memory/RAM.

Step 1 – Downloading FreeBSD ISO Installer

Download the FreeBSD 14 ISO installer (CD or DVD version) and create a new bootable media. Then, boot it up.

If you want to install it on a live machine (bare-metal/computer/laptop), create a USB Bootable. For virtualization such as VirtualBox, KVM/QEMU, and Proxmox, create an Optical Drive and insert the FreeBSD ISO file as bootable media.

Step 2 – Booting to FreeBSD Installer

On the FreeBSD boot menu, press ENTER to start the installer.

Boot up to FreeBSD installer
Boot up to FreeBSD installer

Step 3 – Welcome to bsdinstall

Now you will see the welcome message from the bsdinstall – The FreeBSD installer.

Select Install to start the installation.

Welcome message from bsdinstall
Welcome message from bsdinstall

Note: Use TAB to move between menus on the bsdinstall.

Step 4 – Select Default Keymap (Keyboard Map)

Choose the keymap or keyboard layout for your new FreeBSD system. The default keymap for FreeBSD is the standard US, which is the most popular and safe choice.

Move the menu to Continue with default keymap, then press ENTER on the Select menu.

Choosing the default keyboard layout or keymap
Choosing the default keyboard layout or keymap

Step 5 – Setting Up Hostname and FQDN

Input your hostname or FQDN (Fully Qualified Domain Name), such as geekandnix.domain.lan, then select OK.

Setting up hostname or fqdn
Setting up hostname or fqdn

Step 6 – Adding Components to FreeBSD

Choose additional components that you want to install (alongside the FreeBSD base system). The following example will include ports to the installation.

On FreeBSD, ports is where you can install and compile applications manually. This is useful, whether you want to strip/remove unused feature from application to boost performance, or enable specific feature.

Select ports option and OK.

Adding ports collections to FreeBSD
Adding ports collections to FreeBSD

Note: Use the SPACE button to select the option, then move with the UP/DOWN keys.

Step 7 – Partitioning Methods for FreeBSD

Now time to create a disk partition for FreeBSD. By default, the bsdinstall provides 4 methods to partition disks:

  • Auto ZFS: automated and guided with ZFS.
  • Auto UFS: automated guided with UFS Disk setup.
  • Manual: partition disk manually via an interactive interface.
  • Shell: configuring disk partition via command line

In this example, we’ll be using the Manual partition method. So, choose Manual and select OK.

Manually partitioning disk for FreeBSD installation
Manually partitioning disk for FreeBSD installation

Creating Partition Scheme

Choose your disk and select Create. Then, choose the partition schema to GPT (GUID Partition Table) and OK.

As you can see in the following, we’ll be using disk ada0 with size 25GB.

Creating GPT partition schema
Creating GPT partition schema

Preparing Disk Layout for FreeBSD Installation

Before you start partitioning, below are some disk layouts that you MUST create to install FreeBSD:

  • boot: partition for FreeBSD boot files. The type must be freebsd-boot with the size between 64KB-512KB.
  • root: the root or / partition for FreeBSD with the type as freebsd-root and mountpoint to /.
  • SWAP: optional partition in addition to memory/RAM.

Note: In addition to those top 3 partitions, you can use a specific partition for the /usr and /var directories. For example, you may create a partition for /usr/home that will be used as users’ home directories, or /var/tmp for storing temporary files.

Adding Boot Partition

Choose your disk (ada0) and select Create. Then, input details of boot partition below:

  • Type: freebsd-boot
  • Size: 512k
  • Mountpoint: Leave it blank
  • Label: boot

Select OK to confirm.

Creating boot partition
Creating boot partition

Adding Root Partition

For the root partition, use the following settings:

  • Type: freebsd-ufs
  • Size: 23GB (Adjust the size with your disk size)
  • Mountpoint: /
  • Label: root
Creating root partition
Creating root partition

Adding SWAP Partition

Lastly, for the SWAP partition, use the following details:

  • Type: freebsd-swap
  • Size: 2047MB (Adjust the size as you need)
  • Mountpoint: Leave it blank
  • Label: swap
Creating SWAP partition
Creating SWAP partition

Format Disk with New Partition Layout

Double-check your partition layout and select Finish when you’re done.

Finishing partition layouts
Finishing partition layouts

Then, select Commit to confirm and format your disk with the new partition layout.

Formatting disk with the new layouts
Formatting disk with the new layouts

Step 8 – Started: Installation of FreeBSD Base System

Now the FreeBSD installation should be started.

Installing FreeBSD 14
Installing FreeBSD 14

Step 9 – Setting Up root Password

Once the installation is finished, you will be prompted to create the FreeBSD root password. Input the new root password for FreeBSD and repeat.

Setting up root password
Setting up root password

Step 10 – Setting up Networking

To set up networking, choose your network interface and select OK. In this case, the interface em0 is automatically detected by the bsdinstall.

Setting up networking
Setting up networking

Select Yes when asked to set up IPv4.

Setting up IPv4 network interface
Setting up IPv4 network interface

Select Yes to set up an IP address via DHCP. In this case, we’ll be using DHCP to automatically set up an IP address for the FreeBSD.

Setting up IPv4 via DHCP
Setting up IPv4 via DHCP

For the IPv6 configuration, select No. In this case, we’ll disable IPv6.

Disable IPv6
Disable IPv6

Lastly, input your local domain name and the default DNS resolver, then select OK to continue. In this case, we’ll be using DNS resolver from Cloudflare (1.1.1.1) and Google (8.8.8.8).

Setting up DNS resolver
Setting up DNS resolver

Step 11 – Setting up Time zone

After setting up networking, let’s configure the default region and time zone. Be sure to select the time zone nearest your location.

First, choose your region and select OK.

Select default region
Select default region

Choose the time zone nearest your location, then OK.

Choosing nearest time zone
Choosing nearest time zone

Now select Yes to confirm the time zone configuration.

Confirm time zone configuration
Confirm time zone configuration

Step 12 – Setting Up Date and Time

To set up a date, adjust the date, month, and year, then select Set Date.

Setting up date
Setting up date

After that, adjust the time with your local time and select Set Time.

Setting up time
Setting up time

Step 13 – Adding Services to Run at Boot

In this stage, select the desired services that will start at boot using the SPACE button. In this case, we’ll enable sshd and ntpd services, then select OK to confirm.

Adding FreeBSD services to start at boot
Adding FreeBSD services to start at boot

Step 14 – Securing FreeBSD via System Hardening

For the System Hardening section, choose the option as you need and select OK. In this case, we’ll enable system hardening via hid_uids and hide_gids to hide processes from different users and groups.

System hardening on FreeBSD
System hardening on FreeBSD

Step 15 – Adding New User

Select Yes when asked to create a new user.

Adding new user
Adding new user

Input details of your user like this:

  • Username: arvidl (adjust the Username with your user).
  • Full Name: ArvidL (adjust the Full Name).
  • Login group, shell, home directory, and permission: Leave it blank to use as default.
  • Use password-based authentication: yes.
  • Use an empty and random password: no.
  • Enter a new password for your user and repeat.
  • Input yes to confirm.
  • Input no when asked to create another user.
Creating user on FreeBSD via interactive
Creating user on FreeBSD via interactive

Step 16 – Complete the FreeBSD Installation and Reboot

Now that you’ve created a new user, you will be shown the Final Configuration of the FreeBSD installation.

Choose Exit to apply your configuration to FreeBSD and exit the bsdinstall, then select OK to confirm.

FreeBSD installation is finished
FreeBSD installation is finished

Select No when asked about the Manual Configuration via shell.

FreeBSD Manual configuration? No
Manual configuration? No

At the final stage, you will see the confirmation Installation of FreeBSD complete!. Select Reboot to restart your machine and boot up to the FreeBSD system.

FreeBSD installation finished - Reboot
FreeBSD installation finished – Reboot

Step 17 – Logging Into FreeBSD

Once you’ve rebooted to your FreeBSD installed, log in with your root user and password.

If you have the correct username and password, you will be logged in to FreeBSD and you will see the default motd from FreeBSD.

Logging in to FreeBSD 14
Logging in to FreeBSD 14

Step 18 – Updating FreeBSD Base System

The first thing to do after you’ve installed FreeBSD is to check for any update for the FreeBSD base system, then install the update when available.

Execute the freebsd-update command below to download and install updates for your FreeBSD base system.

freebsd-update fetch
freebsd-update install
Installing and applying system patches via freebsd-update
Installing and applying system patches via freebsd-update

Step 20 – Installing pkg Package Management Tool

After you’ve installed updates of the FreeBSD base system, run the following command to install the pkg package manager, update the package index, and then upgrade packages to the latest version.

pkg update
pkg upgrade

At first, you will be asked to install the pkg package manager. Input y to proceed and install the pkg on your FreeBSD system.

Installing pkg package index on FreeBSD
Installing pkg package index on FreeBSD

Once the process is finished, you’ve now completed the FreeBSD 14 installation.

Conclusion

You’ve now finished the FreeBSD 14 installation on your machine. From here, go further to the next level with the following:

System administrator and devops enthusiast, leveraging over 10+ years of Linux expertise to optimize operations. Proficient in FreeBSD, VMWare, KVM, Proxmox, PfSense, Ansible, Docker, and Kubernetes.

Leave a Reply

Your email address will not be published. Required fields are marked *

Read Also: