FreeBSD server administration – PF firewall, ZFS, jails, and security

FreeBSD is an operating system that for decades has powered some of the most heavily loaded servers in the world – from Netflix and WhatsApp to DNS infrastructure and enterprise firewalls. If it weren't for Linux's dominance in the hosting and cloud ecosystem, FreeBSD would be our first-choice system – due to its architectural consistency, native ZFS with built-in snapshots and compression, a PF firewall with clean syntax and high performance, jails containerization without Docker's overhead, and the BSD license that gives full deployment freedom.

We administer FreeBSD servers in production environments running WordPress sites, WooCommerce stores, and custom web applications. We choose FreeBSD where predictable performance, advanced security mechanisms, and reliable data protection matter. We describe a practical comparison of FreeBSD and Linux in the context of WordPress hosting – with benchmarks and configuration – in our publication FreeBSD and ZFS for WordPress.

System

FreeBSD installation and configuration

We install FreeBSD from scratch on dedicated and VPS servers. We configure the ZFS file system, networking, bootloader, and the ports and pkg package repository. We tailor the configuration to application requirements – from simple web servers to complex environments with multiple services running in isolated jails.

PF firewall

PF firewall – filtering, NAT, rate-limiting

We configure the native PF firewall – stateful packet filtering, NAT, port forwarding, rate-limiting, protection against SYN flood attacks, and packet normalization (scrub). PF stands out for its clean configuration syntax and high performance under heavy network traffic. The configuration is readable, auditable, and easy to maintain.

ZFS

ZFS file system – snapshots, compression, replication

ZFS is the most important advantage of FreeBSD over Linux in the context of data protection. Native snapshots with no downtime, automatic LZ4/ZSTD compression, checksums for every block, and ZFS send/receive replication to a remote server. We use ZFS to create instant copies of the file system state before updates, migrations, and configuration changes. We detail ZFS tuning for databases in our publication ZFS optimization for PostgreSQL and MySQL.

Jails

Jails containerization – service isolation

FreeBSD jails is native containerization with full isolation of processes, the file system, and the network – without the performance overhead of Docker containers. We run services in separate jails: web server, database, mail server, DNS. The compromise of one service does not mean a compromise of the entire server. We manage jails using bastille or manually via jail.conf. We compare jails with Docker and systemd-nspawn in our publication Web application containerization.

Security

FreeBSD system security

We secure FreeBSD at the operating system level: securelevel, file flags (schg, sunlnk), disabling unnecessary services, restricting SSH access to keys, sysctl configuration for security, and permissions auditing. FreeBSD offers native protection mechanisms that Linux lacks – securelevel prevents modification of key system files even by root, and Capsicum provides process-level sandboxing.

Backup

Backups and disaster recovery

On FreeBSD, we combine ZFS snapshots with replication to a remote server – instant copies of the file system state with no downtime, and encrypted offsite replication. We complement this with traditional backups of databases and configuration files. A multi-level strategy: ZFS snapshots every hour, full replication every 24 hours, and recovery tests every month.

FreeBSD is an operating system for those who need predictability, stability, and advanced administration tools available natively – without bolting on external modules and patches. The PF firewall, ZFS file system, and jails containerization give the administrator a level of control that no Linux distribution offers in such a cohesive package. We have administered FreeBSD for years in production environments and know exactly when it is a better choice than Linux.

How we work

FreeBSD server administration at WebOptimo is a repeatable, structured process – not a one-time configuration.

Audit A review of the system configuration, PF firewall, ZFS dataset, jails, securelevel, sysctl, permissions, crontabs, and backup status. The result is a report with a prioritized list of issues and recommendations.
Plan Prioritizing changes based on their impact on security and performance. Critical fixes immediately; larger changes (ZFS migration, jails deployment, replication) with a schedule and rollback scenario.
Implementation System configuration, securing services, tuning the web server and database, deploying jails, configuring ZFS and PF. Before any change, a ZFS snapshot – roll back in seconds if anything goes wrong.
Monitoring Continuous 24/7 monitoring: uptime, CPU, RAM, disks and ZFS datasets, network traffic, service and jails status, security logs. Alerts and response before a problem affects application performance.
Maintenance Regular system updates (freebsd-update, pkg upgrade), log reviews, SSL certificate rotation, ZFS replication tests, and periodic reports with recommendations.

