In this guide, I am going to show you how to install FreeBSD with KDE the easy way using a script as well as how to find the software you need in the FreeBSD repositories.
I’ve been using FreeBSD for servers for a long time now. It is insanely stable, secure, and feels significantly faster than most Linux distributions I used. Lately, I was flirting with the idea of switching to FreeBSD with KDE as my daily driver.
There are many reasons to choose FreeBSD over something else. Here are some that matter the most for me:
- FreeBSD’s file system is clean and incredibly well organized. You only need to remember the location of a few configuration files to perform any changes in your system.
- Contrary to some “gurus”, there is plenty of software available on FreeBSD, and honestly, there is nothing I miss from Linux repos that I cannot have on FreeBSD.
- The community is amazingly supportive and even if I indulge myself in a stupid question once in a while, there is always someone out there willing to help without getting nasty.
- Last but not least, FreeBSD documentation is probably the best there is. And yes, I still am a hardcore Arch Linux user – you know what I mean.
Installing FreeBSD with KDE from scratch usually takes anywhere between 1 to 2 hours and depends mostly on how fast your Internet speed is and how quickly you can follow this guide.
Grab a cup of coffee and let’s get down to work.
Step 1: Download The FreeBSD ISO
At the time of writing this post, FreeBSD 13.0 is the latest release. Head over to the official FreeBSD download page. Click on the amd64 link.
NOTE: If you are using an old computer or different architecture [e.g., ARM], select the respective link in the list.
Click on the larger .iso file in the list. Alternatively, you can start the FreeBSD amd64 iso by clicking HERE.
Step 2: Prepare The FreeBSD USB Installer
If you follow this guide to install FreeBSD on a virtual machine, ship this step.
Download and install Balena Etcher and insert a USD stick of a minimum of 8 GB in your computer. All data on your USB stick will be deleted so make sure you don’t have important files on it.
Once the FreeBSD download is completed, open Etcher and perform the following three steps:
- Click on Flesh from file, browse and select the FreeBSD iso you downloaded above.
- Click on Select target and make sure you select the USB stick you inserted earlier from the list of devices.
- Click Flesh! and relax for the next 10-15 minutes.
Step 3: Boot On The FreeBSD USB Installer
A word of warning before we proceed with the installation. If you choose to dual-boot with another operating system, I would highly recommend you to leave only the drive you plan to install FreeBSD on connected to your computer and disconnect the others. Better be safe than sorry.
Assuming your computer is turned off, insert the FreeBSD USB installer and power on your machine. Launch the boot loader when the computer starts.
I’m using a Gigabyte motherboard and in my case the function key is F12. Other systems may have F10 or F12 keys assigned to the boot loader. Alternatively, you can configure the boot loader order in your BIOS.
If everything is good, you should be seeing the Welcome to FreeBSD screen. Push the ENTER key or wait for 10 seconds for the installer to start.
Step 4: FreeBSD Installation
Once the FreeBSD installer is loaded, on the Welcome window select Install [Enter].
NOTE: Use the keyboard arrows and the Tab key to navigate through the FreeBSD installation menu.
On the Keymap Selection window, choose your keyboard map. The default keymap in FreeBSD is the US so if you are an English speaker you won’t need to change anything.
Once done, select Continue with… [Enter].
On the Set Hostname window, type a name, e.g., freebsd for your hostname, and select OK.
On the Distribution Select window, make sure you select [spacebar] the ports and src as optional system components to install. Select OK and hit ENTER.
On the Partitioning page, you can choose to partition your disk automatically with ZFS, UFS or if you are an expert you can choose Manual Disk Setup or use the Shell to perform the disk partitioning by hand.
I am a big fan of ZFS [Z File System] and since I have only one disk in my system I will choose Auto (ZFS) this time. Select OK and hit Enter.
On the ZFS Configuration window, you can mirror, encrypt or increase your swap size, encrypt your disk, or change the pool name among others.
The default settings are sufficient for my needs so I will Proceed with Installation. Press the ENTER key to continue.
If you are not using Mirror or RAID configurations [requires multiple physical disks], select Stripe and OK [Enter] to continue.
Next, select [spacebar] the disk you want to install FreeBSD on, and OK [Enter] to continue to the next step.
The FreeBSD installer will warn you this is your last chance to review your settings before being written to your disk. All the existing data on the selected disk will be permanently destroyed. Choose YES [Enter] to proceed with the installation.
The FreeBSD installer will now proceed to install the base, kernel, lib32, ports, and src system components. This step is performed very fast so you don’t need to take a break yet.
Next, you will be asked to configure the root password. Type a strong password and confirm it when asked.
On the Network Configuration window, choose your network device and select OK [Enter].
Next, the FreeBSD installer will ask you if you want to configure the IPv4 for your interface. Select Yes [Enter].
Similarly, choose Yes [Enter] when asked if you want to configure the DHCP for this network device.
When prompted to configure IPv6 for your network interface, select No [Enter].
The FreeBSD Network Configuration will automatically look for the DHCP server and configure your network interface with the appropriate settings. Select OK [Enter] to continue.
On the Time Zone Selector window, choose your region and select OK [Enter]
Next, select your country. In my case, it is the United States of America. Select OK [Enter].
When prompted, select a zone that observes the same time as your locality. In my case, the nearest time zone is the Louisville area. Select OK [Enter] to continue.
NOTE: if you are prompted if your abbreviation ‘’ looks reasonable, choose Yes [Enter].
Double-check if the FreeBSD installer detected your date and time correctly. Alternatively, you can skip this step and adjust the time and date later. Select OK [Enter].
On the System Configuration window, select [spacebar] which services you would like to start at boot. You can leave the defaults here or check additional settings such as system and network time, enable kernel dumps in case of a crash, or the PS2 mouse service.
FreeBSD is a secure system by default. But if you want to perform some extra-hardening, you can do so in the System Hardening window.
My usual FreeBSD hardening settings are those included from options 5 to 10. If your computer is connected to a larger network, you can check all options. Once done, select OK [Enter].
Next, we will proceed to create a normal user. Select Yes [Enter] on the Add User Accounts window
On the Add Users terminal window, follow the instructions in the table below. You will be prompted step-by-step to insert user-related information. You can hit the ENTER key to choose the default settings.
|Username:||Type your desired username|
|Full Name:||Type your name|
|Login Group is <username>||wheel video operator|
|Login Class [Default]:||[ENTER]|
|Shell (sh csh tcsh nologin) [sh]||[ENTER] to choose the sh shell.|
|Home directory [/home/<username>]||[ENTER]|
|Home directory permissions:||[ENTER]|
|Your password-based authentication?||[ENTER]|
|Use an empty password? [no]||[ENTER]|
|Use a random password? [no]||[ENTER]|
|Enter password:||Type the password for your user|
|Enter password again:||Confirm the password for your user|
|Lock out the account after creation? [no]||[ENTER]|
|Add another user? (yes/no)||Type no in case you don’t want to add an additional user. Yes otherwise|
Here is how your Add Users account creation section should look like.
On the Final Configuration window, you can review or change any settings you configured so far [excluding partitioning]. Once you select OK [Enter] the installer will start configuring the FreeBSD system accordingly.
And finally, we reached the end of the FreeBSD installation. If you want to perform any manual modifications to your system, you can choose to do so via a shell here. If everything is nice and dandy, choose No [Enter].
That’s it! FreeBSD is now installed on your computer. All that is left now is to reboot the system. Select Reboot [Enter].
Once the system reboots, you should be greeted with the FreeBSD welcome screen. Hit the ENTER key and wait for the system to boot.
If you are greeted by a login prompt, congratulations! You successfully installed FreeBSD on your computer. Login using your root account and type the root password when prompted.
FreeBSD does not provide any choice for a Desktop Environment [DE] or Window Manager [WM] during the installation. That doesn’t mean we can’t install a GUI. In fact, a plethora of DEs and WMs are available on FreeBSD.
Step 5: Update FreeBSD
Let’s make sure our newly installed FreeBSD system is up-to-date before doing anything else. To check your system for updates, type the following command in the terminal:
FreeBSD will now check your system for updates and fetch the files to be updated. Press the Q key twice to exit the list.
Now let’s instruct FreeBSD to install the updates by using the following command:
Very fast right? Your FreeBSD system is now fully updated.
Step 6: Install KDE on FreeBSD
Alright. If you reached this step, I’m really proud of you! Now, let’s install a DE on our machine and make it usable for daily use.
There are a few ways to install KDE on FreeBSD. By far, the easiest way is using a little script called desktop-installer.
The desktop-installer assists you in installing over a dozen DEs and WMs in an interactive way while performing all the necessary configurations without user input. The script will automatically detect your sound card and GPU card, download and install the necessary drivers. It will also install Xorg and assist you in testing it.
If you install FreeBSD with KDE on a virtual machine [VirtualBox, VMWare, Parallels, etc.] right now, the desktop-installer will automatically detect, install and configure all the necessary drivers and tools. Isn’t that amazing?
Desktop-installer script must be run as the superuser, so before you start make sure you are logged in as root.
To install the desktop-installer on your system, type the following command:
pkg install desktop-installer
FreeBSD will detect that we launch pkg [package manager] for the first time and will download and configure it for us. Type Y [Enter] to proceed with the pkg installation.
And again type Y [Enter] to proceed to install the required packages.
Launch the desktop-installer script by executing the following command.
Once the script is launched, read the instructions and press the ENTER key to continue.
NOTE: You most likely have to reboot and re-run desktop-installer at least once or twice during this installation. The script will automatically remember [detect] the previous executed steps so you don’t have to go through the entire process again.
The default choice will be marked with [ ] and can be executed by pressing the ENTER key. The choices are not case sensitive.
Next, desktop-installer will provide you with additional information. Go ahead and read it and once done, press again the ENTER key.
Type 1 [Enter] for Just the essentials. If you are not a beginner, and want to have more granular access to the configuration [firewall, source packages, etc.] choose Advanced options.
In the next screen, you can choose if you want to use the quarterly ports/packages or bleeding-edge. I prefer stability so I will leave the default N [Enter] to continue.
NOTE: changing from quarterly to bleeding-edge or vice-versa is not an easy task, so make sure you know what you’re doing if you choose differently.
Type N [Enter] when prompted to create a shallow Git clone.
When prompted to update and reboot the system, type N [Enter] as we have already updated in Step 5.
NOTE: In case you accidentally proceeded with the update, reboot the system, launch the desktop-installer. Choose n when prompted again to update and reboot the system.
In the next screen, you can choose the DE or WM you want to install on FreeBSD. As you see, there are plenty of choices here. As in this guide, we plan to install FreeBSD with KDE, we will choose option 8 [Enter].
If your system has a sound device, the script will detect it and ask if you want to configure it. If so, type Y [Enter].
Next, the script will start the Xorg [display server], KDE, and SDDM [login manager] packages installed on your system.
Press the ENTER key and take a well-deserved break. This step can take up to one hour, mainly depending on your Internet speed. There are no prompts during this step.
Once you’re back, you will be prompted to reconfigure X11 and your desktop. Press ENTER to confirm the default option [y].
Next, your GPU will be detected and graphic drivers installed. Press ENTER to confirm the default choice [y].
My machine is equipped with two Nvidia GTX 1070 graphic cards and they are both detected and configured without any issues.
Once your graphic card is configured, it is time to test if X11 is working. This is an important step as if X11 doesn’t work, most likely KDE will not either. Hit ENTER to accept the default y.
Be patient as X11 tests can take up to one minute in some cases. During this time the resolution will likely change a few times.
Voila! X11 and KDE work great. Now log off from KDE [do not reboot or shutdown] to return to the desktop-installer.
In case you get a black screen during this step, most likely your GPU is not yet supported and you will have to switch to a generic graphic driver. Press CTRL+ALT+F1 key combination to return to the terminal and reboot the system.
Boot as a single-user [FreeBSD boot screen] and once logged in execute the following commands in the terminal:
mount -u -o rw
Remove the kms module [radenonkms, i915kms, etc.] from kld_list setting [or commend the line by adding # in front]. Save and exit the ee editor by pressing the ESC key to save and exit.
Reboot the system, run desktop-installer again and choose N when prompted to detect the graphic card.
The next section will configure the X11 forwarding over ssh [sshd daemon]. Type Y [Enter] to configure the X11 forwarding over ssh.
Type N [Enter] to deny all forward X11 hosts for security reasons.
Type N [Enter] to accept forwarded X11 displays from other hosts via ssh.
Next, the desktop-installer script will configure the SDDM [login manager for KDE]. Press ENTER to continue.
Type Y [Enter] to enable the SDDM login.
Press ENTER to test the SDDM. If you follow this guide in a virtual machine, use CTRL+ALT+F1 to return to the desktop-installer console. We are not yet done.
On the SDDM interface, click the Desktop Session drop-down menu and switch from Plasma (Wayland) to Plasma (X11). Wayland is not ready yet for prime time on FreeBSD and can cause many issues.
Login in SDDM to test if the KDE is loading properly.
If you experience display resolution issues in KDE at this point [especially in virtual machines], click on the KDE logo > Settings > System Settings > Display Configuration and adjust the resolution accordingly to your display.
Once done, hold CTRL+ALT+F1 keys to return to desktop-installer to continue. We still have a few steps left.
Next, choose if you want bsdstats [telemetry] to be installed on your system. I will choose Y [Enter] to support the FreeBSD project to collect anonymous data to develop drivers and ports based on stats collected from the end-user. This is important to help FreeBSD grow its user base.
In the next section, you will be asked if you want to install some common software on FreeBSD.
You can always install software from repositories or ports later.
Type Y [Enter] you want to install Mozilla Firefox on FreeBSD.
Type Y [Enter] if you want Mozilla Thunderbird as your email client on FreeBSD.
If you need an office suite on FreeBSD, you can’t go wrong with LibreOffice. Type Y [Enter] to install it.
The VLC media player doesn’t need any introduction. If you want to install VLC on FreeBSD, type Y [Enter].
And finally, the desktop-installer will install the Desktop Admin – a script that allows you to update your system easily, perform user management or install additional software in FreeBSD. Type got it [Enter].
And there it is. Your FreeBSD with KDE Plasma is now installed. On the Auto Admin screen type 4 [Enter] to shut down the system.
Power on the machine and wait for the magic to happen.
There you have it – FreeBSD 13 installed with KDE Plasma 5. And man, KDE looks and feels awesome on a FreeBSD system.
If you installed FreeBSD in a virtual machine, make sure you are able to access the Internet. Open the terminal and run the following command:
If the command returns “Unknown Host,” the issue is likely related to the DNS configuration in FreeBSD and HERE is how to fix it in a few simple steps.
Step 7: Install SUDO on FreeBSD
We don’t want to switch to superuser each time we need elevated privileges in FreeBSD. Sudo is a quick way to execute specific commands that require elevation without having to become root.
To install sudo on FreeBSD, open a terminal by clicking the KDE Logo > System > Konsole and type the command below. Enter your root password when prompted.
Install sudo by executing the following command:
pkg install sudo
Next, we need to edit the sudoers file and add your user to it using the following command:
Use your keyboard arrows to navigate and find the line root ALL=(ALL) ALL in the file. Type the letter i to switch to the insert mode.
Add the following line below the root ALL=(ALL) ALL, by replacing <your username> with your actual username.
<your username> ALL=(ALL) ALL
Once done, press the ESC key to exit the insert mode and type :wq! to save and exit the sudoers file.
Switch to the normal user by typing in the terminal:
BONUS: Install Additional Software in FreeBSD
The easiest way to install software on FreeBSD is to use the pkg utility or compile binaries from ports. But if you prefer to manage your packages using a GUI, read How To Install a GUI Package Manager in FreeBSD [OctoPkg].
To search for software using pkg, use the following command:
sudo pkg search <name of the package>
Above I did a search for kdenlive [a potent open-source video editor] using the pkg search command. Let’s go ahead and install kdenlive on FreeBSD.
sudo pkg install kdenlive
And here it is:
To find out where Kdenlive is installed type the command:
To uninstall an application in FreeBSD type in the terminal the following command:
sudo pkg remove <name of the package>
A great resource for FreeBSD software is the freshports. Here you can find everything you need, pkg, ports, applications, etc. Type what you’re looking for in the site’s search and copy/paste the installation commands in your terminal. Simple enough?
That’s it! You just installed FreeBSD with KDE Plasma 5 on your computer or on a virtual machine. You may also want to check how to install FreeBSD with XFCE and NVIDIA Drivers.
From here on, I guarantee you won’t get bored. Go ahead and try different desktop environments and window managers, customize them, install new software, and most importantly, be productive.
And if you tinker too much and run into issues, the FreeBSD documentation and forum will never disappoint you.
FreeBSD with KDE has been such a smooth experience for me so far. My system is stable, secure, clean, and super-fast! Give it a try on real hardware and you won’t be disappointed.