How to Install XFCE on FreeBSD (Lightweight Desktop Guide)
bsd desktop bsd unix freebsd howto lightweight desktop open source os unix desktop unix operating system xfce xfce desktopSometimes, all you need from your FreeBSD system is a clean, fast desktop that gets out of your way. If you're looking for that perfect balance of lightweight performance and just enough customization, XFCE is often the ideal choice. Let's bring this classic desktop environment to your FreeBSD installation. Hi all, and welcome back to MusaBase! In today's article, I will guide you through the process of installing and configuring the XFCE desktop environment on your FreeBSD system.
In our previous walkthroughs, we covered how to set up KDE Plasma as a modern FreeBSD workstation and how to configure GNOME for a dual-desktop FreeBSD setup. In this follow-up, we are adding XFCE to that same system, providing a lightweight yet powerful alternative. In this comprehensive guide, you will learn how to:
- Prepare and configure your FreeBSD base system for XFCE
- Download and install the official XFCE packages
- Install the Xorg display server and the LightDM graphical login manager
- Configure procfs entries and essential input services
- Enable and initialize the necessary display services
- And finally, log into your new XFCE desktop environment
By the end of this guide, you will have a fully functional XFCE desktop environment running smoothly on your FreeBSD system. So without further ado, let's get started!
Prerequisites
This guide focuses specifically on the desktop configuration and does not cover the initial OS setup. To follow along, you should have a clean, working installation of the system. If you haven't reached this stage yet, you can refer to my walkthrough on setting up a foundational FreeBSD environment.
Once your base system is up and running, return to this tutorial to proceed with the XFCE installation. Having a solid base configuration ensures that the graphical components and display services integrate seamlessly.
Why Choose XFCE?
XFCE is a fast and lightweight desktop environment compared to KDE Plasma or GNOME because of its lower consumption of CPU resources. It is best suited for older hardware, systems with limited RAM, or for users seeking 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 (like me), XFCE will consume fewer host resources, leaving room for other tasks on the host (e.g., browsing, coding, etc.).
Step 1: System Baseline Update
Before we proceed with the XFCE installation, it is vital to synchronize the FreeBSD base system and its package repositories. While this step is technically optional, skipping it can lead to "version mismatch" errors where the desktop environment expects newer system libraries than what you currently have. A fully patched system ensures that all security fixes and the latest kernel improvements are active before we layer on the graphical interface.
1.1: Patching the FreeBSD Base OS
First, we focus on the core operating system. Unlike Linux, FreeBSD manages its base system separately from third-party apps. We use the freebsd-update utility to fetch and apply official binary patches.
- Run these commands to patch the core:
doas freebsd-update fetch
doas freebsd-update install
1.2: Syncing Third-Party Packages
With the base system patched, we now need to refresh the package manager’s database. This ensures that when we request XFCE, the system pulls the most recent stable version available in the FreeBSD ports tree.
- To update and upgrade your installed tools, run:
doas pkg update && doas pkg upgrade
Once the terminal confirms that your packages are up to date, your FreeBSD environment is officially ready for the desktop setup.
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 a display server or login manager; we will do that in the 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, and lightdm, a login manager. When we installed the 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 need to configure our fstab for the /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 with all packages 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 its variable to /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 rebooting, your PC should display the following login screen:
- Simply enter your user's password, and you will be on the XFCE home screen:
π Your FreeBSD Desktop is Ready!
Well, now you have a fully functional XFCE desktop session up and running on your FreeBSD system. XFCE is known for being incredibly lightweight, making it a perfect choice for those who want a fast, stable experience without high resource consumption. I will also be exploring modern Wayland compositors like Hyprland for FreeBSD in future guides, so stay tuned for those updates!
FreeBSD offers incredible flexibility with its desktop choices. Switch between environments to find what fits your workflow best.
101 out, I’ll see you in the next one! π


