If you have just installed Ubuntu Server for the first time, you may want a familiar user interface, perhaps similar to Ubuntu Desktop. Here is a guide on how to set up a graphical user interface and install a desktop environment on your Ubuntu server.
Why would you need a GUI?
Generally, server machines do not use a graphical user interface (GUI) and the command line interface (CLI) is the preferred solution for day-to-day operations. It is even recommended to refrain from installing the GUI on production servers to better manage resources and ensure maximum performance.
However, if you installed Ubuntu Server purely for personal use, perhaps on a spare laptop to stream media, it’s perfectly fine to install a GUI on your server machine as long as the performance isn’t massively bottleneck.
Using a GUI helps a lot when it comes to video or audio streaming because you get an easy-to-understand visual understanding of on-screen elements.
Step 1: Update and upgrade your system
This is a fundamental step before making changes or installing packages on your Ubuntu server. Update Ubuntu’s software repositories and upgrade your system with the APT package manager.
sudo apt update && apt upgrade
Finalize updates and upgrades, then proceed to the next step.
Step 2: Install the desktop environment
There are a variety of desktop environments to choose from, but if your hardware can afford it, let’s stick with the default Ubuntu GNOME desktop environment. You are always free to choose among other alternatives, but with this freedom comes the risk of software 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, run the following command:
sudo apt install ubuntu-mate-core
To install the XFCE desktop, run:
sudo apt install xubuntu-core
Not sure which desktop environment to choose? Start with this list of the best Linux desktop environments.
Step 3: Install and configure a display manager
After installing the desktop environment, you must install a display manager to manage users and load desktop environment sessions.
Since you are working with a server system, it is better to opt for lightweight and resource-efficient solutions. In that case, consider installing and using LightDM, a fast, lightweight, multi-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 prompted to choose between GDM3 (GNOME’s default display manager) and LightDM.
Choose LightDM using space bar and highlight
Now that the installation process is complete, you need to activate the LightDM service. You can either use the service command or the systemctl command to do this.
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
Restart your system with the to restart ordered. The next time your system boots, you should be greeted with the LightDM welcome message and a GUI desktop environment session upon successful login.
If you want to try alternatives to LightDM, here is a guide on how to uninstall and remove LightDM.
How To Remove Ubuntu Server GUI
All it takes is a few commands and a system reboot to get back to the CLI experience. Using the APT package manager, remove all previously installed packages:
sudo apt autoremove ubuntu-desktop
sudo systemctl stop lightdm.service
sudo apt autoremove lightdm
Remember to change the desktop package name in the first command if you installed another desktop environment.
Restart your system and the changes should take effect.
Best Linux Server Distros to Choose From
Ubuntu Server is arguably the most popular server distribution today. However, there are always alternatives to choose from in the open source world. If the Ubuntu experience is becoming stale for you, consider migrating to an alternative server operating system. Here’s a curated list of the best Linux server distros to get you started.
The 10 Best Linux Server Distributions
About the Author