HxHippy

FreeBSD Installation Guide

Step-by-step guide to installing FreeBSD on physical or virtual hardware.

Last updated: 2025-01-15

Before You Begin

System Requirements

  • 64-bit CPU (amd64) or ARM64 for modern FreeBSD
  • Minimum 1GB RAM (4GB+ recommended)
  • 8GB+ disk space (20GB+ recommended for ZFS)
  • Network connection for pkg downloads

Download FreeBSD

# Download from freebsd.org
# Choose: amd64 -> ISO-IMAGES -> 14.0 (or latest)
# Options:
#   - disc1.iso: Full installer
#   - memstick.img: USB installer
#   - bootonly.iso: Network installer

Creating Boot Media

USB Drive

# Linux/macOS
sudo dd if=FreeBSD-14.0-RELEASE-amd64-memstick.img of=/dev/sdX bs=1M conv=sync

# Windows: Use Rufus or Win32DiskImager

Installation Process

Boot the Installer

  1. Boot from USB/CD
  2. Select Install at the welcome screen
  3. Choose keyboard layout

Set Hostname

Enter your system's hostname (e.g., freebsd-server)

Select Components

  • base-dbg: Base system debug symbols
  • kernel-dbg: Kernel debug symbols
  • lib32: 32-bit compatibility libraries
  • ports: Ports collection (optional, can fetch later)
  • src: System source code
  • tests: Test suite

Recommended: Select at least ports and src

Partitioning

Select: Auto (ZFS)
├── Pool Type: stripe (single disk) or mirror (2+ disks)
├── Encrypt Disks: Optional (GELI encryption)
├── Partition Scheme: GPT (modern) or MBR (legacy)
├── Swap Size: 2-4GB recommended
└── Select disk(s) to use

Auto (UFS)

Select: Auto (UFS)
├── Partition Scheme: GPT
├── Review/modify partitions if needed
└── Proceed with installation

Manual Partitioning

# Typical GPT layout:
freebsd-boot    512K    # Boot code
freebsd-swap    4G      # Swap space
freebsd-zfs     rest    # ZFS root

Network Configuration

Select network interface (e.g., em0, igb0)
├── IPv4: Yes
│   ├── DHCP: Yes (or static)
│   └── If static: Enter IP, subnet, gateway
├── IPv6: Optional
└── DNS: Auto from DHCP or manual

Set Time Zone

Select region -> country -> timezone
Set date/time if not using NTP

Services to Enable

[x] local_unbound  - Local DNS resolver
[x] sshd          - SSH server
[x] moused        - Console mouse (optional)
[x] ntpdate       - Time sync at boot
[x] ntpd          - NTP daemon
[ ] powerd        - CPU frequency scaling
[x] dumpdev       - Crash dumps

Security Hardening

[x] Hide processes from other users
[x] Hide processes from other groups
[x] Disable reading kernel message buffer
[x] Disable process debugging
[x] Randomize PID
[x] Insert stack guard page
[x] Clean /tmp at startup
[x] Disable Sendmail service

Set Root Password

Enter a strong root password

Add User

Add user account? yes
Username: yourusername
Full name: Your Name
UID: (accept default)
Login group: (accept default)
Other groups: wheel (for sudo access)
Login class: (accept default)
Shell: /bin/sh or /usr/local/bin/bash (after installing)
Home directory: /home/yourusername
Use password-based auth: yes
Lock account: no

Final Configuration

  • Make any final changes
  • Exit installer
  • Reboot

Post-Installation Verification

# Check FreeBSD version
freebsd-version

# Verify network
ifconfig
ping -c 3 google.com

# Check ZFS pool (if using ZFS)
zpool status

# View disk usage
df -h

Troubleshooting

Boot Issues

  • UEFI: Ensure Secure Boot is disabled
  • Legacy: Check boot order in BIOS
  • ZFS: Try booting from recovery menu

Network Issues

# Check interface status
ifconfig em0

# Restart networking
service netif restart
service routing restart

Graphics Issues (Console)

# Add to /boot/loader.conf for better console
kern.vty=vt
beginner Getting Started Updated 2025-01-15
  • freebsd
  • installation
  • setup
  • bsdinstall
  • zfs
  • uefi