Installing a Desktop Environment/GUI on Ubuntu Server Made Easy

Installing a Desktop Environment/GUI on Ubuntu Server Made Easy

·

4 min read

Ubuntu Server is a popular Linux distribution designed specifically for server deployments. By default, it runs on a command line interface (CLI) without a graphical user interface (GUI). However, you can install a desktop environment on Ubuntu Server to add a GUI if desired.

There are several reasons why you may want to install a GUI on a server:

  • Easier system administration and application management through visual tools.

  • Ability to run GUI-based applications on the server.

  • More familiar interface for users accustomed to desktop operating systems.

Some common use cases for adding a GUI to Ubuntu Server include:

  • Home media servers, such as Plex or Kodi. A GUI allows easier management of media libraries.

  • Small business servers that require both CLI and GUI admin tools.

  • Developers who want access to visual debuggers and IDEs for coding applications directly on the server.

Prerequisites

Before installing a desktop environment on the Ubuntu Server, ensure your system meets the following prerequisites:

  • A working Ubuntu Server installation with internet connectivity.

  • Sufficient disk space for the GUI and associated applications. At least 10GB is recommended.

  • A video card and monitor compatible with your chosen desktop environment. Most environments support common integrated Intel/AMD graphics.

You should also fully update Ubuntu before installing a new desktop environment:

sudo apt update
sudo apt upgrade

Desktop Environment Options

There are several desktop environment options available for Ubuntu, including:

  • GNOME - The default desktop on Ubuntu. Provides a simple and easy-to-use interface.

  • KDE Plasma - A highly customizable desktop with many built-in tools and utilities.

  • Xfce - A lightweight and modular desktop environment. A good option for older or low-powered hardware.

  • LXDE - Extremely lightweight and fast. Perfect for underpowered servers or systems with minimal resources.

  • MATE - A fork of GNOME 2. Works well for users who prefer a classic desktop layout and workflow.

For home and small business servers, GNOME or KDE Plasma are good choices that provide modern interfaces. LXDE or Xfce are better options for older hardware or when you need to conserve resources.

Installing a Desktop Environment

To install a desktop environment on the Ubuntu Server, use the apt command to download and install the appropriate package.

For example, to install the GNOME desktop:

sudo apt install ubuntu-desktop

Or for KDE Plasma:

sudo apt install kubuntu-desktop

The full package names for other desktops are:

  • xfce4 (Xfce)

  • lxde (LXDE)

  • ubuntu-mate-desktop (Mate)

The package manager will install the desktop environment and all its required dependencies. This may take some time depending on your internet connection speed.

Configuring a Display Manager

After installing a desktop environment, you also need to install and configure a display manager. The display manager handles user logins and loads the graphical interface when you boot the Ubuntu Server.

Some popular display managers include:

  • GDM - The default for GNOME. Provides accessibility features.

  • LightDM - Lightweight and fast. Integrates well with many desktop environments.

  • SDDM - The default for KDE Plasma. Highly themeable and customizable.

To install LightDM (a good universal choice):

sudo apt install lightdm

During the installation process, you'll be asked to choose between GDM and LightDM. Select LightDM as the default.

Once installed, enable the LightDM service:

sudo systemctl enable lightdm

Then start the service:

sudo systemctl start lightdm

Now when you reboot Ubuntu Server, LightDM will start automatically and launch your chosen desktop environment after logging in!

Installing GUI Applications

With your desktop environment up and running, you can now install GUI-based applications directly on the server.

For example, to install the GIMP image editor in GNOME, use:

sudo apt install gimp

Or to install the VLC media player in KDE Plasma:

sudo apt install vlc

Explore the extensive collection of GUI apps available for Ubuntu by browsing the Software Center or using apt search. Popular options include Firefox, LibreOffice, Steam, and more.

Removing the Desktop Environment

If you ever want to remove the desktop environment and return Ubuntu Server to CLI-only mode, it's straightforward.

First, identify the desktop package to remove:

sudo apt remove ubuntu-desktop

Or substitute ubuntu-desktop for KDE-desktop, Xubuntu-desktop, etc depending on what you installed originally.

Next, remove the display manager:

sudo apt remove lightdm

Finally, reboot the server:

sudo reboot

Ubuntu Server will restart without loading the graphical environment. You'll be returned to the pure terminal interface.

Conclusion

Adding a desktop environment transforms the Ubuntu Server into a capable desktop OS while retaining the server optimizations. Install GNOME, KDE, or an alternative DE using apt. Then configure a display manager like LightDM to load the graphical interface automatically.

With Ubuntu Server, you have the flexibility to switch between CLI and GUI modes to best suit your needs. Install GUI apps for more robust media serving, productivity, and administration. Or strip the desktop down and return to an efficient command line when maximum performance is critical.