Understanding the FreeBSD architecture: the base system that unifies the kernel and userland, the ports tree for source, and `pkg` packages for binaries. You will also get to know the main components: the modular kernel, the bootloader, the rc system, the filesystem, jails, pf, and bhyve working as one integrated system.

In the previous episode 1, you already understood FreeBSD's history and the philosophy behind it. Now it's time to go deeper into architecture and core concepts — the technical map you'll use across all the following episodes.
FreeBSD is often described as a "single package" system: the kernel, userland, and tooling are built from the same source tree. But what exactly is inside that package, and how do the components work together? This episode will dissect the three pillars of software distribution — the base system, ports, and packages — and then introduce the system's core components.
FreeBSD distributes software through three complementary paths. Understanding the differences is the key to reading almost any FreeBSD documentation.
The base system is the core of FreeBSD: the kernel, basic utilities, compiler, libraries, and documentation that are developed together and released as one unit. When you install FreeBSD, this is what first lands on disk. Updates are done with freebsd-update, which ensures the base system always stays in sync as a single unit:
freebsd-update fetch
freebsd-update installBecause the base system is a complete unit, there's no such thing as a "half-installed package" for core components. The kernel and userland versions are always compatible with each other — this is the source of the legendary stability.
The ports tree is a collection of scripts and metadata for building thousands of applications from source. Located at /usr/ports, each port describes how to download the source, apply patches, and compile. This is the most flexible path — you control the compile flags and optimizations for your specific hardware.
ls /usr/ports/www
cat /usr/ports/www/nginx/Makefile | head -20pkg PackagesPackages are the finished product of ports: pre-compiled binaries ready to install. Managed by the pkg package manager, this path is much faster and requires no toolchain on the system. Packages are the default choice for most users.
Info
Ports and packages share the same foundation: a package is built from a port. So the names and options you see in /usr/ports are the source of truth, while pkg is just the delivery vehicle.
The FreeBSD kernel is modular. Features like ipfw, bhyve, or netgraph can be loaded and unloaded at runtime with kldload, kldunload, and inspected with kldstat:
kldstat
kldload if_lagg
kldunload if_laggUsually the most frequently used modules are already compiled into the GENERIC kernel that ships with FreeBSD. Custom kernel configuration for specific needs (such as dropping unneeded modules on an appliance) is covered in episode 18.
On top of the kernel, FreeBSD provides the userland — all the utilities you type every day: ls, cp, sed, pw, mount, and others. They are all written and tested together with the kernel, so consistency between tools is very high. There's no GNU vs BSD version war like in the Linux ecosystem.
FreeBSD's boot sequence starts with the firmware (UEFI or BIOS), then the bootloader, then the kernel. Boot configuration lives in /boot/loader.conf — you can set kernel parameters, ramdisk sizes, and modules loaded before the full system starts:
cat /boot/loader.confParameters in this file are often used for early tuning, such as kern.maxfiles or ZFS ARC memory limits, which we'll cover in episode 18.
FreeBSD's service management uses the SysV-style rc system. Configuration is centralized in /etc/rc.conf, and service scripts live in /etc/rc.d and /usr/local/etc/rc.d for software from pkg. With sysrc, you can change service configuration without manually editing files:
sysrc sshd_enable="YES"
service sshd startFreeBSD supports two main filesystems. UFS is the faithful companion from the classic Unix era — fast, simple, and reliable. ZFS is the modern filesystem with checksums, snapshots, compression, and pooling that has been the default choice of installations for the last several releases.
df -h
zpool statusThese last three components are FreeBSD's production stars:
All three will be covered in depth in episodes 12-16, but it's important to get to know them now because they are an inseparable part of the architecture, not separate add-ons.
Warning
Don't be tempted to mentally equate jails with Docker. Jails isolate a whole operating system (not just processes), share the host kernel, and are configured through jail.conf. Different concepts lead to different usage — jails are covered in episode 15.
A few FreeBSD-specific directories you must understand:
| Directory | Contents |
|---|---|
/etc | Base system configuration |
/etc/rc.conf | Central service configuration |
/usr/local | Software from pkg and ports |
/usr/ports | Ports tree for building from source |
/boot | Bootloader, kernel, and loader.conf |
/var/log | System logs |
Note that FreeBSD consistently places third-party software in /usr/local, separating it from the base system in /usr and /bin. This convention keeps things clear and makes updates easier.
In this episode 2, you've understood the FreeBSD architecture: the base system as a complete unit, the ports tree for source, and pkg packages for binaries. You've also met the main components — the modular kernel, BSD userland, the bootloader with loader.conf, the rc system, the UFS/ZFS filesystems, and jails, pf, and bhyve as production strengths.
Key takeaways:
freebsd-update.kldload and kldstat./etc/rc.conf; change it with sysrc.In the next episode, episode 3, we'll get hands-on immediately: installing FreeBSD with bsdinstall and partitioning — from the installation wizard steps, keymap and hostname choices, to the partition decision between the ZFS default and traditional UFS. Get the ISO image you downloaded in episode 0 ready!