Setting up and optimising a remote desktop on a Linux VPS: the complete guide

8 min read

Linux servers are usually managed via the command line or SSH, and this works well for most tasks. Sometimes, however, a graphical interface comes in handy: for an admin interface running in a browser, a graphical development environment, a program that only works with a graphical interface, or simply a workstation that’s always on and accessible from anywhere. This is what the Linux VPS remote desktop is for.

In this guide, we compare the three most common solutions (XRDP, X2Go, VNC), show you which desktop environment to choose, walk you through setting up XRDP on an Ubuntu or Debian VPS step by step, and summarise how to ensure a fast and secure connection.

When is it worth installing a graphical interface on a Linux VPS?

It’s a good idea if:

  • If you were to run a program that only has a graphical user interface,
  • Would you like to work on the server via a browser, for example via an admin interface accessible from an internal network, or monitor automated browser tasks,
  • Would you like a remote development machine (for example, with VS Code or a Java IDE) that doesn’t put a strain on your own laptop,
  • You need a Linux desktop that’s always running and accessible from anywhere.

There’s no point in just running a web server, database or other background service: SSH is faster, more secure and doesn’t use up resources. We have a separate guide on how to use SSH securely.

If your program is designed for Windows (such as MetaTrader or a Hungarian accounting program), don’t try to run it on Linux: a Windows VPS with native remote desktop is a more reliable solution.

XRDP, X2Go or VNC?

Criteria XRDP X2Go VNC (e.g. TigerVNC)
Protocol RDP (Windows Remote Desktop Protocol) NX, via SSH RFB
Client Windows’ built-in Remote Desktop client, Windows App, Remmina X2Go Client (Windows, macOS, Linux) Any VNC client
Speed on a slow connection Good Very good Weaker
Encryption TLS SSH It isn’t available by default; you’ll need an SSH tunnel
Port 3389 22 (SSH) 5,900+ views
Desktop environment Whatever the case, XFCE is recommended XFCE, MATE, LXQt (GNOME and KDE to a limited extent) Anything
Who is it recommended for? For Windows users who would like to use the familiar client For slow or mobile connections, and security-conscious use For sharing a physical screen, in simple cases

XRDP is most convenient if you’re working on Windows: you connect using the built-in Remote Desktop Connection program, just as you would to a Windows server, and the clipboard and audio also work.

X2Go works via SSH, so there’s no need to open another port, and it runs surprisingly smoothly even on slow connections. However, it doesn’t work well with modern desktops that require a compositor (GNOME, KDE Plasma).

VNC shares an existing screen, so it’s good for remotely accessing a physical machine. It’s slower on a server and doesn’t encrypt by default, so it should only be used via an SSH tunnel.

Which desktop environment should you choose?

A VPS does not have a graphics card; the image is rendered by the processor, so a lightweight desktop environment is required.

  • XFCE: the best choice in most cases. It uses little memory (around 300–500 MB when idle), is stable, and works well with both XRDP and X2Go.
  • MATE or LXQt: these are also easy to use once you’ve got used to them.
  • GNOME or KDE Plasma: they look good, but they use a lot of memory and CPU, and often stutter on a remote desktop. We do not recommend them for VPS.

How much memory do you need? For XFCE and a web browser, at least 2 GB; for comfortable use, 4 GB of RAM. If other services are running on the server, factor those in as well. From aWh’s range of KVM VPS plans, we recommend at least the 2 vCPU, 4 GB plan for graphics-intensive use.

Setting up XRDP on an Ubuntu or Debian VPS

The steps below work on Ubuntu 24.04 and Debian 12 systems.

1. Update the system and create your own user account (if you don’t already have one):

sudo apt update && sudo apt upgrade -y
sudo adduser janos
sudo usermod -aG sudo janos

2. Install the XFCE desktop environment and XRDP:

sudo apt install -y xfce4 xfce4-goodies xrdp

3. Add XRDP to the ssl-cert group so that it can read the certificate:

sudo adduser xrdp ssl-cert

4. Configure XRDP to launch XFCE (using your own user account):

echo "xfce4-session" > ~/.xsession

5. Start it and set it to start automatically:

sudo systemctl enable --now xrdp

6. Open the port only for your own IP address (using the UFW firewall):

sudo ufw allow from 203.0.113.10 to any port 3389 proto tcp

