Debian RDP Server Setup in 2025—How to Install and Use XRDP on Debian

Setting up remote desktop access on a Debian server isn’t something I thought I’d be doing three years ago. Back then, SSH was enough for everything. But remote work changed that completely.

XRDP gives you GUI access to your Debian box from anywhere. Whether you’re troubleshooting from home or need to show a colleague something visual, it beats trying to explain terminal commands over Slack.

What is XRDP and Why Use It for Debian Remote Desktop?

Multi-user Debian access
XRDP implements Microsoft’s Remote Desktop Protocol on Linux systems. Unlike VNC, which requires its own client software, RDP works with the built-in Windows Remote Desktop Connection.

The demand for remote desktop solutions has exploded, with the global remote desktop software market projected to reach $11.98 billion by 2032. This reflects how common remote access has become.

Here’s why I prefer XRDP over alternatives:

  • Works with Windows’ native RDP client
  • Encrypts connections by default
  • Supports multiple simultaneous users
  • Uses less bandwidth than most VNC implementations
  • Handles clipboard and file sharing reasonably well

Debian runs on 96.3% of top web servers, commanding 16% of the Linux server market. That widespread use means plenty of documentation when things go sideways.

System Requirements for Debian RDP Server

Debian RDP requirementsYou’ll need a few things before starting:

  • Debian 10, 11, or 12
  • At least 2GB RAM (learned this when my 1GB instance kept crashing)
  • Root or sudo access
  • Network connection for downloads
  • 2GB free disk space minimum

For cloud setups, a Debian VPS works well. I’ve tested this on DigitalOcean droplets and Linode instances without issues.

How to Update Debian Before XRDP Installation

Debian update process
Always update first. I once spent two hours debugging package conflicts that a simple update would have prevented.

sudo apt update && sudo apt upgrade -y

This pulls the latest package information and applies security patches. The -y flag skips confirmation prompts.

How to Install A Desktop Environment for XRDP on Debian

Remote desktop environment
Most Debian servers run headless. You need a desktop environment for XRDP to work properly.

sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils -y

I use Xfce because it’s lightweight and stable over remote connections. GNOME works too but uses more resources. The xfce4-goodies package adds useful extras like a calculator and text editor.

Step-by-Step XRDP Installation on Debian Server

Debian XRDP status
Install XRDP from Debian’s repositories:

sudo apt install xrdp -y

Check if it started correctly:

sudo systemctl status xrdp

You should see active (running) in green. If not, something went wrong with the installation.

How to Configure XRDP Settings and User Sessions on Debian

Debian session setup

XRDP needs some tweaking to work smoothly. The default configuration causes problems I’ve run into multiple times.

Configuring User Sessions for Debian XRDP

Create a session file for each user who needs RDP access:

echo "xfce4-session" > ~/.xsession

Without this file, you’ll get a blank desktop after logging in. Took me forever to figure this out the first time.

How to Add XRDP User to SSL-Cert Group

XRDP needs access to SSL certificates for secure connections:

sudo adduser xrdp ssl-cert

Restarting XRDP Service After Changes

Restart the service to pick up configuration changes:

sudo systemctl restart xrdp

How to Open Port 3389 for RDP on Debian

RDP firewall open
RDP uses port 3389. You need to open this in your firewall while keeping everything else locked down.

Secure RDP Access with UFW Firewall on Debian

UFW (Uncomplicated Firewall) is simpler for basic setups:

sudo ufw allow 3389/tcp

For better security, restrict access to your IP address:

sudo ufw allow from YOUR_IP_ADDRESS to any port 3389

Replace YOUR_IP_ADDRESS with your actual public IP.

How to Use nftables for XRDP Firewall Rules

If you’re using nftables instead of UFW:

sudo nft add rule inet filter input tcp dport 3389 ct state new, established counter accept

I prefer UFW for most situations, but nftables gives you more granular control if you need it.

How to Edit XRDP.ini for Security and Performance

The default XRDP setup works for basic access, but you might want to customize connection settings or security parameters.

Edit the main configuration file:

sudo nano /etc/xrdp/xrdp.ini

Key settings to consider:

  • security_layer=tls – Forces TLS encryption
  • crypt_level=high – Maximum encryption level
  • port=3389 – Change this to run on a different port

Configuring StartWM.sh for Stable XRDP Sessions

The session startup script controls what happens when users connect:

sudo nano /etc/xrdp/startwm.sh

Add these lines at the end to prevent common session issues:

unset DBUS_SESSION_BUS_ADDRESS

unset XDG_RUNTIME_DIR

exec startxfce4

These environment variables can interfere with desktop session startup. I encountered this problem when trying to run applications that needed D-Bus communication.

Connecting to Debian RDP Server

Debian RDP login Once configured, connecting is straightforward from different operating systems.

How to Connect to Debian XRDP from Windows

