FreeBSD Home Server - Part 1: OS Install
FreeBSD Home Server - Part 1: OS Install
This is part 1 of my FreeBSD Home Server how-to guide, and it will cover the installation of FreeBSD. It will show how to install FreeBSD 15.1-RELEASE, configure it, and how to set up Jails, Samba and NFS for network file sharing, as well as Bhyve virual machines. Follow the instructions at your own risk. I am still learning, so mistakes will be made. If you have suggestions for improvements or want to give feedback, you can find my information here: www.subnetspider.com/about
Download the FreeBSD Installer
Go to the FreeBSD website and download the Installer:
- https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/15.1/
You can also download the .iso via torrent, if you want to.
I chose the file FreeBSD-15.1-RELEASE-amd64-bootonly.iso.xz because it contains all the stuff I need.
All FreeBSD .iso files are usually compatible with booting from USB. To save a bit of bandwidth, I always download the compressed .xz archives.
Before you extract the .xz archive, verify that the checksum matches, by downloading the CHECKSUM file.
Open CHECKSUM.SHA256-FreeBSD-15.1-RELEASE-amd64 with a text editor (or cat/grep the contents) and look for the line which contains your downloaded filename.
Verify the checksum
Important: The file hashes for the .xz files will only match the compressed archives.
If you are on Linux or FreeBSD, use the sha256sum command:
~$ sha256sum Downloads/FreeBSD-15.1-RELEASE-amd64-bootonly.iso.xz
807b31dc257f8c1b3979cb48f875bc9e198f615ea1dbf5a5ab3a0fefc2115d5f Downloads/FreeBSD-15.1-RELEASE-amd64-bootonly.iso.xz
If you are on Windows, open PowerShell and use the Get-FileHash command:
> Get-FileHash .\Downloads\FreeBSD-15.1-RELEASE-amd64-bootonly.iso.xz
Algorithm Hash Path
--------- ---- ----
SHA256 807B31DC257F8C1B3979CB48F875BC9E198F615EA1DBF5A5AB3A0FEFC2115D5F C:\Users\Admin\Downloads\Free...
If the checksum matches the hash, you are good to go. Should they not match, the file might be corrupted or manipulated, so you better delete it and start over.
Extract the .xz archive
If you are on Linux or FreeBSD, extract the .xz archive with the unxz command:
~$ unxz Downloads/FreeBSD-15.1-RELEASE-amd64-bootonly.iso.xz
If you are on Windows, you can right click on the file and extract it like you would a .zip file.
Prepare the installation media
You can install FreeBSD by flashing it to a USB stick, burning it to a DVD or using PXE network boot. If your host supports it, you can also use the IPMI/BMC to attach the .iso file remotely.
But if your system does have an IPMI / BMC, you can use dd on Linux or FreeBSD to flash it to your USB stick:
~$ doas dd if=Downloads/FreeBSD-15.1-RELEASE-amd64-bootonly.iso of=/dev/sdbX bs=1M conv=sync status=progress
Warning: Make sure you select the correct device (e.g. /dev/sdb) or you will encur data loss. Only flash the .iso file onto a USB stick if you have backed up all the files on it first.
If you are on Windows, you can use either BalenaEtcher or Rufus to create a bootable USB stick.
Install FreeBSD
Because the Lenovo ST250 supports it, I chose to use the XCC (XClarity Controller IPMI / BMC) of the server.
Login
Launch Remote Console
Media
Activate
Browse and Mount
Now the .iso file of the FreeBSD Installer is mounted on the remove system and it can be rebooted.
Press F12
Select XCC Virtual Media
Install
Select you Keymap
Select the fitting keymap for your physical keyboards language layout.
Set Hostname
Select Installation Type
I chose
Packagesfor pkgbase, as this will be the default for FreeBSD 16 and later releases.
Network Configuration
For now, I will only configure IPv4 networking.
Partitioning
Pool Type/Disks
Select Virtual Device Type
I select ZFS RAID10 for the best speed with some redundancy. As this server only has SSDs, I will install FreeBSD on them. On most servers, I have two small dedicated SSDs for FreeBSD and two or more large HDDs for mass storage.
Select Disks
Proceed with Installation
YES
All data on the selected disks will be destroyed.
Select System Components
I only select
base, because I don’t needkernel-debugorlib32. After pressing “OK”, the FreeBSD installer will download allFreeBSD-*base system packages over the Internet.
Boot Configuration
There once was another FreeBSD version installed on the SSDs, otherwise, you will not see this screen. Press “YES”.
Set root password
Set a strong password for your root user. Save it in your password manager so you don’t forget.
Select your Timezone
Time & Date
We can skip both, because we will enable NTP later.
System configuration
I selected
sshd,ntpd,ntpd_sync_on_start, andpowerd. Note that on system with modern CPUs,powerdmight not be needed, as the CPU’s automatically reduce the clock speed when idle.
System Hardening
I always enable all available hardening options.
Add User Accounts
Add a non-root user account for SSH login over the network.
Final Configuration
Select “Finish > No > Reboot” to finish the installation and reboot the system.
You can now remove your USB stick, DVD, or unmount the .ISO in your IPMI / BMC.
Conclusion
The installation of FreeBSD is now complete. As soon as the system has booted, you are now able to use SSH to log in and configure the system.