Install XFCE on FreeBSD: The Ultimate Lightweight Desktop Environment
BSD Desktop Env FreeBSD Guide InstallationHi all, welcome to MusaBase! In today's article, I'll guide you through installing and configuring the Xfce desktop environment on a FreeBSD sysem. In the previous guides, I showed you how to install KDE Plasma and GNOME on FreeBSD, and in this follow-up, we will install XFCE on that same FreeBSD system. In this comprehensive guide, you'll learn how to:
- Configure your FreeBSD system for XFCE
- Download and install the XFCE packages for FreeBSD
- Install the Xorg display server and a the lightdm graphical display manager
- Configure proc entries for input services
- Enable and run display services
- And finally, log into the XFCE desktop environment
By the end of this guide, you'll have a fully functional XFCE desktop environmnet running on your FreeBSD system. So without further ado, let's get started.
This guide won't cover the installation of FreeBSD. To install FreeBSD, please visit my Complete FreeBSD Installation guide, and follow the steps to install a fully functional FreeBSD OS. After completing the installation come back to this guideand continue on installing XFCE.
Why Choose XFCE?
XFCE is fast and lightweight desktop environment as compare to KDE Plasma or GNOME beacuse of its less consumption on CPU and is best suited for older hardware, limited RAM space or for a snappier response.
- Older or low-spec hardware: XFCE will respond faster on Laptops or desktops with limited RAM/CPU.
- Virtual machines: If you want to run FreeBSD inside a VM (as me), Xfce will consume fewer host resuources, leaving room for other tasks on host (e.g., browsing, coding, etc).
Step 1: Prepare FreeBSD System for DE
First, we need to update the FreeBSD OS itself and installed packages. Though its optional but, by updating and upgrading system and system packages we ensure our system is up-to-date and has the latest available packages and their correct dependencies. If we continue without updating, then the package installer might try to pull in outdated or missing packages, that will conflict in dependencies and may result failure in new package installation.
1.1: Update FreeBSD OS
- Run:
doas freebsd-update fetch
doas freebsd-update install
#OR
sudo freebsd-update fetch
sudo freebsd-update install
1.2: Update Packages
- Run:
doas pkg update && doas pkg upgrade
#OR
sudo pkg update && sudo pkg upgrade
Step 2: Install XFCE
Installing Xfce is really simple we only need to run a single command which will install XFCE and its required dependencies. But it will not install display server or login manager, we will do that in next step.
- Run:
doas pkg install xfce
#OR
sudo pkg install xfce
Step 3: Install Display Server and Configure Services
Next, we need to install Xorg a display server, ligthdm a login manager. When we installed xfce meta package in the previous step, it only installed dependencies and other packages required by Xfce. In order to run an actual Graphical environment we need the display server and also configure our fstab for /proc filesystem.
3.1: Add proc entry at Fstab
- Run:
doas nano /etc/fstab
#OR
sudo nano /etc/fstab
- In the fstab file,add the following line:
#Device Mountpoint Fstype Options Dump Pass#
proc /proc procfs rw 0 0
- After adding the entry, press CTRL + O to save the changes then press ENTER to apply the changes, then press CTRL + X to exit the file.
3.2: Install Xorg Display Server
- Next, we will install our display server.
- Run:
doas pkg install xorg
#OR
sudo pkg install xorg
3.3: Install Lightdm Login Greeter
- Run:
doas pkg install lightdm lightdm-gtk-greeter
#OR
sudo pkg install lightdm lightdm-gtk-greeter
3.4: Enable Display Services
Now wth all packages are installed, we only need to enable D-Bus and lightdm and reboot the PC to log into our freshly installed Xfce desktop environment.
3.4.1: Enable D-Bus Service
- To enable dbus, we need to add the its variable at /etc/rc.conf.
- Run:
doas nano /etc/rc.conf
#OR
sudo nano /etc/rc.conf
- In the opened file add:
sysrc dbus_enable="YES"
3.4.2: Enable LightDM
- Do the same for lightdm:
doas nano /etc/rc.conf
#OR
sudo nano /etc/rc.conf
- Add the following line:
sysrc lightdm_enable="YES"
3.5: Reboot
- Run:
reboot
Step 4: Log into XFCE
After reboot your PC should have the following login screen:
- Simply enter your user's password and you will be in XFCE home screen:
Well now you have fully functional XFCE desktop session up and running on your FreeBSD system. You can also install multiple desktop sessions like KDE Plasma and GNOME on FreeBSD and also switch between any of them seamlessly. I'll try to upload guides on other desktop sessions or wayland compositor like Hyprland installation on FreeBSD also, stay tuned for that.
If you hit any error at any step or having problem while logging into desktop session, please let me know in the comments, I'll be more than happy to help.
This is it, 1O1 out, I'll see you in the next one!