When should you choose FreeBSD?

FreeBSD is not the default choice – it is a conscious choice. Here are the situations where its advantages over Linux really matter.

Data

Data protection is a priority

ZFS is the only production-grade file system with built-in checksums for every block, automatic repair of silent corruption, native compression, and snapshots with no downtime. If data loss or corruption is unacceptable – for example, in PostgreSQL or MySQL databases – ZFS on FreeBSD offers guarantees that ext4 and XFS do not. Read more about the practical benefits of ZFS in a WordPress environment in our publication FreeBSD and ZFS for WordPress.

Isolation

You need service isolation without Docker

FreeBSD jails is containerization built into the system – lightweight, stable, and secure. It does not require the Docker Engine, an overlay2 layer, or an orchestrator. Every service runs in an isolated environment with its own file system and network (VNET). Perfect for servers hosting multiple sites or services on a single machine.

Firewall

You need a high-performance and readable firewall

PF is a firewall with clean syntax that is easy to audit and maintain. Compared to iptables/nftables on Linux, PF configuration is concise and less prone to errors. Native rate-limiting, packet normalization, and protection against SYN floods – without additional tools.

Stability

You need production predictability

FreeBSD is developed as a cohesive operating system – the kernel, system tools, and documentation form a single project. There are no inconsistencies between distributions, no differences in the init system, and no surprises after updates. Once properly configured, a FreeBSD server runs stably for years.

Network

The server acts as a router, VPN, or firewall

The FreeBSD network stack is one of the most thoroughly tested in the industry – Netflix streams petabytes of data through it daily. PF, VNET, IP aliases, and native support for WireGuard make FreeBSD an excellent choice as a network gateway, VPN server, or dedicated firewall. We describe DNS architecture in our publication DNS architecture and domain management.

Migration

You are considering a migration from Linux to FreeBSD

Migrating from Linux to FreeBSD is a change of the operating system, not just a reconfiguration. We transfer services step by step: we configure FreeBSD from scratch, recreate the web stack, migrate databases and files, and test performance and compatibility. We plan the entire process to ensure zero downtime.

Questions and answers

FreeBSD offers exceptional stability, a high-performance native PF firewall, the ZFS file system with built-in snapshots and compression, and the jails containerization system. It is an excellent choice for servers requiring predictable performance, advanced security mechanisms, and reliable data protection. We administer both FreeBSD and Linux – choosing the system based on project requirements.

Yes. WordPress works perfectly on FreeBSD with Nginx, PHP-FPM, and MariaDB or PostgreSQL. We configure the full web stack for WordPress and WooCommerce on FreeBSD, with performance optimization, FastCGI cache, Redis, and OPcache. FreeBSD with ZFS provides additional data protection through native snapshots.

PF (Packet Filter) is the native FreeBSD firewall, known for its clean configuration syntax, high performance, and advanced features: stateful filtering, NAT, port forwarding, rate-limiting, protection against SYN flood attacks, and packet normalization (scrub). PF configuration is concise and readable compared to iptables, reducing the risk of errors.

Jails is the native FreeBSD containerization system – lightweight, isolated environments with their own file system, network, and processes. We use jails to separate services: web server, database, mail server, DNS – each service in a separate jail. A compromise of one container does not mean the entire server is compromised.

ZFS offers native snapshots – nearly instantaneous copies of the file system state, with no downtime and no additional disk load. We combine snapshots with ZFS send/receive replication to a remote server. Combined with traditional file and database backups, we create a multi-level data protection strategy.

Yes. We administer FreeBSD servers with providers that offer this platform – Hetzner, OVH, Vultr, as well as dedicated and collocated servers. Not every VPS provider offers FreeBSD – in such cases, we help choose the right infrastructure or configure a dedicated server.

Yes. We migrate WordPress, WooCommerce sites, and other web applications from Linux to FreeBSD. We configure the environment from scratch, transfer data, and test compatibility and performance. The migration is planned to occur without downtime.

Let's talk about managing your FreeBSD server

We will present a FreeBSD server administration offer tailored to your needs. No obligations, no marketing jargon – a concrete proposal after a short conversation or infrastructure analysis.

Phone

+48 608 271 665

Mon–Fri, 8:00–16:00 CET

Email

contact@weboptimo.pl

We respond within 24h

Company

WebOptimo

VAT ID: PL6391758393