desk-plus › Blog

xrdp: how to set up an RDP server on Linux (Debian, Ubuntu, Mint)

Published · desk-plus

xrdp is a free RDP server for Linux. It lets you operate a Linux desktop with any RDP client, including Remote Desktop Connection on Windows.

Install xrdp on Debian, Ubuntu and Linux Mint

sudo apt update
sudo apt install xrdp
sudo systemctl enable --now xrdp
sudo adduser xrdp ssl-cert

The last command lets xrdp read the system certificate for the encrypted connection. Restart the service afterwards:

sudo systemctl restart xrdp

On Fedora and openSUSE the package is also called xrdp and is installed with dnf or zypper.

Choose the desktop environment

xrdp starts a session of its own. It runs most reliably with Xfce:

sudo apt install xfce4
echo xfce4-session > ~/.xsession

For KDE Plasma the entry is startplasma-x11. GNOME ships its own RDP server, see GNOME Remote Desktop.

Firewall

xrdp listens on port 3389. Open it for your own network only:

sudo ufw allow from 192.168.0.0/16 to any port 3389

Connect

On Windows, open Remote Desktop Connection and enter the address of the Linux machine. On Linux, use Remmina. In the xrdp sign-in window leave the session on "Xorg", then enter the user name and password of the Linux account.

Common errors

  • Black screen: the user is already signed in locally. Sign out locally, or create a separate account for remote access.
  • Session closes immediately: ~/.xsession names a session that is not installed.
  • Repeated password prompts: polkit rules for colour management and networking are missing. Xfce is hardly affected.
  • Sluggish display: lower the colour depth in the client to 16 or 24 bit and switch off desktop effects.

Securing xrdp

  • Do not expose port 3389 to the internet.
  • From outside, connect only over a VPN or an SSH tunnel: ssh -L 3389:localhost:3389 user@server.
  • Restrict sign-in to individual users and apply updates promptly.

If you would rather not maintain the server

xrdp installs quickly, but hardening, updates and backups stay with you. A managed Linux desktop in the browser takes that off your hands. At desk-plus you choose KDE Plasma, GNOME or Xfce and pay from €9.74 a month.

A Linux desktop in your browser from €9.74 a monthKDE Plasma, GNOME or Xfce. Cancel monthly, no setup fee.
Configure your desktop