How to Install Xfce on CentOS Stream

XFCE provides a fast, resource-efficient desktop environment that runs smoothly on older hardware, virtual machines, and systems where you want maximum performance without sacrificing usability. Whether you need a lightweight alternative to GNOME for minimal VPS setups, a responsive environment for remote desktop sessions over slow connections, or a minimal desktop for server administration tasks without the overhead of modern compositing, XFCE delivers a clean interface with low memory overhead. By the end of this guide, you will have XFCE installed on CentOS Stream 9, configured as an available session at login, and ready to use as your primary or secondary desktop environment.

XFCE is currently available for CentOS Stream 9 only. As of December 2025, the Xfce group is not available in EPEL 10 for CentOS Stream 10 (Docker-verified), and the standalone Xorg server package (xorg-x11-server-Xorg) is not shipped on EL10. X11 applications run via Xwayland instead. You can track the current EPEL 10 packaging discussion on Red Hat Bugzilla (Bug 2366792). This guide covers CentOS Stream 9 installation.

Update CentOS Stream 9 Before Installing XFCE

First, refresh your package cache and apply any pending updates. This step ensures compatibility with the packages you are about to install and reduces the risk of version conflicts during the XFCE installation.

sudo dnf upgrade --refresh

Install EPEL Repository for XFCE Packages

XFCE is not included in the default CentOS Stream repositories. Instead, you need to add the Extra Packages for Enterprise Linux (EPEL) repository, which provides community-maintained packages that complement the base distribution. Additionally, EPEL Next contains packages intended for upcoming RHEL minor releases.

Run the following command to install both EPEL and EPEL Next repositories:

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

For more details about EPEL configuration and management, see our guide to installing EPEL on CentOS Stream.

Next, enable the CodeReady Builder (CRB) repository, which provides additional development packages that many EPEL packages depend on. This is a one-time configuration step:

sudo /usr/bin/crb enable
Enabling CRB repo
CRB repo is enabled and named: crb

Install XFCE Desktop Environment

With the repositories configured, you can now install the XFCE desktop environment using DNF’s group install feature. This command pulls in all core XFCE components, including the file manager, panel, window manager, and essential utilities:

sudo dnf --enablerepo=epel,epel-next,crb group install "Xfce"

The --enablerepo flag ensures DNF retrieves packages from all three repositories during this transaction: EPEL provides the core XFCE packages, EPEL Next includes newer updates, and CRB supplies required development dependencies. After the installation completes, verify that the XFCE group installed successfully:

dnf group list installed | grep -i xfce
   Xfce

Enable a Graphical Login (Display Manager)

Installing XFCE does not automatically guarantee you will boot into a graphical login screen, especially on minimal/server installs where the system default target remains multi-user.target. Before rebooting, confirm which target you boot into and whether a display manager is active.

systemctl get-default
systemctl status display-manager --no-pager

If your system already has GNOME installed, you likely have GDM available. If you installed XFCE via the Xfce group, DNF commonly pulls in gdm as part of the group defaults, but you may still need to enable it and switch to the graphical target manually.

Option 1: Enable GDM (Default for Many Systems)

Enable GDM now and configure the system to boot into the graphical target on future restarts:

sudo systemctl enable --now gdm
sudo systemctl set-default graphical.target

Verify that the display manager is running before you reboot:

sudo systemctl status gdm --no-pager
Active: active (running)

Option 2: Switch to LightDM (Lightweight Alternative)

If you prefer a lighter login manager that pairs well with XFCE, install LightDM from EPEL (including its GTK greeter). If you previously enabled GDM, disable it first, then enable LightDM and set the default target to graphical.target:

If you did not install or enable GDM, skip this step:

sudo systemctl disable --now gdm
sudo dnf install lightdm lightdm-gtk
sudo systemctl enable --now lightdm
sudo systemctl set-default graphical.target

Verify LightDM is active:

sudo systemctl status lightdm --no-pager
Active: active (running)

Reboot to Complete XFCE Installation

Once your display manager is enabled, reboot your system to initialize the new desktop environment and ensure all components load correctly at startup:

sudo reboot

Select XFCE Session at Login

When your system restarts, you should land on a graphical login screen with a session selector. The exact UI depends on your display manager: on GDM you will typically see a gear icon, while LightDM usually provides a session menu/icon near the username. Use the session selector before entering your password.

If you do not see a graphical login screen (you boot back to a console), return to the previous section and ensure your display manager is enabled and your default target is set to graphical.target.

