FreeBSD is an excellent free operating system. The only downsides are the limited commercial support compared to Linux, and its lower visibility. It is a great operating system, extremely stable like every BSD, focused on performance.
The main thing to know about FreeBSD is compilation. The system is designed to be stable and finely tuned, by picking which options to add to binaries. Once you have a working FreeBSD system, unless you need new features, you only need to update it to patch security issues.
This article walks you through installing FreeBSD. We will use a VM with an 8 GB disk, 1 CPU, and 512 MB of RAM. Insert the CD and boot from it.
You can press Enter to boot immediately.
The installer offers to install, open a shell, or use the live CD. The last two are useful for repairing other FreeBSD systems. Pick Install.
We will now configure the keyboard.
We are using a French AZERTY keyboard with accents — that layout is perfect.
Configure the hostname (FQDN notation) of the machine here.
You are then offered to install several optional parts of the distribution: documentation, games, 32-bit libraries (if you have 32-bit binaries), the ports tree built into the ISO you downloaded, and the sources backing that ISO. I do not recommend pulling the ports tree from the CD; rather extract it once the installation is done with portsnap.
Here we uncheck everything and validate.
Now comes the formatting step. FreeBSD lets you be guided, do it manually, or open a shell to handle it yourself. The last option is useful, for instance, if you want your / partition on ZFS (which is a bit tricky). Pick Guided.
Choose between the whole disk or a single partition. Pick Entire Disk.
FreeBSD uses GPT partitions (just like Mac OS X, which sits on top of FreeBSD’s Mach microkernel layer). More documentation on GPT is available here.
By default, FreeBSD suggests putting everything in the / partition. That choice is debatable for some setups, but on this system there is little point separating /usr, /var, and /: ports install under /usr/local and keep most of their data there. If you wish, you can create a second /usr/local partition.
FreeBSD uses the UFS2 filesystem, known for being very stable albeit a bit slow. Since FreeBSD 9.0, UFS2 supports journaling (UFS2+J), which avoids very long fsck runs at boot.
Once your partition table is set up, pick Finish, then Commit.
Note: the red letter is the keyboard shortcut that activates the option.
The distribution then installs. The system first checks the checksum of each .txz before installing it. If the checksum fails, the component is not installed.
You exit the dialog to reach a shell prompt that runs the passwd command for the root user.
You are then asked to configure networking. Pick the network interface you want to use.
You can choose IPv4 only, IPv6 only, or both. After validating IPv4, you will be asked whether to use DHCP. Here we choose no.
Enter the IP address, mask, and router, then validate.
You are then asked whether to configure IPv6. Here we will not. Otherwise you will be asked to use router discovery or pick a static address.
You can then configure the DNS servers and the search domain.
You are then asked to configure the timezone. As usual I pick No at this question, then pick the timezone; for France, Europe then France. In winter you will be asked whether CET is fine. In summer it will be CEST.
You can now enable a few services. We only enable SSH, but you can also pick moused to get a console mouse, the NTP server to keep time in sync (very important), and powerd to save CPU.
You are then asked whether to enable crash dumps. Up to you — personally I don’t use them.
You can now add users to the system.
Fill in the various fields and validate. Note that on BSD, a user MUST be in the wheel group to use the su command.
Installation and configuration are done. You can reconfigure anything you got wrong, otherwise pick Exit.
You are offered once more to open a shell if you need to do something specific. Pick No, then Reboot.
The installation is now finished!
You now have a FreeBSD system in your hands. The three key things to remember about FreeBSD are:
/etc/rc.conf.portsnap to fetch and extract it).freebsd-update command.I strongly recommend reading the FreeBSD handbook, which is clear and covers all system administration topics in detail. It is also worth noting that migrating a FreeBSD installation does not break the system or third-party applications, unlike some Linux systems that don’t always upgrade smoothly.