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 desktop
Sometimes, 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 and Update 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:
Frequently Asked Questions: XFCE on FreeBSD
Why should I choose XFCE as my desktop environment on FreeBSD?
XFCE is a lightweight, fast, and modular desktop environment that consumes fewer system resources compared to heavier environments like KDE Plasma or GNOME. It is ideal for older hardware, systems with limited RAM, virtual machines, or users who prefer a snappy and responsive interface. XFCE provides a clean and traditional desktop experience while staying out of your way, making it a perfect match for FreeBSD's philosophy of simplicity and performance.
What are the prerequisites for installing XFCE on FreeBSD?
You need a working FreeBSD base system with internet connectivity and doas (or sudo) privileges for administrative commands. If you haven't installed FreeBSD yet, you can follow a base installation guide first. A stable internet connection is required to download packages. For a smooth graphical experience, at least 2GB RAM is recommended, though XFCE can run on less.
How do I install XFCE on FreeBSD?
Install the XFCE meta‑package with a single command:
doas pkg install xfce
This pulls in all core components: the window manager, panel, session manager, settings daemon, and essential utilities. The xfce package is a meta‑package, meaning it installs everything you need for a functional XFCE desktop.
Why do I need to add a procfs entry to /etc/fstab?
The procfs filesystem provides process‑tree information that some graphical tools and utilities expect to exist. Without it mounted at /proc, certain components may fail silently, potentially causing issues with the login greeter or session startup. Adding the following line to /etc/fstab ensures it is mounted automatically:
proc /proc procfs rw 0 0
What is Xorg and why do I need to install it separately?
Xorg is the display server that provides the foundational graphical layer for the desktop environment. FreeBSD does not include a graphical stack by default; it only gives you a text console. The xorg package installs the X Window System server, libraries, and utilities needed to display windows, icons, and other graphical elements. Install it with:
doas pkg install xorg
Why do I need LightDM? Can I use another display manager?
LightDM is a display manager that provides a graphical login screen, handles user authentication, and starts the user session. While you can use other display managers like SDDM or GDM, LightDM with its GTK greeter is lightweight and integrates well with XFCE's minimalist philosophy. Install it with:
doas pkg install lightdm lightdm-gtk-greeter
How do I enable D-Bus and LightDM to start automatically?
Edit the /etc/rc.conf file to add the necessary service entries. You can do this manually with a text editor or use the sysrc command:
doas sysrc dbus_enable="YES" doas sysrc lightdm_enable="YES"
D-Bus is an inter‑process communication system required for many desktop applications to function correctly. Enabling these services ensures they start at boot.
What should I do if LightDM starts but the screen is blank or returns to the console?
A brief black screen is normal as the display manager initialises. If it stays black or drops you back to the terminal, check the following:
- Ensure procfs is correctly mounted (verify with mount | grep proc).
- Confirm that dbus_enable and lightdm_enable are set to YES in /etc/rc.conf.
- Check that xorg and xfce were installed without errors.
- Look at the Xorg log file (/var/log/Xorg.0.log) for any driver‑related issues.
- If using a virtual machine, ensure 3D acceleration is enabled in the VM settings.
Can I install XFCE alongside other desktop environments on FreeBSD?
Yes, FreeBSD supports multiple desktop environments. You can install KDE Plasma, GNOME, or others alongside XFCE. After installing, you can choose which environment to start by selecting the appropriate session from the LightDM login screen (usually accessible via a small icon or menu). Each desktop environment keeps its own configuration files, so they won't interfere.
How do I update XFCE and related packages after installation?
Regular package updates will keep XFCE up to date. Simply run:
doas pkg update && doas pkg upgrade
This will upgrade all installed packages, including XFCE components, to the latest versions available in the FreeBSD repository. For base system updates, continue to use freebsd-update.
What are the most common mistakes when installing XFCE on FreeBSD?
- Forgetting to mount procfs in /etc/fstab, which can cause session or login issues.
- Not enabling dbus and lightdm in /etc/rc.conf.
- Skipping the system update (freebsd-update and pkg upgrade) before installing XFCE, leading to dependency conflicts.
- Installing XFCE but forgetting to install xorg, resulting in a missing graphical server.
- Using the wrong display manager or not installing a greeter (lightdm-gtk-greeter).
π 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! π

