How To Install XFCE On Ubuntu Server


Sometimes, we start with Ubuntu Server for a minimal project, but after a few weeks, we realize that having a desktop environment would be easier for other things. You don’t need to reinstall everything from scratch, you can always add a desktop interface to a server version. In this article, I’ll show you how to install XFCE, but the same principles apply to other environments.

The package xubuntu-desktop is available to upgrade Ubuntu Server to Xubuntu. Or, for a lighter system, the xfce4 includes only the XFCE environment, no additional applications.

Well, it’s one thing to know the package’s name, but that doesn’t mean it will be straightforward, so let’s learn how to install it properly.

Prerequisites

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Each time you are following a tutorial online to do something on your Linux computer, it’s good practice to start by making sure your system is up-to-date.

It may take a few minutes before getting started, but you’ll avoid conflicts and other issues later on.

So let’s start with these commands:
sudo apt update
sudo apt upgrade

If you have a lot of new packages to install, or some of the packages are essentials (I got a kernel update during my test for example), it’s a good idea to restart your computer to make sure everything works correctly:
sudo reboot

Once done, you’re ready to move on to install XFCE on your Ubuntu server.

Are you a bit lost in the Linux command line? Check this article first, for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.

Reminder: Remember that all the members of my community get access to this website without ads, exclusive courses and much more. You can become part of this community for as little as $5 per month & get all the benefits immediately.

Install XFCE on Ubuntu Server

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

There are three ways to install XFCE on the Ubuntu server:

  • Installing xubuntu-desktop: The full Xubuntu experience, with XFCE and all the default apps.
  • Installing only xfce4: For a minimal desktop environment.
  • Using tasksel: An intermediary option, with xfce4 and a few other apps.

If you are not limited by disk space or compute resources (CPU, RAM), xubuntu-desktop will be the most straightforward, but I’ll also explain the other options.

Recommended: Install Xubuntu desktop

Xubuntu is the Ubuntu flavor running XFCE by default (instead of GNOME). You can install it directly on a computer instead of Ubuntu, but if you already run Ubuntu Server, it’s pretty easy to just add the missing packages on top of it.

The best robot kit
Have fun with your Raspberry Pi.
PiCar-X is an AI self-driving robot car for Raspberry Pi.

Buy now Check my review

Here is how to do this:

  • Open your session on Ubuntu Server.
    SSH can work if needed, even if it’s not necessarily a good idea (if the connection is lost, you might get some issues).
  • Type the command:
    sudo apt install xubuntu-desktop

In my case, the installation required roughly 1300 new packages, 800 MB to download and almost 3 GB of additional disk space once installed. So, it isn’t a small installation. If you have a slow connection or computer, it might require some time to get everything downloaded and installed.

Related: How Much Space Does Ubuntu Need? (All versions)

During the installation, the wizard will ask you to choose the default display manager:

LightDM is lighter (hence the name), and GDM3 is better when you have GNOME as the desktop environment. So, I’m using LightDM in this case.

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Once the package installation is completed, you can restart your computer with:
sudo reboot
And if everything goes smoothly, you should get the login prompt in a graphical interface:

Log in with your normal user, and you’ll have access to the full desktop interface running XFCE:

You’ll also find many basic applications, like if you just installed Xubuntu (LibreOffice, Firefox, etc.).

If the login doesn’t work, double-check the keyboard layout. I’m using an AZERTY keyboard (FR), and I’m pretty sure the login form was in QWERTY (US).

Also, you shouldn’t log in with root. If you don’t have a normal user available, press CTRL+ALT+F1 to get back to the terminal and create one.

Doesn’t work?
If the desktop environment doesn’t start at all, you probably have a configuration issue with your X server. This will happen on some servers, especially with virtual machines.

I tested this tutorial with Hyper-V, and my configuration wasn’t detected correctly, so I got stuck in the terminal.
I had to create a custom configuration file, as explained in this forum. Even if you don’t have the same problem, checking the /var/log/Xorg.0.log file can help understand what’s going on.

Lighter alternative: Install XFCE only

Using Xubuntu is the easiest way to get the full desktop environment, with all the basic apps you need to get started. But as explained previously, it’s pretty heavy, with tons of packages to download and a lot of disk space required.

If you just want to use XFCE without all the unessential apps, you can just install XFCE with:
sudo apt install xfce4 lightdm

You need to add LightDM to have the login form on boot, but the total installation will be lighter.
In my case, it was about 380 packages, 160 MB of download for 630 MB added once installed.
It’s about 4 times less than Xubuntu.

If it doesn’t work directly, check your /var/log/dmesg file and /var/log/Xorg.0.log to see if there is an error that can help. It’ll generally be that your GPU is not installed or detected correctly, the solution depends on the hardware you use, and a quick search in Google will generally give you the solution.

Easy alternative: Use tasksel

And the third option to install XFCE on Ubuntu is to use tasksel. Tasksel is like the app store for servers.
If you are used to Debian, it’s the window asking you which app you want to install during the main system installation. It looks like this:

On Ubuntu Server, tasksel is not available by default, so you first need to install it with APT:
sudo apt install tasksel

You can then run it with:
sudo tasksel
You’ll get the same screen as on my previous screenshot.

Move the cursor with the arrows to select XFCE, and press space to check the corresponding box.
Use TAB to exit the list and choose “OK” to start the installation.

Once the installation is completed, restart your computer with:
sudo reboot

To be honest, I wasn’t lucky with this solution. The desktop interface started, but I couldn’t log in. I got the error “Failed to start session”. I didn’t spend much time on it, so I don’t know if it was a keyboard issue, my virtual machine, or something else, but in theory, it should work fine.

Anyway, I hope that at least one of these solutions worked for you and that you can now use XFCE on your server. It helps a lot for certain tasks (like using Gparted to manage disk partitions), and most servers can now run a desktop environment without affecting their performances, so why not use it?

Raspberry Pi Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.

VIP Community
If you just want to hang out with me and other Raspberry Pi fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.

Need help building something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

You can also find all my recommendations for tools and hardware on this page.

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Recent Posts