Note
This is mainly a note sheet for myself so I know what to do when installing FreeBSD, but I also wrote some additional information for Linux users that are interested in using FreeBSD and the philosophy as to why one would use FreeBSD over a convential Linux system. This is not complete, has parts borrowed from guides on the Internet (I do not claim originality for any of this), but should be enough to get started with FreeBSD.
BSD (Berkeley Software Distribution) is a discontinued operating system that is a direct descendant of Bell Labs UNIX. Unlike GNU/Linux, which is a remake of UNIX and therefore called a "UNIX-like" system, mainline *BSD systems such as FreeBSD, OpenBSD, and NetBSD can claim to be truly genetic "UNIX" (but not trademark UNIX). For brevity, I will just say "BSD" for the rest of this guide, but I will be referring to FreeBSD specifically.
In terms of the popularity of its distributions, the GNU/Linux distribution most used by the customer market is Android, and the *BSD distribution most used by the customer market is iOS/macOS (as they are based on Darwin).
Note
This is not to state that BSD is better than Linux. Both operating systems are very good and if you work best with one, stick to it. This is just an exploratory on maybe why someone (like me) would prefer BSD to Linux within a desktop context.
This may sound like a strange statement, but it is true. Most users do not "use" their operating system, as in they do not use the controls and interfaces of their operating system beyond what's necessary to launch things. Instead, the majority of their time is spent in software, and the majority of the software used is in fact just their Internet browser. There's only a handful of times where the user goes to use their operating system - when they print a paper, for example. Even things that feel like you are "using" the operating system is actually just using software, like when you access the filesystem (which is done through a file explorer and not the operating system itself) or formatting a drive (which is always done through a software utility or two, GParted anyone?). Installing software through a package manager? You are using the package manager software, not the operating system.
If you come to the realization that most of your time on the computer has been spent using software, and not using the operating system, then you realize that the operating system you are using doesn't actually always really matter as long it provides what's necessary for you to run your favorite software. If all that you run is LibreOffice, a web browser, some mail client, and VLC for music, and that's literally all that you need out of a computer, then you will have the same daily experience regardless of whether you use Windows, macOS, Linux, or BSD, because they can run all of these software (most likely).
And if you come to the realization that your set of software can run on most operating systems, then it is obvious that the best operating system in your case must be the one that 1) is as minimal as possible (in terms of resource consumption), 2) gets out of your way as much as possible, and 3) runs all of the software you want. Why use a system that consumes more resources and is more intrusive if a more minimal one can already do 100% of what you need? Just pick the least invasive, most optimized option and use it forever until your needs change.
Most Linux users have came to this realization after using a hundred or so distributions. At first, switching from distro to distro feels reasonable because you want to try new things. Then at some point, you realize that all of these distributions package more or less the same Linux kernel and GNU utilities, and the only things which really change are the pre-packaged software, the installer, and the package manager. At some point, you realize that all of these systems can more or less run the same software. At some point, you realize that the only thing you really need is the most minimal Linux possible, because even the most minimal Linux can run, well, software that runs on Linux.
So in the end, you end up choosing the least invasive, most optimized distribution of Linux (usually Void or Arch, but some will avoid Arch due to systemd
bloat and a needlessly complicated installation process), then add the software that you actually need: some kind of desktop environment, the drivers for your computer, an Internet browser, some kind of multimedia player, and development toolchains if you're a programmer. Then you realize distros like Ubuntu and Fedora are so stupidly bloated. They're great for beginners, but if you understand how a computer works, they are so relatively bloated (much less than Windows, however!).
But switching to BSD takes it a step further. If you realize that the OS doesn't matter as long it runs your software and does what you need to do, then you also need to extend this beyond just the confines of Linux. Windows to Linux is one thing, but then what's next? There doesn't need to be a next if Linux is sufficient for your needs, but maybe you want to ultra-optimize your computing experience. This is where BSD comes in.
Note
Most users only use software, but there are circumstances where the user will actually use the operating system. Sometimes, there is a peripheral or some piece of hardware that only works with a given OS. Sometimes, an OS-specific feature is core to your needs (e.g., Windows with its Microsoft 365 integrations). Or there will be software that you need for your job or your hobby and it doesn't have a port to Linux/BSD. You don't have to be ashamed if you use a more bloated, more intrusive OS if that's what you need.
The most commonly cited aspect of BSD systems is their security. Most default installations come with sane defaults that already ensure a high degree of security, and if you need additional protection, FreeBSD's very unique jails can be used to create many potentially virtualized mini-systems with very little overhead. A positive side-effect of BSD's commitment to security is OpenBSD's well known and widely used OpenSSH utility, which is practically the golden standard of secure SSH.
However, BSD systems are more than just "secure-by-default" operating systems. While that alone is worthy of praise, I sometimes feel that people forget they have other features. After all, BSDs are operating systems, and being an operating system means you offer more than just "security". If people only wanted "security" and didn't care for the rest of the OS, they'd run all of their software in a virtualized container somewhere in the so called cloud that would stream down an interface for access.
Linux itself only ships a kernel and a few drivers. There are many reasons why the libre people out there are very pedantic about the "GNU/Linux" naming, but at least it is accurate: Linux doesn't ship a complete operating system. Linux only becomes "complete" when you package it with userland utilities, mostly (but not exclusively) those from GNU. Most non-technical users must use an increasingly more bloated distribution of Linux in order to even gain some degree of usability.
FreeBSD delivers a kernel, drivers, utilities, and documentation. It already comes with everything that you need for a productive UNIX environment, and it does it without bloating the living crap out of your system, which takes some skill to accomplish. Ever heard of the "My audio breaks!" memes that makes fun of Linux's regularly painful audio support? I cannot say it exists in FreeBSD, because surprisingly enough, my audio works out of the box. And my microphone. And my webcam. And even my bluetooth adapter, which is even more surprising.
If you opt into the ports
tree at install time, it even comes with a compiler so you can immediately start developing software (if that's what you want).
Linux is already much more performant than a lot of commercial operating systems out there, and some distributions can achieve a surprising degree of resource minimalism. FreeBSD, however, takes it a step further.
Experiences may vary, but FreeBSD is more snappy than Linux or Windows ever was. I am a fan of Void Linux, which is known for being quite small, but even Void Linux cannot compete with the performance I can squeeze out of FreeBSD. Filesystem operations are faster, general software usage (like using a browser) is noticeably snappier, and I haven't noticed a single bit of lag or visually noticeable stuttering in any FreeBSD install I did regardless of the configuration.
FreeBSD can also be as performant as you want it to be. If you want to trade speed for resource usage, then you can definitely come up with an installation that consumes extremely little RAM while sacrifying a bit of speed. If you want to trade resource usage for speed, you can definitely come up with an installation that consumes more RAM for caching but will be the fastest operating system you have ever used in your life. Or you can do a balance of both and have a very fast operating system that consumes a small amount of memory.
When installing Linux from a popular distro, you usually have the typical selection of filesystems to choose from: Btrfs
, XFS
, ext2
, ext3
, ext4
, and maybe some kind of FAT
variant (especially on older systems). These are quite good filesystems, I have nothing to reproach...
...except that they rarely (if ever) offer ZFS
, or UFS
. They are incredible filesystems with their own unique advantages (I'd seriously consider checking out ZFS
!) and they are not always supported (by default) as whole-system FS on Linux. To achieve Root-on-ZFS on Linux, you need to follow needlessly complicated guides (1, 2) and even then, some operating systems like Ubuntu are getting rid of ZFS for some reason.
On FreeBSD, ZFS is literally the default choice, alongside UFS which is another great filesystem (but that I haven't used much). You press enter twice and your entire system will be configured to use ZFS out of the box.
"BTW I use Arch" soon to be replaced with "BTW I use FreeBSD". It is widely known that using a less popular operating system increases your Internet brownie points by 10.
If you are a completely non-technical Linux user and you only have minimal experience with using the commandline (e.g., you only use it to install packages) then you shouldn't even bother with BSD. While your usage of the commandline with BSD will be more or less the same as with a Linux system post-configuration, you definitely need to delve more into manual system configuration in FreeBSD than you have to with Linux (depending on distro, obviously). If you are scared of anything more than managing packages within the terminal, then you need to get comfortable with it. If you don't know vi
, you will be lost.
Also, BSD is not a gaming platform, whereas Linux is increasingly becoming one thanks to Valve's investments. It is not impossible to game on FreeBSD, especially since graphical drivers are usually available for it (including Nvidia drivers, which is honestly impressive since we usually assume that Nvidia does not give a damn about non-Windows OS). While Wine does work on FreeBSD, experiences may vary. Just don't come into BSD thinking you will be able to game.
Note
This is just for reference after you have installed FreeBSD. It's also a reference for myself, which I will update periodically.
- Packages can be installed with
pkg install <package>
. - Fonts can be installed into
~/.fonts
. Folder has to be created. - If your DE doesn't start, it's usually because
dbus
orhald
isn't set in your sysrc, or because GPU configuration (the.conf
file in X11 folders) isn't setup.
Note
Final warning: I am assuming that you know a thing or two about UNIX-like systems in this guide, including how to boot into an ISO file. This is a guide for less-technical Linux users, but not non-technical Linux users.
You can download an image of FreeBSD from here. After selecting your architecture, you will be given a list of multiple image files.
- If you know you will have an Internet connection during installation (i.e., you are using ethernet), choose the
bootonly
ISO. It will automatically retrieve the latest packages from repositories during the installation process so you will have a fully updated system right away. - If you don't know you will have an Internet connection during installation (i.e., you are not confident in your Wi-Fi adapter chipset support), choose the
dvd1
ISO. If your Internet hardware isn't supported during installation, it will use the packages on disk to deploy a FreeBSD install to your system.
I recommend using Ventoy and dropping the ISO file into the partition it creates, alongside an ISO file for your previous OS in case FreeBSD is just too much for you. If you haven't heard of Ventoy yet, prepare yourself for one of the best discoveries of your life if you are a serial OS reinstaller like me.
Reboot into the USB drive to launch FreeBSD. I'm assuming you already know how to do this (as per the warning above). You will see this screen:
Simply press 1. You won't have to log into anything, it should automatically launch bsdinstall
by itself.
On the first screen that pops up, choose Install
. It will ask you to choose a keymap (keyboard layout), just pick the one you want (US
is good for now), and then input your machine name. I generally put desktop
as my hostname since I only have one desktop computer in the house.
Afterwards, it will ask you to select system components. You can leave it as-is, but more technical users that really like the Gentoo aspect of "compiling everything I use" (and lose a considerable amount of time in the process) can opt into the ports
component, which will also include a compiler.
It will ask you to choose a filesystem. Simply choose Auto (ZFS)
unless you are installing FreeBSD on a terribly ancient computer (in which case you should pick Auto (UFS)
. The only requirement afterwards is to setup your pool (zpool
) while using ZFS
. Just pick the second option and choose a single disk. Those with precise journaling and/or RAID requirements can obviously toy with the settings a bit more but we're going with a conventional, simple install here. If you are using UFS
, leave all the options as-is and proceed.
Tip
If you have a modern (post-2019) Intel or AMD CPU, there are virtually no performance hits in enabling encryption under ZFS
. You will simply have to input your passphrase at boot (and input individual passphrases for any other encrypted drives/partitions). Note that FreeBSD will continue booting as the passphrase will be requested, resulting in additional logs being printed to the console - just press enter a few times after everything calms down so you see the prompt.
After partitioning, FreeBSD will either ask for network configuration (if using the bootonly
ISO) or install itself right away. If it asks for network configuration, confirm that you want to configure IPv4, confirm that you want to use DHCP, then leave the DNS settings as-is as FreeBSD will automatically obtain that information from your router. However, if for any reason the DNS settings are empty or invalid (e.g., it says 0.0.0.0
) then you should input Cloudflare's DNS servers: 1.1.1.1
, then 1.0.0.1
. If you know that your network supports IPv6, follow the same procedure (Cloudflare DNS servers for IPv6 are 2606:4700:4700::1111
and 2606:4700:4700::1001
shall you need them), but otherwise forgo IPv6 if you don't know.
After FreeBSD finishes deploying its files to your disk, it will prompt you for a root password, your time zone, and network configuration (if it wasn't setup already). It will also ask you to add one non-root user, which is a good security practice. While creating your user, make sure to add it to the wheel
, video
, and operator
groups - wheel
, as you may know, allows you to gain superuser privileges through su
/sudo
, and video
alongside operator
will be useful for setting up a desktop environment. Afterwards, you can reboot into your system, we do not need the installer anymore.
At the boot screen, choose multi-user mode and log into your account with the details you specified during installation. It is good practice to update FreeBSD before doing anything else, so let's do that first. Input the following commands, replacing "X" with your FreeBSD's version number. Confirm any yes/nos it asks you.
# Log into root.
su
# Fetch patches. Press 'q' after this is done to quit the log.
freebsd-update fetch
# Install patches.
freebsd-update install
# Reboot and you're done!
reboot
FreeBSD, by default, tries to keep a minimal profile. This means that it will actively avoid "expanding" its presence by consuming as little available system resources as possible... usually to the detriment of performance. This is a good conservative approach for the kind of devices that usually run FreeBSD (like servers), but we are on a desktop computer, we can let the OS use more resources.
You can use the following commands to tell the system that it can use more resources.
# Log into root.
su
# Increase the number of maximum files.
sysctl kern.maxfiles=200000
# Improve system performance when CPU is stressed.
sysctl kern.sched.preempt_thresh=200
# Extend X11 memory (for our future desktop environment).
sysctl kern.ipc.shmmax=67108864
sysctl kern.ipc.shmall=32768
# Allow users to mount disks without root perms. Useful if you want to, IDK, plug in a USB drive.
sysctl vfs.usermount=1
# Reboot!
reboot
Let's prepare our environment with the daemons and options we need for a graphical desktop. The first file that need adjustment is /etc/rc.conf
. For this, you will have to vi
into it as root. No choice. Insert these options:
# Enable the mouse. I'm pretty sure you want this one.
moused_enable="YES"
# Enable bluetooth.
hcsecd_enable="YES"
sdpd_enable="YES"
# These options will enable the use of a desktop environment
dbus_enable="YES"
hald_enable="YES"
# We will be installing GNOME, so it's important to leave these on.
gnome_enable="YES"
gdm_enable="YES"
# Power management utilities, good if you're on a laptop or you care about the planet. If you don't, leave both to hiadaptive.
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"
# This enables the ntp daemon, which will synchronize system time.
ntpd_enable="YES"
ntpd_flags="-g"
We're not done yet with manual configuration. Because our desktop environment, GNOME, was written with Linux in mind, it uses the /proc
pseudo-filesystem for retrieving information about processes. FreeBSD, by default, doesn't make use of it (because it offers the handy sysctl
command instead, which we used earlier!), so we will have to enable it manually. vi
into /etc/fstab
and add the following line at the end:
proc /proc procfs rw 0 0
FreeBSD comes with audio stuff included! Neat! And you'll see that it works with pretty much everything you throw at it. However, FreeBSD doesn't know which audio inputs/outputs you want to use, which makes sense (especially if you're on a setup like me where each screen has speakers, I have a USB DAC, and I have headphones).
First, let's explicitly tell FreeBSD to load audio stuff. FreeBSD on the latest versions will automatically load audio stuff when it detects it, but we can have it load right away prior to detection (since we know that we have audio lol) by running these two commands, obviously as root:
# Log into root.
su
# Explicitly tell FreeBSD that "Yes, we have audio, just load it right away instead of checking if we have it."
echo 'snd_driver_load="YES"' >> /boot/loader.conf
# Let's load up the audio stuff right away, just in case it was missing for some reason.
kldload snd_driver
Then, enumerate your audio devices with cat /dev/sndstat
. This will list all detected devices, prefixed with pcmN
where N
is the audio ID. To set your default audio device, run sysctl hw.snd.default_unit=N
(where N
is the device you want to use). If you want to disable the automatic switching of the audio device to whatever just got plugged in, run sysctl hw.snd.default_auto=0
. All as root, of course.
So far, we've been in the terminal. Now let's go graphical. First, install Xorg (sorry Wayland users) using the pkg install
command, as root.
# Log into root.
su
# Install Xorg.
pkg install xorg
Afterwards, it will be time to install a graphic driver for your GPU. I will include instructions for Nvidia and AMD GPUs, but you can probably Google around to find instructions for integrated Intel GPUs and other devices.
First, install the Nvidia driver as root with pkg install nvidia-driver
, then run sysrc kld_list+=nvidia-modeset
(also as root). Afterwards, open /usr/local/etc/X11/xorg.conf.d/20-nvidia.conf
in vi
and input the following:
Section "Device"
Identifier "Card0"
Driver "nvidia"
EndSection
Save and quit. This configuration is necessary to tell Xorg that you will be using the Nvidia GPU for rendering.
First, install the AMD driver as root with pkg install drm-kmod
, then run sysrc kld_list+=amdgpu
(also as root). Afterwards, open /usr/local/etc/X11/xorg.conf.d/20-radeon.conf
in vi
and input the following:
Section "Device"
Identifier "Card0"
Driver "radeon"
EndSection
Save and quit. This configuration is necessary to tell Xorg that you will be using the AMD GPU for rendering.
Now that we have graphics (not enabled yet, that will be after the reboot), let's install GNOME. Should be pretty straightforward:
# Log into root.
su
# Install gnome and gdm (Gnome Display Manager).
pkg install gnome gdm
# Reboot!
reboot
This should already work out of the box after rebooting. We already set the options we needed to enable dbus
, hald
and procfs
during system tuning, so GNOME should not have any issues running. gdm
should autostart and launch GNOME at boot, meaning adding anything to our .xinitrc
should be unnecessary.
FreeBSD doesn't come with a lot of fonts. I suggest installing the packages x11-fonts/source-code-pro-ttf
for the GNOME terminal, and x11-fonts/noto
for a bunch of Unicode fonts that should hopefully resolve any issues with rendering characters. If you need to install fonts that are not available from a package, create a folder at ~/.fonts
and move them in here. Yes, it's that simple, no installation or third party tool necessary.
That's it! You should have a fully functional, graphical FreeBSD system. Just install the browser of your choice (because Gnome's Epiphany is quite meh) and have fun.
sudo
doesn't come pre-included in FreeBSD. Instead, the su
command must be used. However many Linux veterans have sudo
into their muscle memory and so do I, so you can just install sudo
from the package manager and run visudo
to open the sudo
configuration file. Then, scroll down to this line and remove the #
to uncomment it in order to allow wheel
users to use sudo
. Save, reboot, and enjoy your use of sudo
.
# %wheel ALL=(ALL) ALL
- FreeBSD is very aggressive in allocating RAM for itself (it will be even more aggressive if you use ZFS) if you're on a system with a looot of RAM (32 GB+), but don't be alarmed, this is not a symptom of a problem and the OS is in fact designed to do so. Most of the memory it reserves is wired, usually for aggressive caching for enormous performance gains, and will be freed if your system actually needs it. You can also toy around with system settings to disable this altogether if it bothers you.
- There is a Linux compatibility layer that can be enabled if you need software that isn't offered in the package manager. You can read more about it here, but it usually involves just enabling a single setting and installing a Linux userland (or sometimes, you can download
linux-
packages from the package manager which comes with a preconfigured Linux userland!) - Most desktop environments work on FreeBSD (KDE Plasma is often considered the best one to use in terms of support and compatibility), but some will be a few versions old due to the work involved in porting them, namely GNOME. But latest versions will always come at some point, provided their maintainers don't lose faith.