In this article we will perform a step by step installation of FreeBSD 13 on Hetzner’s dedicated root server. While choosing the server specifications I recommend you read through the official hardware requirements of FreeBSD to avoid any unseen compatibility issues during the installation process. The installation of FreeBSD on Hetzner’s dedicated root servers is performed via the FreeBSD Rescue System.

FreeBSD is a very powerful operating system that powers many modern servers, desktops, and embedded platforms. The project has a large community that has continually developed it for more than thirty years. FreeBSD is very stable, secure, and with advanced networking and storage features. I’ve been a Linux veteran but keen on making some strides towards hosting of services on FreeBSD powered servers.

Follow the steps outlined in this tutorial to have a working installation of FreeBSD on Hetzner’s dedicated root server(s).

Step 1: Boot Hetzner root server into rescue mode

Login to your Hetzner Online Robot Account and select the server where the FreeBSD server installation will be performed.

Then go the the Rescue tab and pick FreeBSD OS version that you’ll boot to rescue session with.

Install FreeBSD on Hetzner Root Server With RAID 01
Select Operating system for Rescue system

Next select OS architecture and Public SSH key to be used if available.

Install FreeBSD on Hetzner Root Server With RAID 02 1

Then Activate the rescue system. If you didn’t have public ssh key in your account you can login using root user and password printed.

Install FreeBSD on Hetzner Root Server With RAID 03 1

Switch back to “Reset” tab and execute the automatic hardware reset of the server.

Install FreeBSD on Hetzner Root Server With RAID 04

SSH into the rescue system using the IP address shown in the IPs section.

$ ssh root@serverip
Warning: Permanently added 'serverip' (ECDSA) to the list of known hosts.
Enter passphrase for key '/Users/jmutai/.ssh/id_rsa':
FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021
-------------------------------------------------------------------

Welcome to the FreeBSD Rescue System.


To install a new FreeBSD operation system, run 'bsdinstallimage'
and follow the instructions.

More information at http://wiki.hetzner.de

-------------------------------------------------------------------


[root@rescue ~]#

Step 2: Validate hardware specs on the server

After a successful login to the rescue system, check your current disk setup using the command below:

