An Ubuntu Server GUI allows you to manage your server through a graphical desktop instead of relying entirely on terminal commands.
Ubuntu Server doesn’t include a desktop environment by default, but you can install one using APT. This guide explains how to install Xfce or GNOME, enable graphical access, and connect remotely.
The instructions cover Ubuntu Server 24.04 LTS and 26.04 LTS.
Key Takeaways
- Ubuntu Server can run desktop environments such as Xfce and GNOME.
- Xfce is a lightweight choice for VPS hosting and remote administration.
- GNOME provides the familiar Ubuntu Desktop interface but requires more resources.
- You can access a remote desktop using xrdp and a secure SSH connection.
Before Installing a GUI on Ubuntu Server
Make sure you have:
- Ubuntu Server 24.04 or 26.04 LTS
- A user account with sudo privileges
- An active internet connection
- Sufficient RAM and free disk space
- SSH or server console access
For Xfce, 2 GB RAM is a practical starting point, while GNOME generally benefits from at least 4 GB.
Check your installed Ubuntu release:
cat /etc/os-release
If you’re unsure which version is installed, follow our guide to checking your Ubuntu release.
Important: Installing a desktop environment adds numerous packages and background services. Back up important data and schedule installation during a maintenance window on production servers.
Step 1: Update Ubuntu Server
Before installing the graphical interface, update your package information:
sudo apt update
Then install available updates:
sudo apt upgrade
Review the proposed changes before confirming, particularly on production systems.
Before installing new software, refresh Ubuntu’s package information. If you’re unfamiliar with the update process, our APT update command guide explains how package lists work, the difference between updating and upgrading, and how to resolve common errors.
Step 2: Choose a Desktop Environment
Ubuntu supports several graphical desktop environments.
| Desktop Environment | Resource Usage | Best For |
|---|---|---|
| Xfce | Low | VPS and lightweight remote desktops |
| GNOME | Higher | Full Ubuntu Desktop experience |
| LXQt | Very low | Resource-constrained servers |
| KDE Plasma | Higher | Feature-rich desktop environments |
For most remote Ubuntu servers, Xfce is a sensible starting point because it requires fewer resources than a full GNOME desktop.
Step 3: Install the Ubuntu Server GUI
Option A: Install Xfce (Recommended)
Install Xfce and the LightDM graphical login manager:
sudo apt install xfce4 lightdm
Xfce provides a lightweight desktop, while LightDM handles graphical logins.
If asked to choose a default display manager, select lightdm.
Option B: Install GNOME
If you prefer the standard Ubuntu desktop interface, install:
sudo apt install ubuntu-desktop-minimal
This installs the minimal Ubuntu desktop system, including GNOME and its graphical login components.
Alternatively, install the full desktop package:
sudo apt install ubuntu-desktop
Choose one desktop environment for your initial setup rather than installing both.
Step 4: Enable the Graphical Interface
To check your server’s default startup mode, run:
systemctl get-default
A headless server commonly uses multi-user.target.
To make the graphical login screen start automatically:
sudo systemctl set-default graphical.target
Reboot the server:
sudo reboot
After restarting, the desktop login screen should be available through a local display or compatible server console.
Note: Installing a GUI doesn’t automatically make it visible through SSH. For remote graphical access, configure xrdp as described below.
Step 5: Access Ubuntu Server GUI Remotely
If your Ubuntu server is hosted remotely, you can use xrdp to connect through Remote Desktop Protocol (RDP).
For an Xfce installation, install the required packages:
sudo apt install xrdp xorgxrdp
Configure Xfce as the desktop session for your Linux user:
echo "startxfce4" > ~/.xsession
Run this command as the same non-root user who will log in remotely.
Enable the remote desktop service:
sudo systemctl enable --now xrdp
Verify that it’s running:
sudo systemctl status xrdp
Connect Securely Through SSH
xrdp typically listens on TCP port 3389. Avoid exposing this port directly to the public internet.
A secure option is to create an SSH tunnel from your local computer:
ssh -L 13389:127.0.0.1:3389 username@SERVER_IP
Replace username and SERVER_IP with your server details.
Keep the SSH connection open, then launch your Remote Desktop client and connect to:
127.0.0.1:13389
Select the Xorg session if prompted and sign in with your Linux account credentials.
For SSH connection instructions, see our beginner’s guide to remote server access.
Keep port 3389 blocked from untrusted networks through your hosting firewall or UFW. Our Ubuntu firewall configuration tutorial explains how to control network access.
Common Ubuntu Server GUI Problems
GUI Doesn’t Start
Check whether the graphical target is enabled:
systemctl get-default
Also verify that the required desktop packages and display manager were installed successfully.
Remote Desktop Shows a Black Screen
If xrdp connects but displays a black screen:
- Verify that Xfce is installed.
- Confirm that
~/.xsessioncontainsstartxfce4. - Select Xorg at the xrdp login screen.
- Check whether another graphical session is conflicting with the remote login.
Restart xrdp after correcting its configuration:
sudo systemctl restart xrdp
GUI Is Running Slowly
Desktop environments consume memory and CPU resources.
Check available memory:
free -h
If the server has limited resources, Xfce may perform better than GNOME. Close unnecessary applications and check for resource contention.
How to Disable the GUI on Ubuntu Server
If you no longer want the graphical desktop to start automatically, return to the command-line boot target:
sudo systemctl set-default multi-user.target
Reboot to apply the change:
sudo reboot
This disables automatic graphical startup without uninstalling the desktop packages.
If remote desktop access is no longer required, you can also stop and disable xrdp:
sudo systemctl disable --now xrdp
Keep SSH access available before making these changes.
Should You Install a GUI on a Production Server?
A graphical interface is useful for development, testing, and administrators who prefer visual tools.
However, a GUI consumes additional resources and increases the number of software components that require security maintenance.
For production web servers, SSH and command-line administration are often more resource-efficient.
Install a GUI when it provides a practical benefit, not simply because it’s available.
Final Thoughts
Installing an Ubuntu Server GUI is straightforward with Xfce or GNOME.
For lightweight remote administration, Xfce with xrdp offers a practical combination of usability and resource efficiency.
If you only need occasional graphical access, consider keeping the server in command-line mode and enabling desktop services when required.