install xfce ubuntu server

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.

Linux doesn’t have to be intimidating. With my e-book, Master Linux Commands, you’ll uncover the secrets of the terminal in a fun, step-by-step journey. From basics to scripts, get ready to level up your Linux skills. Oh, and did I mention the handy cheat sheet you get as a bonus?

Prerequisites

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.

Your Go-To Linux Command Reference!
Download your exclusive free PDF containing the most useful Linux commands to elevate your skills!
Download now

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.

Your Go-To Linux Command Reference!
Download your exclusive free PDF containing the most useful Linux commands to elevate your skills!
Download now

Install XFCE on Ubuntu Server

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.

Note: XFCE is not the only environment available. I created a resource with the top 5 desktop environments for Ubuntu here. If you’re unsure which one to try, you should take a look.

Join Our Community!

Connect, learn, and grow with other Raspberry Pi enthusiasts. Support RaspberryTips and enjoy an ad-free reading experience. Get exclusive monthly video tutorials and many other benefits.

Learn more

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.

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.

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:

Your Go-To Linux Command Reference!
Download your exclusive free PDF containing the most useful Linux commands to elevate your skills!
Download now

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?

Your Go-To Linux Command Reference!
Download your exclusive free PDF containing the most useful Linux commands to elevate your skills!
Download now

🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.

Additional Resources

Overwhelmed with Linux commands?
My e-book, “Master Linux Commands”, is your essential guide to mastering the terminal. Get practical tips, real-world examples, and a bonus cheat sheet to keep by your side.
Grab your copy now.

VIP Community
If you just want to hang out with me and other Linux 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?
Python is a great language to get started with programming on any Linux computer.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

Similar Posts