Log inSign up

Run a graphical Linux desktop on your server over RDP

Install a light desktop such as Xfce plus the xrdp package, tell xrdp to start xfce4-session, and leave port 3389 closed in the firewall. From your own computer open an SSH tunnel with ssh -L 33389:localhost:3389 deploy@198.51.100.24 and point any RDP client at localhost:33389. You get a full desktop with a browser and file manager, encrypted by SSH, on a server with at least 2 GB of RAM.

Topic: Server basics · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9, AlmaLinux 9 · Updated 2026-12-03

When is a remote desktop on a VPS worth it?

A desktop makes sense when a task needs a graphical program: a browser that must run from the server IP address, a wallet or trading tool that only ships a GUI, a visual database client, or a place to test a web app from another region. For pure administration the terminal remains faster and lighter, so most servers never need a desktop at all.

Xfce is a sensible choice because it starts quickly, uses little memory and works well with xrdp. GNOME and KDE Plasma also run over RDP, but they expect a GPU, pull in many more packages and use several times the RAM. Every server image you can deploy starts without any desktop, so everything below is added on top of a minimal install. Before you begin, log in as a sudo user as shown in the first SSH session tutorial and update the system.

How much memory does a graphical session need?

Plan on at least 2 GB of RAM for one Xfce session with a browser open. The desktop itself idles at a few hundred megabytes, but a modern browser with a handful of tabs easily takes 1 GB or more, and each extra RDP user starts a separate session with its own copy of everything. A 1 GB server can show the desktop, yet it will swap as soon as you open real work.

If you are close to the limit, a swap file prevents crashes, though a swapping desktop feels sluggish. Disk use for Xfce and its extras is roughly 1 to 2 GB. Watch actual use with free -h while you work and move to a bigger plan later if needed, using the steps in moving to a larger plan.

How do I install Xfce and xrdp on Ubuntu or Debian?

Both packages live in the main repositories of Ubuntu 24.04, 22.04 and Debian 12 and 13. Install them with apt, then add the xrdp service user to the ssl-cert group so it can read the default TLS key:

sudo apt update
sudo apt install xfce4 xfce4-goodies xrdp dbus-x11
sudo adduser xrdp ssl-cert
xrdp --version

When apt asks which display manager to use, either answer is fine, because RDP sessions do not go through it. Next tell xrdp which desktop to start for your user. Run this as the account you will log in with, not as root:

echo xfce4-session > ~/.xsession
sudo systemctl enable --now xrdp
systemctl status xrdp --no-pager

Ubuntu ships Firefox as a snap package, which works inside an Xfce session. On Debian you can add a browser with sudo apt install firefox-esr.

How do I install it on Rocky Linux or AlmaLinux 9?

On the Red Hat family both Xfce and xrdp come from EPEL, so enable that repository first. CodeReady Builder (Rocky) or the CRB repository (Alma) supplies a few libraries that EPEL packages depend on:

sudo dnf install epel-release
sudo dnf config-manager --set-enabled crb
sudo dnf groupinstall "Xfce"
sudo dnf install xrdp
xrdp --version

The xrdp start script on these systems reads ~/.Xclients to decide which desktop to launch. Create it for your user and make it executable, then start the service:

echo xfce4-session > ~/.Xclients
chmod +x ~/.Xclients
sudo systemctl enable --now xrdp

SELinux can stay in enforcing mode; the EPEL packages run under the standard policy. If a login fails, check for denials as described in the SELinux guide.

Why should RDP stay behind an SSH tunnel?

Port 3389 is scanned constantly, and password guessing against RDP is common. Rather than exposing it, keep the port closed and carry the RDP traffic inside SSH, which already uses your key based login. Ideally make xrdp listen only on the loopback address. Open /etc/xrdp/xrdp.ini and change the port line in the [Globals] section:

port=tcp://127.0.0.1:3389

Restart with sudo systemctl restart xrdp and confirm the listener with sudo ss -tlnp | grep 3389; it should show 127.0.0.1:3389. Do not add a firewall rule for 3389 at all. With UFW or firewalld active and only SSH allowed, outside clients cannot reach it even if the binding were wider.

