We independently review everything we recommend. When you buy through our links, we may earn a commission.
Although most servers do not require a graphical user interface, they can be quite useful in some situations. Here’s how to set up a desktop environment on Ubuntu Server using the command line.
If you’ve just installed Ubuntu Server for the first time, you may desire a familiar user experience, possibly comparable to Ubuntu Desktop. Here’s a guide on how to set up a graphical user interface and install a desktop environment on your Ubuntu server.
What’s the Point of a Graphical User Interface (GUI)?
Generally, server computers don’t employ a graphical user interface (GUI), and the command-line interface (CLI) is the preferred choice for day-to-day operations. It is even advised that you avoid from installing GUI on production servers to better manage resources and maintain optimal performance.
However, if you have installed Ubuntu Server only for personal use, maybe on a spare laptop to stream video, it’s entirely OK to install a GUI on your server machine as long as the performance isn’t significantly bottlenecked.
Using a GUI helps a lot when working with video or audio streaming as you receive an easy-to-comprehend visual knowledge of the on-screen elements.
Step 1: Update and Upgrade Your System
This is a necessary step before making any modifications or putting packages into your Ubuntu system. Update Ubuntu’s software repositories and upgrade your system via the APT package manager.
sudo apt update && apt upgrade
Step 2: Install the Desktop Environment

There are a variety of desktop environments to pick from, but if your hardware can afford it, let’s go with the default Ubuntu GNOME desktop environment. You are always free to pick from different choices, but this freedom comes with the risk of some program incompatibility.
To install the GNOME desktop on your Ubuntu server, use the APT package manager to download and install the package:
sudo apt install ubuntu-desktop
To install the KDE Plasma desktop on your Ubuntu server, use the APT package manager to download and install the package:
sudo apt install kde-plasma-desktop
To install MATE on your Ubuntu server, perform the following command:
sudo apt install ubuntu-mate-core
To install the XFCE desktop, run:
sudo apt install xubuntu-core
Unsure which desktop environment to choose? Get started with this list of the greatest Linux desktop environments.
Step 3: Install and Set Up a Display Manager
After installing the desktop environment, you need to install a display manager to manage users and load up the desktop environment sessions.
Since you are working with a server system, it’s advisable to choose for lightweight solutions that are easy on the resources. In this scenario, try installing and utilizing LightDM, a fast, lightweight, and cross-desktop display manager.
To install LightDM on your server, use the APT package manager:
sudo apt install lightdm
During the installation process, you will be requested to pick between GDM3 (the default display manager of GNOME) and LightDM.
Choose LightDM with Spacebar and highlight using the Tab key. Finalize your option and establish LightDM as the default display manager by hitting Enter.
Setting Up LightDM
Now that the installation procedure is done, you need to enable the LightDM service. You may either use the service command or the systemctl command to achieve it.
Run this command to start the LightDM service with systemctl:
sudo systemctl start lightdm.service
Run this command to start the LightDM service using the service utility:
sudo service ligthdm start
Reboot your machine with the reboot command. The next time your system powers up, you should be welcomed with the LightDM greeter and a GUI desktop environment session upon successful login.
In case you wish to test alternatives to LightDM, here’s a guide on how to uninstall and delete LightDM.
How to Remove GUI From Ubuntu Server
It merely takes a few commands and one system reboot to revert to the CLI experience. Using the APT package manager, delete all the previously installed packages:
sudo apt autoremove ubuntu-desktop
sudo systemctl stop lightdm.service
sudo apt autoremove lightdm
Remember to alter the desktop package name in the first command if you’ve installed any other desktop environment.
Reboot your machine and the adjustments should be in effect.
Best Linux Server Distributions to Choose From
Ubuntu Server is likely the most popular server distribution of today. However, there are always choices to pick from in the open-source world. If the Ubuntu experience is growing stale for you, consider moving to an other server operating system. Here’s a handpicked selection of the finest Linux server distributions to get you started.