For many administrators, managing infrastructure through a CLI (Command Line Interface) is standard practice. However, certain tasks—such as using a web browser for local configurations, visual file management, or running specific apps—are much easier with a desktop environment. This is especially relevant if you are using an RDP VPS, where a graphical interface becomes your primary workspace.
Adding a GUI to a headless Ubuntu Server requires two parts: installing the Desktop Environment (DE) and configuring the Remote Desktop Protocol (xrdp).
1. Update Your System
Before adding heavy graphical packages, ensure your system is up to date to avoid dependency conflicts.
sudo apt update && sudo apt upgrade -y
2. Choosing Your Desktop Environment
The choice of GUI depends on your server’s resources. For a balance of speed and usability, we recommend XFCE.
- Option A: GNOME – The default Ubuntu look. Modern but resource-heavy.
- Option B: XFCE (Recommended) – Lightweight, stable, and perfect for VPS environments.
- Option C: MATE – A classic desktop experience that is light on RAM.
To install the XFCE environment, run:
sudo apt install xubuntu-desktop
3. Confirming the Installation (The “Y” Prompt)
Once you run the install command, Ubuntu will analyze the dependencies. Since a desktop environment consists of over a thousand small components, the system will ask for your confirmation before proceeding.

As seen in the screenshot, the system summarizes the operation:
- Packages to install: ~1,200+
- Download size: ~785 MB
- Disk space required: ~2.7 GB
When prompted with Do you want to continue? [Y/n], type Y and press Enter.
Pro Tip: The “-y” Flag If you want to skip this manual confirmation in the future, you can add -y to your command: sudo apt install xubuntu-desktop -y. This tells Ubuntu to automatically accept the disk space usage and start the download immediately. This is a “fire and forget” approach—perfect for when you want to start an installation and walk away to grab a coffee.
4. Setting Up Remote Access (xrdp)
Since you are likely connecting to your server remotely, you need a way to see the screen. This is where xrdp comes in.
sudo apt install xrdp -y
After installation, you must tell the RDP server to use XFCE by default:
echo "xfce4-session" > ~/.xsession
sudo systemctl restart xrdp
5. How to Connect
Now that your GUI is ready, you can access it from your local machine:
- Windows: Use the built-in “Remote Desktop Connection” app.
- macOS: Download the official Microsoft Remote Desktop app from the App Store.
- Linux: Use Remmina.
Enter your server’s IPv4 address, provide your login credentials, and you will be greeted by the XFCE desktop instead of a black console window.
Management Tip
If you no longer need the GUI and want to free up RAM for server-side tasks, you can stop the display manager at any time:
Bash
sudo systemctl stop lightdm









