Server AdministrationUpdated November 24, 2026·4 min read

How to Install a Desktop on Ubuntu Server and Connect with xrdp

Does Ubuntu Server have a GUI? No. It comes with the command-line interface only – no desktop, no display server, no window manager. The idea of the server is to be accessible through SSH, and each graphical element will eat system resources and require additional package installations.

However, an Ubuntu Server GUI can be installed when needed. In case of a remote VPS or dedicated server, it will consist of two parts – a desktop and a remote desktop server for connecting to it. This article shows how to install a lightweight desktop and connect to it via xrdp without exposing it to the internet.

When a GUI on a server makes sense

  • A program you need only comes with a graphical interface.
  • There could be a requirement for a browser or file manager to test a website from the server's network.
  • The individual is new to Linux and wants to use graphical tools while getting used to the shell.

All other tasks can be handled on the command line with the help of utilities like htop and ncdu.

Pick a light desktop for your Ubuntu Server GUI

Desktop Package Notes
Xfce (minimal) xubuntu-desktop-minimal Light, uses X11, works well over xrdp. Our pick for servers
GNOME (minimal) ubuntu-desktop-minimal The standard Ubuntu desktop without extra apps; heavier, and needs more setup for xrdp
GNOME (full) ubuntu-desktop Includes office and media apps you rarely want on a server

The Ubuntu documentation lists 1.5 GB of memory as the minimum and suggests 3 GB or higher for Ubuntu Server ISO installs, even before adding the requirements for the desktop environment.

Step 1: install the desktop

sudo apt update
sudo apt install xubuntu-desktop-minimal

It will take some time because the download is large. There is no need to log in via the server console, because xrdp opens a separate desktop session when you connect.

Step 2: install xrdp

Since xrdp acts as an RDP server, one could use any RDP client on either macOS or Linux or even the one in Windows to establish a connection:

sudo apt install xrdp
sudo adduser xrdp ssl-cert
echo "xfce4-session" > ~/.xsession
sudo systemctl restart xrdp
sudo systemctl status xrdp

Adding the xrdp user to ssl-cert lets it read the TLS certificate that encrypts the session. The ~/.xsession file tells xrdp to start Xfce for your user; without it you may get the wrong session or a black screen. Ubuntu 24.04 ships xrdp 0.9.24 and Ubuntu 26.04 ships 0.10.1, both from the universe repository.

Step 3: connect through an SSH tunnel

Port 3389 on RDP is amongst the most probed ports on the web. Never expose it to everybody. Keep the firewall tight and pass the connection through SSH from your own computer:

ssh -L 3389:localhost:3389 user@your-server

Leaving that one open, launch your RDP program into localhost:3389 and use your server username and password for logon. Should it be necessary to grant direct access, do so only from your IP address:

sudo ufw allow from 203.0.113.10 to any port 3389 proto tcp

Use your own address here. Our guidance about enabling and securing SSH on Ubuntu lays down how the key-based login for the tunnel should be set up.

Fix a black screen after login

Cause Fix
The same user is logged in to a desktop on the console Log that session out; xrdp starts a new session and cannot share an active one
No ~/.xsession, so xrdp starts the wrong desktop Create it with echo "xfce4-session" > ~/.xsession
xrdp cannot read its certificate sudo adduser xrdp ssl-cert, then restart xrdp

/var/log/xrdp.log file contains log for xrdp, whereas /var/log/xrdp-sesman.log contains log of sessions.

Next steps on the desktop

A browser tends to be installed first; we have written a guide to installing Chrome on Ubuntu. For those who would prefer a Windows desktop with native RDP, a Windows dedicated server might be the choice to consider.

Remove the GUI later

sudo apt purge xrdp xubuntu-desktop-minimal
sudo apt autoremove --purge

It is important to consider autoremove due to the fact that the desktop pulled in many dependencies.

A desktop needs memory headroom. The OrbitServers VPS Starter plan, which offers 8GB of RAM, will be suitable for a lightweight desktop alongside small workloads.

Was this article helpful?

Written by Julius · Product Manager