How do I connect from Windows, macOS or Linux?

Open the tunnel first, then point your RDP client at the local end. On any system with OpenSSH, including Windows 10 and 11 in PowerShell, run:

ssh -N -L 33389:localhost:3389 deploy@198.51.100.24

The -N flag keeps the connection open without starting a shell. Leave that window running. Now start Remote Desktop Connection (mstsc) on Windows, the Windows App on macOS, or Remmina on Linux, and connect to localhost:33389. Log in with your Linux username and password. The local port 33389 avoids a clash with a Windows machine that already listens on 3389 itself.

PuTTY users can set the same forward under Connection, SSH, Tunnels: source port 33389, destination localhost:3389. The PuTTY guide explains the basic connection.

Which settings make the session smoother?

Lower the color depth in the RDP client to 16 bit when the link is slow, and turn off desktop wallpaper and window animations in Xfce under Settings, Window Manager Tweaks, Compositor. Those two changes reduce the amount of screen data noticeably. Choose a fixed window size instead of full screen on very high resolution monitors, since every extra pixel must cross the network.

If you want a session to survive a disconnect, simply close the RDP window instead of logging out. On reconnect xrdp finds the existing session for your user and returns you to it, with programs still running. Log out from the Xfce menu when you are finished so the memory is freed.

How do I fix a black screen or a login that closes at once?

A black or immediately closing session usually means xrdp could not start the desktop. Check that ~/.xsession (Ubuntu, Debian) or ~/.Xclients (Rocky, Alma) exists in the home directory of the user who logs in and contains xfce4-session. A second common cause is the same user already being logged in to a local graphical session, which does not apply on a headless VPS but does after installing a display manager that auto logs in.

The logs tell you more:

sudo journalctl -u xrdp -u xrdp-sesman --since "15 min ago"
tail -n 50 ~/.xsession-errors

A popup asking for a password to create a color managed device is a known polkit prompt; cancelling it is harmless. If the RDP client reports a certificate warning, that is the self-signed key xrdp generated, and it is fine because the tunnel already protects the link.

How do I keep it updated or remove it later?

xrdp and Xfce update with the rest of the system through sudo apt upgrade or sudo dnf upgrade, so automatic security updates cover them. To free the memory and disk again, stop the service and remove the packages:

sudo systemctl disable --now xrdp
sudo apt purge xrdp xfce4 xfce4-goodies && sudo apt autoremove
sudo dnf remove xrdp && sudo dnf groupremove "Xfce"

Use the apt lines on Ubuntu and Debian and the dnf lines on Rocky and Alma.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4room for one desktop session and a browser2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
F2-4NVMe disk and fast cores for a snappier desktop2 vCPU, 4 GB RAM, 128 GB NVMe$14.40/mo$43.20 for 3 months
A4-8several users or heavier GUI tools4 vCPU, 8 GB RAM, 180 GB NVMe$28.80/mo$86.40 for 3 months

Questions about Remote desktop with Xfce and xrdp

Can several people use the desktop at the same time?

Yes. Each Linux user who logs in over RDP gets a separate session. Memory grows with every session, so budget roughly 1 to 1.5 GB per active user with a browser.

Is it safe to open port 3389 if I use a strong password?

It works, but the port attracts constant guessing. A tunnel over SSH keeps RDP invisible from outside and reuses your SSH key, so it is the safer default.

Does the server need a GPU for this?

No. Xfce draws with the CPU and xrdp compresses the screen in software. 3D heavy programs and video playback will be slow, but office style work is fine.

Can I use VNC instead of RDP?

You can install a VNC server such as TigerVNC and tunnel it the same way. RDP clients ship with Windows and macOS, which makes xrdp the easier route for most people.

Is there a browser based console for the desktop?

No. Access to the server is over SSH, and this setup adds RDP through that SSH connection. You install and run everything from inside the operating system.

Will the desktop slow down my other services?

An idle Xfce session uses little CPU, but an open browser can use a lot of RAM. On a server that also runs production services, log out of the desktop when you are done.