Next, launch Remote Desktop Connection (mstsc) on your own computer, enter the VPS’s IP address, and log in using the user account you created. On Macs and mobile phones, you can use the Windows App; on Linux, you can use the Remmina client.

Tip: do not log in to the graphical interface as root, and do not be logged in to both the server’s physical (or VNC) console and XRDP at the same time using the same username, as this may cause a black screen.

Video: How to Install XRDP on Ubuntu 24.04 | Remote Desktop Setup Guide (ZacsTech)

Security

Remote desktop is another point of access to the server, so it must be protected in the same way as SSH.

  • Don’t open the port to the entire internet. It’s best to only allow port 3389 (or 590x for VNC) through the firewall from your own IP addresses, or not to open it at all and connect via an SSH tunnel instead.
  • SSH tunnel: run this command on your own machine (on Windows 10/11, the built-in OpenSSH client will do):

    ssh -L 13389:localhost:3389 janos@203.0.113.10
    

    Next, in the remote desktop client, connect to localhost:13389. The connection will then run over the encrypted SSH channel, and there is no need whatsoever to make port 3389 accessible from outside the server. This is how X2Go works by design.

  • A strong password for the user, as XRDP uses password-based login, and Fail2ban to block attackers.
  • Updates: both your desktop environment and your browser receive security patches; make sure you install these regularly too.

We have covered server-side protection in detail in our VPS security guide.

Here’s how to make it faster

  • Choose a lightweight desktop environment (XFCE) and disable the compositor (Settings › Window Manager Fine-Tuning › Compositor).
  • Reduce the colour depth and resolution in the client, and disable the background image and animations.
  • Disable hardware acceleration in your browser, as VPS servers do not have a graphics card, and software-based rendering may therefore be faster.
  • If you’re on a slow or mobile connection, try X2Go, which is usually smoother than XRDP in such cases.
  • Keep an eye on the server load: if the processor is constantly at 100 per cent or you run out of memory, your remote desktop won’t be any faster; in that case, you’ll need a larger plan.

A VPS without a graphics card is not suitable for video playback or 3D applications; a server with a GPU would be required for these.

Common errors

  • Black screen after logging in: the ~/.xsession file is missing or corrupted, or the same user is logged in to another session. Check the file and log out of the other session.
  • The connection is immediately lost: check the XRDP logs (/var/log/xrdp.log and /var/log/xrdp-sesman.log); often, the certificate lacks read permissions (see step 3).
  • Unable to connect: check whether the service is running (systemctl status xrdp), whether the port is open on the firewall for your own IP address, and whether your IP address has changed.

Summary

On a Linux server, a graphical interface is the exception rather than the rule, but if you need one, it works smoothly with a lightweight XFCE desktop and XRDP or X2Go. From Windows, XRDP is the most convenient; on a slow connection, X2Go is the fastest; and you should only use VNC via an SSH tunnel. Never leave the port open to the entire internet.

aWh’s KVM VPS servers, with guaranteed processor and memory, NVMe SSDs and Ubuntu, Debian, AlmaLinux or Rocky Linux operating systems, provide a solid foundation for a remote Linux workstation, from €4.62 (excluding VAT).

Frequently Asked Questions

Which is the fastest Linux remote desktop solution?

X2Go generally runs smoothly on a weak or mobile connection, whilst XRDP also runs smoothly on a good connection. VNC is the slowest of the three.

Can I connect to a Linux VPS from Windows?

Yes. With XRDP, using Windows’ built-in Remote Desktop Connection program, and with X2Go, using the X2Go Client.

How much memory is needed for the graphical interface?

At least 2 GB for XFCE and a web browser; 4 GB for comfortable use, in addition to the other services running on the server.

Which is the lightest desktop environment?

XFCE offers the best balance between low resource usage and convenience; LXQt is even lighter still.

Is VNC secure without an SSH tunnel?

No. VNC does not encrypt traffic by default, so passwords and screen content can be intercepted. Always use it via an SSH tunnel.

Are XRDP and X2Go free?

Yes, both are open-source, free software, just like XFCE and the clients.

Which Linux distribution should I choose?

Ubuntu and Debian are the easiest to use, as most guides are written for these, and all the necessary packages are available in the official repositories.

What internet speed do you need?

A few Mbps is enough for office work; latency (ping) is just as important as bandwidth.

Back to the blog