How to install and access a GUI on Ubuntu Server: Step-by-step guide for remote and local use

Learn how to install a graphical user interface on Ubuntu Server and access it remotely using console, VNC, or RDP

Key points to consider

  • Ubuntu Server is designed to run without a GUI to optimize performance and resource usage, but a desktop environment can be installed when needed.

  • Installing a GUI is helpful for users who prefer visual tools over the command line, especially for basic server management tasks.

  • Several desktop environments are available (e.g. GNOME, Xfce, LXDE), allowing you to choose based on your systems performance capabilities.

  • After installing the GUI, you can access it through the console or remotely using VNC or RDP.

  • Running a GUI on a production server is generally discouraged due to increased resource usage and potential attack surface.

  • You can switch back to a non-graphical environment at any time by changing the system target.

Introduction

Ubuntu Server is known for its efficiency, minimalism, and focus on command-line-based administration. However, in some cases, having a graphical user interface (GUI) can make server management significantly more accessible, especially for system administrators or users who are less comfortable with the terminal. Whether you're managing a personal project, running test environments, or simply prefer a visual approach, installing a GUI on your server can simplify many day to day operations.

This guide walks you through every step needed to install a GUI on an Ubuntu Server instance and shows how to connect to it both locally (via the console) and remotely (using VNC or RDP). You will be able to choose from several desktop environments depending on your systems available resources. We will also cover how to ensure the GUI starts automatically after a reboot and how to disable it again if needed.

Step-by-Step Instructions

Step 1: Update your system

Before beginning any installations, it is crucial to make sure your Ubuntu Server is fully up to date. Updated packages include the latest security patches, feature improvements, and bug fixes, reducing the chances of running into issues during or after the GUI installation process.

To begin, you will need access to the server's terminal. You can do this either through a remote SSH connection or by using remote console:

  1. Open your terminal and run the following command:
    $ sudo apt update && sudo apt upgrade -y
    This will refresh the list of available packages and apply any necessary upgrades. Depending on how long ago your system was last updated, this step may take several minutes to complete.
  2. Once the update finishes, it is recommended to reboot your server to ensure that all updates, especially kernel or system service upgrades, are fully applied before proceeding:
    $ sudo reboot
    After the reboot, log back in via SSH or the local terminal, and you’ll be ready to continue with the desktop environment installation.

Step 2: Choose a desktop environment

Ubuntu Server, by default, does not come with a graphical interface, allowing it to operate in a resource efficient and headless mode. However, adding a desktop environment can significantly improve usability, especially for those who prefer point and click interfaces or plan to run GUI based applications.

Ubuntu supports a variety of desktop environments, each with different strengths in terms of performance, resource usage, and visual features. Before installing, it is important to choose one that fits your server's hardware and your use case:

  • GNOME (ubuntu-desktop) - the default Ubuntu desktop environment, offering a complete and polished experience. It includes a full suite of applications but is relatively heavy on resources.

  • Xfce (xubuntu-core) - a lightweight and fast desktop environment that is ideal for virtual servers or machines with limited RAM and CPU power. It offers a minimal footprint while remaining user friendly.

  • LXDE (lubuntu-core) - one of the lightest GUI options available. Perfect for extremely resource constrained environments or minimal use cases where performance is the highest priority.

  • KDE Plasma (kubuntu-desktop) - a modern and feature rich desktop that delivers an attractive, Windows like experience. While it is visually appealing, KDE also requires more system resources.

If you are unsure which environment to choose, we recommend starting with Xfce, as it provides a good balance between usability and system load. On the other hand, if you are looking for a full desktop experience with most Ubuntu tools per-installed, then GNOME is the way to go. You will be able to install any of these environments using a single command.

Step 3: Install the desktop environment

Now that you have chosen which desktop environment best suits your needs, it is time to install it. Ubuntu makes this process relatively straightforward via the apt package manager. Below, we will cover the installation steps for the most common desktop environments.

Note: installing a GUI may pull in hundreds of packages, depending on the environment. Ensure your system has enough available storage and that the installation process is not interrupted.

  • Installing GNOME (full Ubuntu Desktop)
    If you want the full desktop experience, similar to what you get when installing Ubuntu Desktop, run the following command:
    $ sudo apt install ubuntu-desktop -y
    This will install the GNOME desktop environment along with a wide range of pre-installed applications such as Firefox, LibreOffice, and other system utilities. It is suitable for users who want a complete system with little setup effort.
  • Installing Xfce (lightweight option)
    For a minimal, resource efficient setup, we recommend Xfce. It includes only the essential components of a desktop interface, making it ideal for servers and virtual machines with modest specifications. To install Xfce (Xubuntu Core), use the following command:
    $ sudo apt install xubuntu-core -y
    This installs the core desktop without extra applications, allowing you to manually add only what you need later.
  • Installing LXDE (ultra lightweight)
    If system resources are extremely limited, LXDE is a great alternative. It is even lighter than Xfce and ideal for headless servers where you want a GUI without additional software overhead.
    $ sudo apt install lubuntu-core -y
    If you encounter the error E: Unable to locate package lubuntu-core, it likely means the universe repository is not enabled on your server. To resolve this, run the following commands before installing:
    $ sudo add-apt-repository universe
    $ sudo apt update
    Then install the full Lubuntu desktop environment instead:
    $ sudo apt install lubuntu-desktop -y
    This ensures all necessary packages are available and properly installed.
  • Installing KDE Plasma (feature rich environment)
    If you prefer a modern, feature rich interface with advanced graphical elements, consider installing KDE Plasma:
    $ sudo apt install kubuntu-desktop -y

