Why use FreeBSD?


Should I use FreeBSD over any arbitrary GNU/Linux distribution, that is more widely spread and additionally offers commercial support? Though I have mostly positive experiences using Linux, there are many reasons why I would always choose FreeBSD for setting up a server.

BSD license

The BSD license propagates complete freedom, independent of the desired use. As long as the authors' credits remain in the source code files, you may redistribute it, customize it, use it as the basis for your own products, document it, share it to your friends or print it to a wallpaper.

But there is argument in the open-source community about what is the most “libre” license out there: BSD or the GPL. The GPL also permits modification and redistribution as well as commercial use of software but in contrast to the BSD license one has to recontribute all changes back and furthermore the full source must be published, even in a commercial project.

Both licenses have their own cons and pros but for me as a developer, it's more convenient to use the BSD license as you don't have to worry about almost anything.

Documentation (aka "The FreeBSD Handbook")

I think FreeBSD documentation (https://www.freebsd.org/doc/handbook/) is one of the best-written and most comprehensive tech documentations out there. It offers a great introduction to beginners who want to set up their first FreeBSD installation and simultaneously a powerful reference for users who are running FreeBSD for years. Beside the basic usage of the operating systems, it covers concrete use cases like web server setup and disk partitioning strategies.

Development model

Due to the fact that FreeBSD is developed as a whole package (just like windows and macOS), it feels like many things are tightly integrated. This one-stop-shop feeling, that I used to miss on Linux for a long time, turns out to be a real blessing, especially in a server environment. For example, jails (FreeBSD's approach to containerization) know how to handle ZFS volumes and therefore can create virtual environments directly each on a dedicated volume. Or the package management system that can update the host system itself as well as communicating with the jails service in order to update packages within the jails.

Stability and updates

There is no argument about the stability of both the Linux and FreeBSD operating systems. Both are extremely robust and durable when configured properly, though FreeBSD is often considered more stable due to its older code base. Whether this is really the case, I don't know.

FreeBSD's approach of logically dividing the packages into "base packages", that are an integral part of the operating system and are only updated in total and without external dependencies, and the "user packages" supplied by the ports system, it's possible to update them completely independent from each other, making the update mechanisms much more durable. And because of BSDs binary compatibility layers, it's most likely that after a base system upgrade all userland application will continue working without any issues.

Vice versa it's possible to only update the additional packages without touching the base operating system.

But many administrators use to use a much simpler way of managing FreeBSD updates. FreeBSD security bulletins keeps you on track with all the recent bugfixes in packages, it's much easier to only update those packages that got necessary security bugfixes (and their dependencies).

Simple configuration

Love systemd or hate it, it seems there is no in-between. And though I like the idea of unifying the Linux init system and essential userland tools throughout all major distributions, I don't really like the implementation itself. It seems that it's getting weirder and confusing every time a fancy XML configured tool is added to the stack. And it seems to me that all the tools that arise around systemd are much more inconvenient than useful. But this wouldn't be the problem, if not even on the thousandth distribution everything would just completely go wrong. Just think of the disaster of system updates in Ubuntu after having it migrating to systemd...

On the other hand, the service management and general configuration of FreeBSD feels like we're back in the 1960s. There are some important text configuration files like rc.conf, sysctl.conf and loader.conf that manage huge parts of the system. rc.conf for example manages host name, network configuration, system startup and almost everything else affecting the base system. sysctl.conf manages runtime kernel configuration properties and device specific settings. This is almost everything. When you used Gentoo Linux and liked its configuration approach, you will love FreeBSD's.

Additionally, there's an init system that's much like Linux's good old sysvinit and there are no runlevels. So, as you see, it's all much simpler and on a lower level, but this is exactly what you want as a system administrator.

Out-of-the-box functionality

The biggest advantage of Linux is the large software collection that comes with the most distributions. And though any of the any server task could also be accomplished using Linux, to me the most FreeBSD solutions seem to be much more carefully conceived. And sometimes, Linux' diversity becomes its biggest fate. Because due to the many possible combinations of software, many of them don't integrate very well with each other.

Here is a short example for Linux. There are roughly two major technologies to persistently containerize full Linux guest systems within a Linux host ("persistent" != Docker): The linux-vserver project and lxc. And while linux vserver has a long history that reaches back to kernel version 2.4, lxc just gets started and has just began to become stable and usable. But this leads to a gap where linux-vserver is no longer capable of running almost any current Linux distribution (which is running systemd) because noone want's to put effort in a nearly end-of-life project while lxc isn't capable doing this either because there's much work left to do. This is why some developers now started the lxcfs project to solve those issues (partly), see https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1347020.

In contrast, FreeBSD's jails run for almost ten years and interoperates with many other core components like the package management system. Additionally, the technology is an integral part of the base system.