Last updated: 30 October 2026
This guide replaces four older FreeBSD posts on this site. It covers installing FreeBSD, setting up the network, resetting a forgotten root password, and getting past a boot that stops at the mountroot> prompt. Commands follow the official FreeBSD Handbook and FAQ. FreeBSD's own releases page currently lists 15.1 (June 2026) as the production release, so check freebsd.org/releases before you download.
- Static IP: set
ifconfig_em0anddefaultrouterin/etc/rc.conf, add DNS to/etc/resolv.conf, then runservice netif restart && service routing restart. - Forgot root password: boot single user, run
mount -urw /,mount -a, thenpasswd root. - Stuck at mountroot>: the kernel cannot find the root disk. Type
?to list disks and enter the right device.
In this guide
Install FreeBSD
- Pick the image. The Handbook lists bootonly and mini-memstick (small, need internet during install), disc1 (includes source and ports), dvd1 (adds common binary packages for offline install) and memstick (full install files on USB).
- Verify the download. Download the SHA256 or SHA512 checksum file from the same directory and compare it with the image hash. If they differ, download again.
- Write the image to a USB drive or burn it to disc, then boot from it.
- Run the installer. In order: keymap, hostname, installation type, optional components, (network install menu for bootonly media), disk partitioning (Auto ZFS, Auto UFS, Manual or Shell), then the files are fetched and extracted.
- Finish the post-install prompts: set the root password, configure the network interface (IPv4, IPv6, DNS), then accounts, time zone and services.
Auto (ZFS) is the sensible default on a modern server; choose UFS only if you have a reason to.
Network configuration
Find your interface name with ifconfig (the examples use em0; yours may differ).
Static IPv4
Add to /etc/rc.conf (values are examples):
ifconfig_em0="inet 192.168.1.150 netmask 255.255.255.0" defaultrouter="192.168.1.1"
Add your DNS servers to /etc/resolv.conf:
nameserver 8.8.8.8 nameserver 8.8.4.4
Apply the change:
service netif restart && service routing restart
The same two lines can be written with sysrc, for example sysrc defaultrouter="192.168.1.1".
DHCP
ifconfig_em0="DHCP"
Then run service netif restart. DHCP normally rewrites /etc/resolv.conf itself.
Hostname
hostname="freebsdhostname.example.com"
Check it with hostname.
Reset the root password
- Restart the system. At the boot menu choose Boot Single User, or press Escape and type
boot -sat the loader prompt. - Press Enter to accept the default shell and get a
#prompt. - Remount the root file system read-write:
mount -urw / - Mount the rest:
mount -afor UFS, orzfs mount -afor ZFS. - Set the password:
passwd root - Type
exitto continue booting.
If single-user mode still asks for a password, the console is marked insecure in /etc/ttys. Boot the install media, choose Live CD or Shell, mount the root partition (for example mount /dev/ada0p1 /mnt; chroot /mnt) and repeat the steps above. If the root partition will not mount, the disk may be encrypted; see the encrypted disks section of the Handbook.
Boot stops at mountroot>
Messages such as "Mounting from ufs:/dev/ad0s1a failed with error 19" mean the kernel could not find the root device. Typical causes seen in the FreeBSD forums:
- The disk name changed. For example
ad0becameada0after an upgrade, but the boot configuration or/etc/fstabstill names the old device. - A USB disk moved. A root drive that was
da1while the installer was plugged in becomesda0once it is removed. - Wrong partition scheme or fstab. The disk uses a different layout (GPT versus MBR) than the system expects, or fstab points several mount points at the same partition.
Fix it:
- At the
mountroot>prompt type?to list the disks the kernel can see. - Enter the root device in the form
ufs:/dev/ada0s1a(or the ZFS dataset, if you use ZFS) using the name you found. - Once booted, run
gpart showand check/etc/fstabso every entry names the right partition. Using labels instead of raw device names avoids the problem returning when device numbering shifts.
FAQ
Which interface name do I use?
Run ifconfig. Common names are em0, igb0, vtnet0 (virtual machines) and re0.
Do I need to reboot after editing rc.conf?
No. service netif restart and service routing restart apply network changes.
Can I reset a ZFS system's root password the same way?
Yes, but use zfs mount -a instead of mount -a before passwd root.
Thank you for your message.