FreeBSD on a VPS: where you can install it and why you would want to
FreeBSD is not a Linux distribution but a separate operating system with its own kernel, its own base system and its own documentation. It is valued for its coherence: the kernel, utilities and libraries are developed by one project and released together, while third-party software is installed separately and doesn't mix with the system. On a server this gives you predictable behaviour, built-in ZFS, isolation through jails and the pf packet filter. The price is a smaller user base: hosts offer fewer ready guides and templates than for Linux.
Where FreeBSD can be installed at all
The main limitation is virtualisation. On OpenVZ and LXC containers all of the host's customers run on a shared Linux kernel, so FreeBSD simply can't run there. You need full virtualisation: KVM, Xen, VMware or Hyper-V. From there you have two options:
- A FreeBSD template in the host's panel. The quickest route, but check the version right after installation with
freebsd-version: templates often lag behind, and a branch that has reached end of life gets no security fixes. - Installation from the official ISO. Upload the image in the panel, open the VNC console and go through the bsdinstall installer. This works on plans that allow a custom image; a list is on the VPS with custom ISO page.
Before ordering, find out how the host provides networking. If the address is assigned via DHCP, everything will work on its own. If IPv4, and especially IPv6, has to be configured manually, take the parameters from the panel and set them in /etc/rc.conf from the console, before the first reboot. On KVM the network card and disk usually appear as virtio devices (vtnet0, vtbd0), and their drivers are included in the system.
Right after installation, do a few things that a clean system lacks. Add your user to the wheel group and install sudo or doas from packages, and in /etc/ssh/sshd_config disable root login and password login. Enable time synchronisation with the line ntpd_enable="YES" in /etc/rc.conf. The pf firewall is off by default: write a short /etc/pf.conf that allows SSH and the ports you need, and enable it while keeping the VNC console open in case of a mistake in the rules. System emails with daily security reports are delivered to root locally, so redirect them to your own address in /etc/mail/aliases and run newaliases so that someone actually reads them.
ZFS or UFS on a small server
The installer offers a ZFS layout by default, and on a VPS this is convenient: file system snapshots are instant, you can send them to another server with zfs send, and boot environments let you roll back a failed system update with a reboot. But ZFS loves memory: by default the ARC cache takes most of it. On a plan with 1–2 GB, cap it with the vfs.zfs.arc_max parameter in /boot/loader.conf, otherwise little will be left for applications. On the smallest plans with 512 MB it's more sensible to choose UFS, which is simpler and needs almost no memory. For storage and backup servers with a large disk, ZFS is precisely the main argument for FreeBSD.
Typical uses and what to bear in mind
- Web server and databases. nginx, PostgreSQL, MySQL and PHP are installed from packages with
pkg install. Configs live in/usr/local/etc, not/etc, which is a common source of confusion after Linux. - Isolating services in jails. A jail is a lightweight container with its own file system, users and address. Docker doesn't run natively on FreeBSD; jails and the tools for managing them fill that role.
- Network node and firewall. pf handles filtering, NAT and rate limiting in one clear config. pfSense is built on FreeBSD; if you need a ready router with a web interface, see VPS for pfSense.
- Linux programs partly run through the linuxulator compatibility layer, but you shouldn't rely on it for serious workloads. If your software exists only for Linux, choose Debian.
Updates and support
The base system is updated separately from packages. Security fixes for it are installed with freebsd-update fetch install, and moving to a new release with freebsd-update upgrade -r plus the version number. Packages are updated with pkg upgrade, and pkg audit -F shows known vulnerabilities in installed software. Each branch is supported for a limited time, and a point release within a branch only for a few months after the next one comes out, so check the dates on the project's website and upgrade ahead of time. Before moving between branches, take a ZFS snapshot or a disk snapshot in your host's panel: if something goes wrong, rolling back takes minutes.