# How to Install FreeBSD on a Raspberry Pi
FreeBSD runs on the Raspberry Pi. Not as a novelty -- as a genuinely usable operating system for headless servers, network appliances, and embedded projects. The ARM64 port has matured significantly, package support is solid, and for certain workloads a Pi running FreeBSD is quieter, more stable, and more predictable than the same hardware running Linux.
This guide covers everything from downloading the image to configuring WiFi, managing packages, and tuning performance. It is honest about the limitations too. FreeBSD on the Pi is not a desktop replacement. But for a DNS server, home router, NAS, or development board, it is an excellent choice.
FreeBSD on ARM: Current State
FreeBSD has supported ARM architectures since the early 2010s, but the aarch64 (ARM64) port is where serious development has focused since FreeBSD 12. As of FreeBSD 14.x, the ARM64 platform is a Tier 1 architecture. That means it receives the same level of support, testing, and release engineering as amd64.
What this means in practice:
- Official release images are built for ARM64 every release cycle.
- The pkg package manager works and has a large binary package repository for aarch64.
- Security advisories and patches are issued for ARM64 alongside other platforms.
- ZFS, jails, PF, and most of the FreeBSD stack work as expected.
Supported Raspberry Pi Models
Not every Pi model has the same level of support. Here is the current picture:
| Model | SoC | Architecture | FreeBSD Support | Notes |
|-------|-----|-------------|----------------|-------|
| Raspberry Pi 3 Model B/B+ | BCM2837 | AArch64 | Good | Stable, well-tested. Limited to 1GB RAM. |
| Raspberry Pi 4 Model B | BCM2711 | AArch64 | Good | Best overall choice. Available in 2GB, 4GB, 8GB. |
| Raspberry Pi 400 | BCM2711 | AArch64 | Good | Same SoC as Pi 4, keyboard form factor. |
| Raspberry Pi 5 | BCM2712 | AArch64 | Experimental | Support is improving but not all peripherals work yet. Check the FreeBSD wiki for current status. |
| Raspberry Pi Zero 2 W | BCM2710A1 | AArch64 | Fair | Works, but 512MB RAM limits usefulness. |
| Raspberry Pi 1, Zero (original) | BCM2835 | ARMv6 | Dropped | 32-bit ARM. No longer supported in recent FreeBSD releases. |
| Raspberry Pi 2 (v1.1) | BCM2836 | ARMv7 | Dropped | 32-bit ARM. Use FreeBSD 13.x or earlier if needed. |
**The recommendation:** Get a Raspberry Pi 4 Model B with 4GB or 8GB of RAM. It has the best balance of hardware support, performance, and available memory for FreeBSD.
Downloading the FreeBSD ARM64 Image
FreeBSD provides pre-built images specifically for Raspberry Pi boards. You do not need to cross-compile anything.
Go to the official FreeBSD download page:
https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.2/
Look for the file named something like:
FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
Download it with fetch or curl:
bash
# On a FreeBSD machine
fetch https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
# On macOS or Linux
curl -O https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
Verify the checksum against the CHECKSUM.SHA256-FreeBSD-14.2-RELEASE-arm64-aarch64 file on the same download page:
bash
sha256sum FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
Decompress the image:
bash
xz -d FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img.xz
You now have a raw .img file ready to flash.
Flashing the Image to an SD Card
You need a microSD card of at least 8GB. A 32GB card with decent write speeds (Class 10 or UHS-I) is ideal.
Method 1: Using dd (macOS/Linux)
Insert the microSD card and identify the device. On macOS:
bash
diskutil list
Look for the disk that matches your SD card size. It will be something like /dev/disk4. On Linux, use lsblk instead.
**Be extremely careful with the of= target. Writing to the wrong device will destroy data.**
On macOS, unmount the disk first:
bash
diskutil unmountDisk /dev/disk4
Then flash:
bash
sudo dd if=FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img of=/dev/rdisk4 bs=1m conv=sync
On macOS, use /dev/rdisk4 (with the r prefix) instead of /dev/disk4 for significantly faster writes. The r stands for raw device.
On Linux:
bash
sudo dd if=FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img of=/dev/sdX bs=1M status=progress
Replace /dev/sdX with your actual device.
Method 2: Using balenaEtcher
If dd makes you nervous, balenaEtcher is a graphical tool that works on macOS, Linux, and Windows:
1. Download balenaEtcher from [balena.io/etcher](https://etcher.balena.io/).
2. Open it, select the .img file (Etcher can also handle the .img.xz directly without decompression).
3. Select the target SD card.
4. Click "Flash" and wait.
Etcher verifies the write automatically, which is a nice safety net.
First Boot and Initial Login
Insert the microSD card into the Raspberry Pi. Connect an Ethernet cable if possible -- it simplifies the first boot considerably. Connect power.
Using a Serial Console (Recommended)
FreeBSD on the Pi outputs its console on the UART serial pins by default. If you have a USB-to-TTL serial cable (3.3V logic level), connect it to GPIO pins 6 (GND), 8 (TX), and 10 (RX) on the Pi's 40-pin header.
Then on your host machine:
bash
# macOS
screen /dev/tty.usbserial-* 115200
# Linux
screen /dev/ttyUSB0 115200
You will see the FreeBSD boot messages scroll by, followed by a login prompt.
Using HDMI
FreeBSD also outputs to HDMI on the Pi 4. Connect a monitor and a USB keyboard. The resolution detection is generally reliable, though you may see a brief delay before the framebuffer initializes.
Default Credentials
The default login for the FreeBSD Raspberry Pi image is:
| User | Password |
|------|----------|
| root | root |
| freebsd | freebsd |
Log in as root for initial setup. You will change these immediately.
Initial Setup
Once logged in as root, run through these essential steps.
Change Passwords
bash
passwd root
passwd freebsd
Choose strong passwords. If this machine will be accessible on a network, weak default credentials are the number one security risk.
Set the Hostname
bash
sysrc hostname="pibox"
hostname pibox
Set the Timezone
bash
tzsetup
Follow the interactive menu to select your region and city.
Enable and Start SSH
SSH is typically already enabled in the Pi image, but verify:
bash
sysrc sshd_enable="YES"
service sshd start
For security, disable root login over SSH once you have confirmed the freebsd user can log in and use su or sudo:
bash
# Edit /etc/ssh/sshd_config
# Set: PermitRootLogin no
service sshd restart
Update the System
bash
freebsd-update fetch install
pkg update && pkg upgrade
freebsd-update handles the base system. pkg handles third-party packages. Run both.
Install sudo
bash
pkg install sudo
visudo
Uncomment the %wheel ALL=(ALL) ALL line. Then add the freebsd user to the wheel group if they are not already:
bash
pw groupmod wheel -m freebsd
WiFi Setup
WiFi on the Raspberry Pi under FreeBSD uses the brcmfmac driver (loaded as if_brcmfmac). Support varies by model, but the Pi 3B+, Pi 4, and Pi 400 generally work.
Load the WiFi Driver
Check if the wireless interface is already present:
bash
ifconfig wlan0
If not, create it:
bash
sysrc wlans_brcmfmac0="wlan0"
sysrc ifconfig_wlan0="WPA DHCP"
service netif restart
Configure wpa_supplicant
Create or edit /etc/wpa_supplicant.conf:
network={
ssid="YourNetworkName"
psk="YourPassword"
}
Then restart networking:
bash
service netif restart
Verify connectivity:
bash
ifconfig wlan0
ping -c 3 freebsd.org
Making WiFi Persistent
To ensure WiFi connects on every boot, confirm these lines are in /etc/rc.conf:
bash
sysrc wlans_brcmfmac0="wlan0"
sysrc ifconfig_wlan0="WPA SYNCDHCP"
Using SYNCDHCP instead of DHCP makes the boot process wait for an IP address before continuing, which avoids race conditions with services that need network access at startup.
**Note:** WiFi performance on the Pi under FreeBSD is generally slower than under Linux. For anything bandwidth-sensitive, use Ethernet.
Package Management on ARM64
The pkg package manager works on ARM64 FreeBSD exactly as it does on amd64. The aarch64 package repository is built from the same ports tree.
bash
# Search for a package
pkg search nginx
# Install a package
pkg install nginx
# List installed packages
pkg info
# Remove a package
pkg delete nginx
# Audit installed packages for vulnerabilities
pkg audit -F
What Works
The vast majority of headless server software builds and runs without issues on ARM64:
- Web servers: nginx, Apache, Caddy
- Databases: PostgreSQL, MariaDB, SQLite
- DNS: Unbound, NSD, BIND
- Firewalls: PF (built into the kernel)
- Containers: jails (native), no Docker
- Languages: Python, Go, Rust, Node.js, Ruby
- Monitoring: Prometheus, Grafana, Zabbix agent
What Might Be Missing
Some packages that exist on amd64 may not be available on aarch64. This is usually because:
- The port does not compile on ARM64.
- A dependency uses x86-specific assembly.
- Nobody has tested and fixed the port for ARM yet.
If you hit a missing package, you can try building it from the ports tree:
bash
pkg install git
git clone --depth 1 https://git.FreeBSD.org/ports.git /usr/ports
cd /usr/ports/category/portname
make install clean
Building from ports on a Pi 4 is slow but functional. Cross-compiling on a faster machine is an option for heavy ports.
Use Cases for FreeBSD on Raspberry Pi
The Pi is not a powerhouse, but FreeBSD's efficiency makes it surprisingly capable for specific roles.
Home Router / Firewall
A Pi 4 with a USB Ethernet adapter makes a competent home router running PF. FreeBSD's network stack is mature and PF is one of the best packet filters available. See our [FreeBSD router and gateway guide](/blog/freebsd-router-gateway/) for a detailed walkthrough.
bash
# Enable IP forwarding
sysrc gateway_enable="YES"
sysrc pf_enable="YES"
service pf start
DNS Server
Running Unbound as a local recursive DNS resolver is one of the best uses for a Pi. It is lightweight, secure, and eliminates your dependency on upstream DNS providers. Our [Unbound DNS on FreeBSD guide](/blog/unbound-dns-freebsd/) covers this in depth.
bash
pkg install unbound
sysrc unbound_enable="YES"
service unbound start
NAS (Network Attached Storage)
Attach a USB drive and share files via NFS or Samba. FreeBSD's UFS and ZFS support on ARM64 is solid, though ZFS on a 2GB Pi will be tight on memory. A 4GB or 8GB model is recommended for ZFS.
bash
pkg install samba416
# Configure /usr/local/etc/smb4.conf
sysrc samba_server_enable="YES"
service samba_server start
IoT Gateway
FreeBSD's security model (jails, capsicum, mandatory access controls) makes it a strong choice for an IoT gateway that aggregates data from sensors and forwards it to a central system. The attack surface is smaller than a typical Linux IoT stack.
Development and Learning
If you want to learn FreeBSD internals, kernel development, or systems programming, a Pi is an inexpensive dedicated machine you can break and rebuild without consequence. It is also a great way to test ARM64-specific code.
GPIO Access on FreeBSD
FreeBSD provides GPIO access through the gpioctl utility and the /dev/gpioc0 device node.
Reading and Writing Pins
List available GPIO pins:
bash
gpioctl -l
Read the state of a pin:
bash
gpioctl -f /dev/gpioc0 17
Set a pin as output and write to it:
bash
gpioctl -f /dev/gpioc0 -c 17 OUT
gpioctl -f /dev/gpioc0 17 1 # Set high
gpioctl -f /dev/gpioc0 17 0 # Set low
GPIO from C
FreeBSD provides a clean C API via libgpio:
c
#include
#include
int main(void) {
gpio_handle_t handle;
handle = gpio_open(0);
if (handle == GPIO_INVALID_HANDLE)
return 1;
gpio_pin_set(handle, 17, GPIO_PIN_HIGH);
gpio_close(handle);
return 0;
}
Compile with:
bash
cc -o blink blink.c -lgpio
GPIO Limitations
FreeBSD's GPIO support is functional but more basic than what Linux offers through libgpiod or the sysfs interface. There is no equivalent to Linux's device tree overlays for dynamically configuring pin functions. Hardware PWM, SPI, and I2C are accessible but require more manual configuration than on Raspberry Pi OS.
Performance Tips
The Pi is not fast. These tweaks help FreeBSD make the most of the hardware.
Boot from USB Instead of SD
SD cards are slow and wear out. A USB 3.0 SSD on a Pi 4 makes a dramatic difference in I/O performance and longevity.
1. Flash the FreeBSD image to a USB SSD using the same dd method.
2. Update the Pi's EEPROM bootloader to support USB boot (this is done from Raspberry Pi OS -- see the official Raspberry Pi documentation).
3. Remove the SD card and boot from USB.
USB boot is strongly recommended for any Pi that will run 24/7.
Add Swap
The default image may not include a swap partition. On a Pi with 2GB or less, add swap:
bash
# Create a 2GB swap file
dd if=/dev/zero of=/usr/swap0 bs=1m count=2048
chmod 0600 /usr/swap0
echo 'md none swap sw,file=/usr/swap0,late 0 0' >> /etc/fstab
swapon -aL
Keep Services Lightweight
Every megabyte of RAM matters on a Pi. Choose lightweight alternatives:
- Use unbound instead of BIND for DNS.
- Use nginx instead of Apache for web serving.
- Use doas instead of sudo (smaller footprint).
- Avoid running a desktop environment. Keep it headless.
Tune the Kernel
For a dedicated appliance, you can build a custom kernel that strips out unnecessary drivers and features. This reduces memory usage and can improve boot time.
bash
cd /usr/src
make buildkernel KERNCONF=MYPI
make installkernel KERNCONF=MYPI
This requires the FreeBSD source tree, which you can fetch with:
bash
fetch https://download.freebsd.org/releases/arm64/aarch64/14.2-RELEASE/src.txz
tar -C / -xzf src.txz
Disable Unnecessary Services
bash
# Check what is running
service -e
# Disable anything you do not need
sysrc sendmail_enable="NO"
sysrc sendmail_submit_enable="NO"
sysrc sendmail_outbound_enable="NO"
sysrc sendmail_msp_queue_enable="NO"
Limitations vs Linux on Raspberry Pi
Being honest about the gaps matters. If you are coming from [Raspberry Pi OS or comparing FreeBSD to Linux](/blog/freebsd-vs-linux/), these are the areas where FreeBSD falls short on Pi hardware.
GPU Acceleration
There is no GPU acceleration under FreeBSD on the Pi. The VideoCore GPU has no FreeBSD driver. This means:
- No hardware-accelerated video playback.
- No OpenGL or Vulkan.
- No Wayland or X11 with GPU compositing.
- The framebuffer console works, but that is the extent of graphics support.
If you need a graphical desktop on a Pi, use Linux.
Camera Module
The Raspberry Pi camera modules (CSI interface) are not supported under FreeBSD. There are no V4L2-equivalent drivers. USB webcams may work with the webcamd port, but the native ribbon cable cameras do not.
Bluetooth
Bluetooth support on the Pi under FreeBSD is either non-functional or extremely limited depending on the model. Do not count on it.
WiFi Performance
As mentioned above, WiFi works but throughput is typically lower than under Linux. The brcmfmac driver on FreeBSD does not receive the same optimization effort as the Linux equivalent.
Hardware Video Encoding/Decoding
No hardware codec support. Any video transcoding will be software-only, which is painfully slow on a Pi's CPU.
Community and Documentation
The Raspberry Pi community around Linux is enormous. Tutorials, forums, Stack Overflow answers, and YouTube videos overwhelmingly assume Linux. FreeBSD on the Pi has a smaller but knowledgeable community. The FreeBSD Wiki and mailing lists are your best resources.
Docker
Docker does not exist on FreeBSD. FreeBSD has jails, which serve a similar purpose for service isolation, but they are not Docker containers. If your workflow depends on Docker images, this is a dealbreaker.
Recommended Raspberry Pi Models for FreeBSD
Here is a practical buying guide based on use case:
| Use Case | Recommended Model | RAM | Why |
|----------|------------------|-----|-----|
| DNS server (Unbound/NSD) | Pi 4 Model B | 2GB | DNS is lightweight. 2GB is plenty. |
| Home router / firewall | Pi 4 Model B | 4GB | PF + NAT + logging benefits from extra RAM. Add USB Ethernet. |
| NAS (Samba/NFS) | Pi 4 Model B | 4GB+ | ZFS needs RAM. Use USB SSD for storage. |
| Development / learning | Pi 4 Model B | 8GB | More RAM means more room for compiling and testing. |
| Minimal IoT gateway | Pi Zero 2 W | 512MB | Small, low power. Adequate for lightweight data forwarding. |
| General-purpose server | Pi 4 Model B | 4GB | Best all-rounder for FreeBSD on Pi. |
**Do not buy a Pi 5 specifically for FreeBSD unless you are willing to deal with incomplete support.** The Pi 4 is the safe, well-tested choice as of early 2026.
Frequently Asked Questions
Can I run ZFS on a Raspberry Pi with FreeBSD?
Yes. ZFS works on ARM64 FreeBSD. However, ZFS is memory-hungry. On a 2GB Pi, ZFS will consume a large portion of available RAM for its ARC cache, leaving little for applications. A 4GB or 8GB Pi 4 is recommended if you want to use ZFS. You can also tune the ARC size limit:
bash
# In /boot/loader.conf
vfs.zfs.arc_max="1073741824" # Limit ARC to 1GB
Does FreeBSD on the Pi support USB boot?
Yes, the Pi 4 supports booting from USB devices, and FreeBSD works with this feature. You need to first update the Pi's EEPROM bootloader (using Raspberry Pi OS) to enable USB boot priority. After that, flash the FreeBSD image to a USB SSD and remove the SD card.
Can I use FreeBSD on a Pi as a desktop?
Technically you can install X11 and a window manager, but without GPU acceleration it will be extremely slow. FreeBSD on the Pi is best suited for headless server roles. If you need a desktop Pi, use Raspberry Pi OS or another Linux distribution.
How do I update FreeBSD on the Pi?
The same way as any other FreeBSD system:
bash
# Update the base system
freebsd-update fetch install
# Update packages
pkg update && pkg upgrade
# Reboot if the kernel was updated
shutdown -r now
Is FreeBSD on the Pi stable enough for production use?
For headless server roles -- DNS, routing, NAS, monitoring -- yes. The Pi 4 with FreeBSD 14.x is stable and reliable. People run these setups 24/7 with uptimes measured in months. The key is to use Ethernet instead of WiFi, boot from USB SSD instead of SD card, and stick to well-tested configurations.
Can I run jails on a Raspberry Pi?
Yes. Jails work on ARM64 FreeBSD and are an excellent way to isolate services on a Pi. Each jail gets its own filesystem, network stack, and process space with minimal overhead. This is one of FreeBSD's biggest advantages over running bare services.
bash
pkg install bastille
sysrc bastille_enable="YES"
bastille bootstrap 14.2-RELEASE
bastille create myjail 14.2-RELEASE 192.168.1.50
What is the power consumption of a Pi running FreeBSD?
Power consumption depends on the model and load, not the OS. A Pi 4 idles at around 3-4 watts and peaks at about 7-8 watts under heavy CPU load. FreeBSD's power management on the Pi is comparable to Linux. For a device running 24/7, this translates to roughly 25-35 kWh per year -- negligible in electricity costs.
Wrapping Up
FreeBSD on the Raspberry Pi is not for everyone. If you want a plug-and-play media center, a retro gaming console, or a desktop computer, use Linux. The driver support and community resources are vastly better for those use cases.
But if you want a quiet, low-power, BSD-based appliance that handles DNS, routing, file sharing, or service hosting with the stability and security model that FreeBSD is known for, a Pi 4 with FreeBSD is a surprisingly capable platform. The ARM64 port is mature, pkg works, jails work, PF works, and ZFS works (with enough RAM).
Start with the basics: flash the image, boot it up, set a hostname, enable SSH, and build from there. For your next steps, consider setting up [Unbound as a local DNS resolver](/blog/unbound-dns-freebsd/), turning your Pi into a [FreeBSD-based home router](/blog/freebsd-router-gateway/), or reading our [FreeBSD vs Linux comparison](/blog/freebsd-vs-linux/) to understand the broader tradeoffs between the two systems.