How to Install a GUI on Ubuntu Server?

Installing a graphical user interface (GUI) on an Ubuntu Server transforms a command-line-only environment into a visually navigable desktop. While Ubuntu Server defaults to a lightweight text interface to maximize system resources, adding a GUI is a straightforward process that can ease server management for users more comfortable with a desktop environment. This guide covers how to update your system, choose and install a desktop environment (such as GNOME, XFCE, or MATE), and manage the display manager to get your graphical interface up and running.

Step 1: Update Your System

Before installing any new software, it is crucial to update your system’s package list and upgrade existing packages. This ensures compatibility and prevents installation conflicts. Open your terminal and run the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Choose and Install Your Desktop Environment

Ubuntu Server allows you to choose from several desktop environments depending on your resource constraints and personal preference. Below are the three most common options.

Option A: Full Ubuntu Desktop (GNOME)

If you want the standard desktop experience found on the regular desktop version of Ubuntu, you can install the default GNOME environment. Note that this option consumes the most system resources.

sudo apt install ubuntu-desktop -y

Option B: XFCE (Lubuntu/Xubuntu - Lightweight)

For servers with limited RAM or CPU power, XFCE is a highly efficient, lightweight desktop environment that provides a functional GUI without a heavy performance tax.

sudo apt install xfce4 xfce4-goodies -y

Option C: MATE Desktop

MATE is a consumption-friendly alternative that offers a traditional desktop layout reminiscent of older Ubuntu versions, balancing performance and features.

sudo apt install ubuntu-mate-desktop -y

Step 3: Configure the Display Manager

During the installation of certain desktop environments, you may be prompted to choose a default display manager (the software that handles the login screen).

Use your arrow keys to select your preference if prompted, and press Enter to complete the setup. If the GUI does not start automatically after installation finishes, you can manually start the display manager service or reboot your server:

sudo systemctl start gdm3

(Replace gdm3 with lightdm if you chose the lightweight option).

Step 4: Boot into the GUI

Once the installation is complete, restart your server to apply all changes and boot directly into your new graphical login screen:

sudo reboot

After rebooting, you will be greeted by a visual login window. Select your user account, enter your password, and you can begin managing your Ubuntu Server using a graphical interface.