[root@rescue ~]# geom disk list
Geom name: ada0
Providers:
1. Name: ada0
   Mediasize: 480103981056 (447G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   descr: SAMSUNG MZ7LM480HCHP-00003
   lunid: 5002538c403064dc
   ident: S1YJNX0H603512
   rotationrate: 0
   fwsectors: 63
   fwheads: 16

Geom name: ada1
Providers:
1. Name: ada1
   Mediasize: 480103981056 (447G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   descr: SAMSUNG MZ7LM480HCHP-00003
   lunid: 5002538c403064db
   ident: S1YJNX0H603511
   rotationrate: 0
   fwsectors: 63
   fwheads: 16

Install freecolor tool that will be used to check available memory:

# pkg install freecolor

Use it to show memory capacity in the server you ordered on Hetzner:

# freecolor -m
Physical  : [##################################.] 99%	(253724/255251)

As seen the total memory capacity is 255251 megabytes.

Step 3: Initiate FreeBSD 13 installation on Hetzner Root Server

Run the installer command bsdinstallimage on the rescue system terminal to begin FreeBSD OS installation on Hetzner.

[root@rescue ~]# bsdinstallimage

Select the version of FreeBSD to install – as of this article update the choices are 13.0, 12.2, and 11.4. I’ll got with 13.0

Install FreeBSD on Hetzner Root Server With RAID 05

Also select your CPU architecture

Install FreeBSD on Hetzner Root Server With RAID 06

Select mirror in the next FreeBSD installation screen. Just click OK to proceed with default selection.

Install FreeBSD on Hetzner Root Server With RAID 07

Step 4: Set Keyboard map, hostname, Components to install

Choose your Keyboard map from the list or continue with the default keymap.

Install FreeBSD on Hetzner Root Server With RAID 08

Set your system hostname that will be visible once you login to the server after installation. If you have a DNS server in your infrastructure map the name to an IP address that will be configured in networking section.

Install FreeBSD on Hetzner Root Server With RAID 09

Choose system components to enable on your BSD server. I recommend you enable Ports tree and System source tree.

Install FreeBSD on Hetzner Root Server With RAID 10

Step 5: Configure Disk Partitions – With RAID

There are multiple options for configuring your disk partition. The easiest is the Guided root on ZFS / UFS setup. If you’re an experienced FreeBSD user you can use Manual disk setup.

Install FreeBSD on Hetzner Root Server With RAID 11

For RAID configuration click on “T Pool Type/Disks

Install FreeBSD on Hetzner Root Server With RAID 12

Pick your Virtual Device type of choice from the list. Note that the option selected is limited by the number of hard disks available on the server. I have two hard disks that will be configured in Stripe RAID (Level 0) for maximum capacity and zero redundancy.

Install FreeBSD on Hetzner Root Server With RAID 13

Select the hard disks from the list to use in RAID configuration. I’ll select both disks:

Install FreeBSD on Hetzner Root Server With RAID 14

Also choose partition table, encryption if you need to enable, Pool name, swap size e.t.c

Install FreeBSD on Hetzner Root Server With RAID 15

When done proceed with the installation.

Install FreeBSD on Hetzner Root Server With RAID 16

Step 6: Install FreeBSD 13 on Hetzner dedicated server

You have to agree to data destruction before you can proceed.

Install FreeBSD on Hetzner Root Server With RAID 17

Installation process begins shortly. All required distribution files are fetched by the installer.

Install FreeBSD on Hetzner Root Server With RAID 18

If you have a decent internet connection the process should finish within a few minutes.

Install FreeBSD on Hetzner Root Server With RAID 19

Step 7: Configure Network Interface on FreeBSD

Next you choose should select a network interface to configure.

Install FreeBSD on Hetzner Root Server With RAID 20

Configure IP addressing for the interface – IPv4

Install FreeBSD on Hetzner Root Server With RAID 21

Use DHCP or Static IP address configurations

Install FreeBSD on Hetzner Root Server With RAID 22

Set search domain and DNS servers

Install FreeBSD on Hetzner Root Server With RAID 25

Step 8: Set Local Time, Timezone, Region and NTP

Select local or UTC time.

Install FreeBSD on Hetzner Root Server With RAID 26

Select your timezone region. I’m in Africa.

Install FreeBSD on Hetzner Root Server With RAID 27

Select your country from the list displayed after choosing the region.

Install FreeBSD on Hetzner Root Server With RAID 28

Confirm country or region abbreviation.

Install FreeBSD on Hetzner Root Server With RAID 29

Set date correctly as shown in my example -Year, Month and date.

Install FreeBSD on Hetzner Root Server With RAID 30

Time initial configuration is also performed at the next step

Install FreeBSD on Hetzner Root Server With RAID 31

Enable ntp services for automatic clock synchronization on your FreeBSD system.

Install FreeBSD on Hetzner Root Server With RAID 32

Step 9: Add Local user and set root password

Agree to add users to your newly installed FreeBSD system

Install FreeBSD on Hetzner Root Server With RAID 33

Input your user information details:

FreeBSD Installer
========================
Add Users

Username: jmutai
Full name: Josphat Mutai
Uid (Leave empty for default):
Login group [jmutai]:
Login group is jmutai. Invite jmutai into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/jmutai]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username   : jmutai
Password   : *****
Full Name  : Josphat Mutai
Uid        : 1001
Class      :
Groups     : jmutai wheel
Home       : /home/jmutai
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (jmutai) to the user database.
Add another user? (yes/no): no

Let’s reset root user password:

Install FreeBSD on Hetzner Root Server With RAID 34 2

Provide and confirm the root user password:

FreeBSD Installer
========================

Please select a password for the system management account (root):
Typed characters will not be visible.
Changing local password for root
New Password: <New-Password>
Retype New Password: <Confirm-Password>

Step 10: Download Handbook and Complete FreeBSD installation

Download FreeBSD documentation to your local FreeBSD system

Install FreeBSD on Hetzner Root Server With RAID 35

Documentation is available in many languages. Choose the one that works for you.

Install FreeBSD on Hetzner Root Server With RAID 36

The installation of FreeBSD on Hetzner dedicated root server is now complete.

Install FreeBSD on Hetzner Root Server With RAID 37

This shell is operating in a chroot in the new system. When finished making configuration changes, type “exit”.

root@rescue:/ # exit

Perform Post installation functions to finalize the installation process.

Install FreeBSD on Hetzner Root Server With RAID 38

It will mount the filesystem

Install FreeBSD on Hetzner Root Server With RAID 39

Copy post-install script

Install FreeBSD on Hetzner Root Server With RAID 40

Unmount filesystem

Install FreeBSD on Hetzner Root Server With RAID 41

And now you have completed the installation of FreeBSD on Hetzner root server. You can safely reboot the server to start using the new operating system.

Install FreeBSD on Hetzner Root Server With RAID 42

Reboot FreeBSD installed operating system:

root@rescue:/ # reboot

Wait for the server to come up then access it via SSH.

$ ssh root@serverip
Warning: Permanently added 'serverip' (ECDSA) to the list of known hosts.
Password for root@freebsd13:

You can optionally copy SSH key to the server.

ssh-copy-id root@serverip

Update and upgrade FreeBSD system:

freebsd-update fetch
freebsd-update install
pkg update
pkg upgrade

Check OS release:

# cat /etc/os-release
NAME=FreeBSD
VERSION=13.0-RELEASE
VERSION_ID=13.0
ID=freebsd
ANSI_COLOR="0;31"
PRETTY_NAME="FreeBSD 13.0-RELEASE"
CPE_NAME=cpe:/o:freebsd:freebsd:13.0
HOME_URL=https://FreeBSD.org/
BUG_REPORT_URL=https://bugs.FreeBSD.org/

Conclusion

We have covered a basic installation of FreeBSD system on Hetzner dedicate root server. You can further adjust the settings to your needs at the time of installation or after the system is installed. The official FreeBSD installation handbook can be referenced during the installation.

Recommended Books:

More resources:

LEAVE A REPLY

Please enter your comment!
Please enter your name here