Access Desktop Environment Options

Open the session selector (gear icon in GDM, or the session menu/icon in LightDM) to view all installed desktop environments. If you previously used GNOME or another desktop, those options will also appear alongside XFCE.

Choose XFCE Session

Select “Xfce Session” from the dropdown menu, then enter your password and log in. Your session preference is typically remembered for future logins, so you only need to select it once unless you want to switch back to another desktop.

Start XFCE Without a Display Manager (Optional)

If you prefer not to use a graphical login manager, you can launch XFCE using the traditional startx workflow. Install the Xorg server and xinit, then set XFCE as your X session and start it:

sudo dnf install xorg-x11-server-Xorg xorg-x11-xinit
printf '%s\n' 'exec startxfce4' > ~/.xinitrc
startx

Manage XFCE on CentOS Stream

Update XFCE Packages

XFCE updates arrive through EPEL alongside your regular system updates. To apply all available updates, including XFCE components, run:

sudo dnf upgrade --refresh

This command refreshes the package database and upgrades all installed packages from both the base CentOS repositories and EPEL.

Remove XFCE from CentOS Stream

If you enabled a graphical login specifically for XFCE, disable it and revert the default boot target before removing packages. Otherwise, the system may continue trying to start a removed/disabled desktop stack at boot.

If you still use another desktop environment on this system, do not disable your display manager; only revert changes you made specifically for the XFCE setup.

First, revert the default target back to text-mode boot:

sudo systemctl set-default multi-user.target

Next, disable whichever display manager you enabled:

If you are using GDM:

sudo systemctl disable --now gdm

If you are using LightDM:

sudo systemctl disable --now lightdm

Now remove XFCE using the group remove command:

sudo dnf group remove "Xfce"

After removing the group, clean up any orphaned dependencies that were installed alongside XFCE:

sudo dnf autoremove

If you only installed EPEL for XFCE and no longer need it, you can optionally remove the EPEL repositories:

sudo dnf remove epel-release epel-next-release

Remove User Configuration Files

Warning: The following commands permanently delete your XFCE configuration files, including panel layouts, keyboard shortcuts, and desktop preferences. If you want to preserve these settings for future use, back them up first with cp -r ~/.config/xfce4 ~/xfce4-backup.

To completely remove XFCE user data, delete the configuration and cache directories:

rm -rf ~/.config/xfce4
rm -rf ~/.cache/xfce4

Finally, reboot your system to complete the removal process:

sudo reboot

Verify Complete Removal

After rebooting, confirm that XFCE has been completely removed from your system:

dnf group list installed | grep -i xfce

If the command returns no output, the removal was successful. If you still use a graphical login screen for another desktop, confirm your session choice at login (GDM uses a gear icon; LightDM uses a session selector/menu).

Troubleshooting

XFCE Group Not Found During Installation

If you see “Module or Group ‘Xfce’ is not available” during installation, the EPEL repository may not be enabled correctly. Verify the repository status:

dnf repolist | grep -i epel
epel                Extra Packages for Enterprise Linux 9 - x86_64
epel-next           Extra Packages for Enterprise Linux 9 - Next - x86_64

If EPEL is not listed, reinstall the EPEL release packages as shown in the installation section above. Also ensure you are running CentOS Stream 9, as the Xfce group is not available in EPEL 10 for CentOS Stream 10 (see Bug 2366792).

No XFCE Option at Login Screen

If you are not reaching a graphical login screen at all (you boot to a console), verify the default target and confirm your display manager is running:

systemctl get-default
systemctl status display-manager --no-pager

If the XFCE Session option does not appear in the session selector, check that the XFCE session file exists:

ls /usr/share/xsessions/ | grep -i xfce
xfce.desktop

If the file is missing, the XFCE session package may not have installed correctly. Reinstall the xfce4-session package:

sudo dnf reinstall xfce4-session

Conclusion

You now have XFCE installed on CentOS Stream 9 as an alternative desktop environment. With the EPEL repository configured, your system will receive XFCE updates alongside regular package maintenance. To customize your desktop, explore xfce4-settings-manager for panel layouts and appearance options, install plugins like xfce4-clipman-plugin for clipboard management or xfce4-weather-plugin for weather updates, and configure keyboard shortcuts through Settings → Keyboard to match your workflow preferences. If you are building a lightweight workstation, you may also want to set up a local web stack. See our guides to installing Apache HTTPD on CentOS Stream and installing PHP on CentOS Stream.

Leave a Comment