Windows includes an RDP client by default:

  1. Search for “Remote Desktop Connection”
  2. Enter your server’s IP address
  3. Click Connect
  4. Enter your Debian username and password
  5. Select “Xorg” when prompted for session type

The connection usually establishes within a few seconds on a local network.

How to Connect to Debian XRDP from Linux (Using Remmina)

Install Remmina, which handles RDP connections well:

sudo apt install remmina remmina-plugin-rdp

Remmina provides a GUI for managing multiple remote connections. You can save connection profiles and adjust display settings per connection.

Best Practices to Secure Debian RDP Server

TLS certificate lock
RDP has significant security implications. Cybercriminals abuse RDP in 90% of attacks handled by incident response teams.

How to Enable TLS Encryption for XRDP on Debian

Generate self-signed certificates for encrypted connections:

sudo mkdir -p /etc/xrdp/certs

cd /etc/xrdp/certs

sudo openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365

This creates certificates valid for one year. Use a proper CA certificate in production environments.

How to Set Up SSH Tunnel for RDP on Debian

For maximum security, tunnel RDP through SSH:

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

Then connect to localhost:3389 instead of the server’s public IP. This encrypts all RDP traffic through the SSH tunnel.

Change XRDP Port from 3389 to Custom Port

Change the default port to reduce automated attack attempts:

sudo nano /etc/xrdp/xrdp.ini

Change port=3389 to something like port=13389, then restart XRDP. Remember to update your firewall rules accordingly.

Troubleshooting XRDP Issues on Debian

Xorg config edit
Several problems crop up regularly with XRDP installations.

How to Solve Wayland and XRDP Compatibility Issues

XRDP doesn’t work properly with Wayland display servers. Force the system to use Xorg:

sudo nano /etc/gdm3/custom.conf

Uncomment this line:

WaylandEnable=false

Wayland’s security model conflicts with how XRDP accesses the display system. This won’t be fixed anytime soon.

Configuring Multiple User Sessions in XRDP

Each user needs their own session configuration:

echo "xfce4-session" | sudo tee /home/username/.xsession

sudo chown username: username /home/username/.xsession

Replace username with the actual username. Without proper ownership, the session file won’t work.

How to Optimize XRDP Speed on Slow Connections

Xfce vs GNOME
Several tweaks improve RDP performance, especially over slower connections:

  • Use Xfce instead of GNOME or KDE
  • Disable desktop animations and effects
  • Reduce screen resolution for remote sessions
  • Enable compression in your RDP client
  • Consider Ubuntu VPS or Fedora VPS if Debian doesn’t meet your needs

The biggest performance gain comes from choosing a lightweight desktop environment. GNOME can use 500MB+ of RAM just for the desktop, while Xfce uses about 200MB.

 

Debian RDP Setup Video [Install XRDP for remote desktop server]

Conclusion

XRDP transforms a headless Debian server into something you can manage graphically from anywhere. The setup process has its quirks, but once working, it’s quite reliable.

For production deployments, consider managed solutions like Buy RDP services that handle the complexity for you.

Keep your system updated and monitor access logs regularly. If you’re comparing distributions, check out Debian vs Ubuntu to see which fits your requirements better.

 

FAQ

XRDP uses port 3389 by default, which is the standard RDP port.
Yes, XRDP works with various desktop environments including XFCE, GNOME, KDE, and LXDE.
Use the command sudo systemctl status xrdp to verify service status.
No, it’s recommended to use SSH tunneling or VPN for secure remote access instead.
XRDP uses the RDP protocol for native Windows client compatibility, while VNC uses its own protocol.
XRDP supports multiple concurrent sessions, limited by system resources and configuration.
This usually indicates missing .xsession file or desktop environment configuration issues.
Yes, modify the port setting in /etc/xrdp/xrdp.ini and restart the service.

Share :

8 Responses

    1. To check what port your RDP is currently listening on, use the netstat command in an elevated command prompt. This will show information about current network connections and listening ports, as well as associated executables and processes. You’ll see port 3389 bound to ìsvchost.exeî on ìTermService

  1. I had some issues with installing my XRDP . which port is suitable to make remote connection to other computer?
    is it port 3389?

    1. Remote Desktop Protocol (RDP) is a Microsoft proprietary protocol that enables remote connections to other computers, typically over TCP port 3389.

  2. I tried to do all the steps one by one, but I’ve heard that I need to make a little changes on XRDP config .do you know Where it is?

    1. The Xrdp configuration files are located in the /etc/xrdp directory. For basic Xrdp connections, you do not need to make any changes to the configuration files. Xrdp uses the default X Window desktop, which in this case, is XFCE. The main configuration file is named xrdp

    1. In general, Remote Desktop Protocol is known to be more functional and faster than VNC. However, both RDP and VNC can be the best option for different users with different purposes in mind

Leave a Reply

Your email address will not be published. Required fields are marked *