Tip: you don’t need to commit to just one. Multiple desktop environments can coexist on a single system, although switching between them may lead to increased disk usage and package conflicts.

Once your selected environment has finished installing, you will be ready to set up a display manager and boot into the graphical interface.

Step 4: Install a display manager

A display manager is the service responsible for presenting the login screen and launching your desktop environment after boot. Without a display manager, even if a GUI installed, your server will boot into the command line interface (CLI) by default. Different desktop environments prefer different display managers, but you can choose the one that best suits your setup. Recommended display managers:

  • GDM3 (GNOME display manager) – The default for GNOME. Visually polished, but slightly heavier on system resources.

  • LightDM – a lightweight alternative that works well with Xfce, LXDE, and even GNOME.

  • SDDM – preferred by KDE Plasma, offering smooth animations and integration.

For a lightweight and universal solution, we recommend installing LightDM:

$ sudo apt install lightdm -y

During installation, you will be prompted to choose a default display manager (see Fig. 1). Use the arrow keys to highlight your selection (e.g., lightdm), then press ENTER to confirm.

Fig. 1. Selecting the default display manager (LightDM or SDDM) during installation.

Tip: if the prompt does not appear or you want to reconfigure your default display manager later, you can run:

$ sudo dpkg-reconfigure lightdm

Once the display manager is installed and configured, your system is almost ready to launch the desktop enviroment.

Step 5: Enable the GUI to start automatically

By default, Ubuntu Server boots into a multi-user target, which provides a non-graphical command-line interface. To have your newly installed desktop environment load automatically after each boot, you need to change the systems target to graphical.target. This ensures that the system will launch the display manager and graphical interface right after startup, providing a GUI login screen every time the server reboots. To check the current boot target, run:

$ systemctl get-default

If your server returns multi-user.target, it means it is still set to boot into text mode only. You can change this to graphical mode using the following command:

$ sudo systemctl set-default graphical.target

This command sets the GUI mode as the default run-level, allowing the desktop environment to start automatically on each boot.

Important: if you previously skipped installing a display manager in Step 4, make sure it is installed before running this command, otherwise, your server may boot into a black screen with no login prompt.

Step 6: Reboot the system

After setting the graphical target and completing all installation steps, it is time to reboot your server so that the changes can take full effect. Rebooting ensures that the display manager, graphical interface, and desktop environment are properly initialized on startup. To reboot your server, simply enter:

$ sudo reboot

The server will shut down and automatically start again. Once the system has fully booted, you should be greeted by the graphical login screen of the desktop environment you installed earlier. If you are connected through a remote console such as the KVM/IPMI/VNC console, you will be able to view the login screen in real time (see Fig. 2).

Fig. 2. Graphical login screen displayed after reboot, confirming successful GUI installation on Ubuntu Server 24.04.

Step 7: Connect to the GUI remotely

Once the desktop environment is installed and configured, you may want to access it remotely from your local computer. The two most common methods for GUI based remote access are VNC and RDP

Option 1: VNC (Virtual Network Computing)

VNC allows you to connect to your server's graphical interface using a VNC client. To install the VNC server on Ubuntu, run:

$ sudo apt install tightvncserver -y

After installation, you can start the server and set a password:

$ vncserver

Note: you may be prompted to create a view only password as well. You can skip this if it's not needed.

Once the server is running, it will listen on port 5901 by default (which corresponds to :1 display). You can now connect to it using any VNC client.

Option 2: RDP (Remote Desktop Protocol)

xRDP allows you to connect to your Ubuntu desktop using the built-in Remote Desktop Connection app on Windows or any RDP compatible client. To install xRDP, use:

$ sudo apt install xrdp -y

Once installed, the xRDP service should start automatically (see Fig. 3). You can verify with:

$ sudo systemctl status xrdp

Fig. 3. xRDP service running and listening on port 3389, confirming successful installation and startup.

If the service is not running, start and enable it:

$ sudo systemctl enable xrdp
$ sudo systemctl start xrdp

xRDP listens on port 3389. You can connect using a remote desktop client by entering your servers IP address and logging in with your Linux credentials (see Fig. 4).

Fig. 4. xRDP login screen showing a successful remote desktop connection prompt using Xorg session.

Step 8: Manage or disable the GUI when not needed

Once the GUI is installed and working, you may want more control over when it runs. While the graphical interface is useful, it does consume additional system resources, something you might not want on production servers or headless setups.

  • Temporarily switch to CLI mode
    If you only want to disable the GUI for the current session (e.g., for performance or troubleshooting), you can switch to a command-line interface (CLI) using the following command:
    $ sudo systemctl isolate multi-user.target
    This will immediately exit the graphical environment and switch the system to CLI mode without rebooting the system.
  • Permanently disable the GUI from starting on boot
    To prevent the graphical interface from launching automatically during system boot, you can change the default system target:
    $ sudo systemctl set-default multi-user.target
    The next time the system boots, it will go directly to a CLI environment.
  • Re-enable the GUI later
    If you want to switch back to booting into the GUI again, simply change the default target back to graphical:
    $ sudo systemctl set-default graphical.target
    This is helpful for systems that occasionally require GUI access but primarily operate as headless servers.

Summary

In this tutorial, we walked through the complete process of installing a graphical user interface (GUI) on Ubuntu Server. While Ubuntu Server is designed to be lightweight and command-line focused, a GUI can significantly simplify management for users who prefer visual tools or are less experienced with terminal based workflows.
We covered how to choose and install desktop environments like GNOME, Xfce, or KDE, how to set up a display manager such as LightDM, and how to enable the GUI to start automatically at boot.

By following this guide, you now have the flexibility to run Ubuntu Server with or without a GUI, depending on your needs.