Install XRDP on Ubuntu 24.04 for Remote Desktop Access

Install XRDP on Ubuntu 24.04

Learn how to install and configure XRDP on Ubuntu 24.04 LTS to enable secure remote desktop access from Windows, macOS, or Linux. Step‑by‑step setup with firewall rules, troubleshooting tips and performance/security best practices.

Table of Contents

🔈Introduction

Remote desktop access to Linux machines is essential for administrators, remote workers, developers, or anyone needing GUI access without physical presence. On Ubuntu 24.04, XRDP offers a reliable way to allow Windows, macOS, or other Linux clients to connect via the Remote Desktop Protocol (RDP). This guide walks you through installing, configuring, securing, and troubleshooting XRDP on Ubuntu 24.04.


✅ What is XRDP

FeatureDescription
ProtocolRDP (Remote Desktop Protocol) – Microsoft standard
FunctionActs as a server on Ubuntu to accept remote desktop connections
CompatibilityWorks with Windows “Remote Desktop Connection,” Microsoft Remote Desktop on macOS, Remmina / FreeRDP on Linux, etc.
Ubuntu VersionAvailable in Ubuntu 24.04 “Noble” repositories – version ~0.9.24‑4 for amd64.

📋 Prerequisites

Before you begin, ensure:

  • ✅ You have an Ubuntu 24.04 system (desktop or server edition).
  • ✅ A user account with sudo privileges.
  • ✅ If it’s a server (no GUI), plan to install a desktop environment (DE).
  • ✅ Internet connectivity to fetch packages.
  • ✅ (Optional but highly recommended) a static IP or known hostname for remote access.

▶️ Install XRDP on Ubuntu 24.04

Open a terminal and run:

				
					sudo apt update && sudo apt upgrade -y
				
			
				
					sudo apt install xrdp -y
				
			

Confirm the installation and version:

				
					dpkg -l | grep xrdp && xrdp -v
				
			

You should see something like:

				
					ii  libpipewire-0.3-modules-xrdp:amd64            0.2-2                                    amd64        libraries for the PipeWire multimedia server - xrdp modules
ii  pipewire-module-xrdp                          0.2-2                                    all          audio over xrdp for PipeWire based systems
ii  xorgxrdp                                      1:0.9.19-1                               amd64        Remote Desktop Protocol (RDP) modules for X.org
ii  xrdp                                          0.9.24-4                                 amd64        Remote Desktop Protocol (RDP) server

xrdp 0.9.24
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-ipv6
      --enable-jpeg
...omitted for brevity...
				
			

This matches the Ubuntu Noble (24.04) package versions. Enable and start the XRDP service:

				
					sudo systemctl enable --now xrdp
				
			

Check status:

				
					sudo systemctl status xrdp
				
			

You want to see “active (running).”

Install XRDP on Ubuntu 24.04

Photo by admingeek from Infotechys


▶️ Install / Configure a Desktop Environment (if needed)

If you’re using Ubuntu Server or a minimal installation without a GUI, you need a desktop environment. GNOME is the default desktop in Ubuntu Desktop, but it may have compatibility issues with XRDP (especially with Wayland). Many guides recommend a lighter DE like XFCE. Example installing XFCE (below):

				
					sudo apt install xfce4 xfce4-goodies -y
				
			

If you want to ensure the DE is used for XRDP (instead of GNOME/Wayland), configure the session for XRDP to start with XFCE:

				
					echo "xfce4-session" > ~/.xsession
				
			

Alternatively, you can edit /etc/xrdp/startwm.sh to launch XFCE. For example, toward the bottom replace or insert:

				
					# Replace existing start up session lines
startxfce4
				
			

▶️ Configure XRDP settings

Some default configuration adjustments improve compatibility and usability:

  • Add xrdp user to ssl-cert group (so XRDP can access certificates):
				
					sudo adduser xrdp ssl-cert
				
			
				
					sudo systemctl restart xrdp
				
			
  • Disable Wayland if using GNOME (XRDP works best with Xorg). In /etc/gdm3/custom.conf, set:
				
					[daemon]
WaylandEnable=false
				
			

Ensure the .Xauthority or .xsession files have correct ownership (user:group) to avoid login fails.


▶️ Allow through the Firewall

By default, XRDP listens on TCP port 3389. To allow RDP connections:

				
					sudo ufw allow 3389/tcp && sudo ufw reload && sudo ufw status

				
			

If you want a more restrictive rule (only allow specific IPs):

				
					sudo ufw allow from <your‑client‑IP>/32 to any port 3389 proto tcp
				
			

🖥️ Connecting from Client Machines

Once XRDP is running and the firewall is configured:

  • On Windows: Open Remote Desktop Connection (mstsc), enter the Ubuntu host’s IP or hostname, connect using your Ubuntu username/password.
  • On macOS: Use Microsoft Remote Desktop app.
  • On Linux: Use Remmina or FreeRDP:
Install XRDP on Ubuntu 24.04: Remmina Login

Photo by admingeek from Infotechys

💡NOTE: If you get a blank screen or immediate disconnect, often it’s due to desktop environment mismatch or Wayland issue.

🧰 Common Issues & Troubleshooting

ProblemLikely CauseFix / Workaround
Blank screen after login via RDPSession failing to start; Wayland session incompatible; .xsession not setInstall and use XFCE; ensure .xsession contains “xfce4-session”; disable Wayland 
Login rejected for valid credentialsXRDP user not in ssl‑cert; incorrect session file ownership; user already logged in on consoleAdd user to ssl-cert; fix ownership of ~/.Xauthority and ~/.xsession; log out from physical console or reboot 
Port 3389 blocked / no connectionFirewall not open; networking issueUse sudo ufw allow 3389/tcp, check network/firewall rules, verify host IP reachable
Desktop environment too heavy / slow performanceGNOME + visual effects + remote protocol latencySwitch to lightweight DE e.g. XFCE; reduce display resolution; disable animations

🔹Checking logs

				
					sudo journalctl -u xrdp --no-pager | less
				
			
				
					sudo journalctl -u xrdp-sesman --no-pager | less
				
			

Look for errors relating to session startup, authorization, or missing DE components.


🛡️ Security Best Practices

  • Use strong passwords for your Ubuntu user accounts.
  • Limit access by firewall to only trusted IPs when possible.
  • Consider changing the default RDP port (though less effective than firewall/IP restrictions).
  • Keep the system updated.
				
					sudo apt update && sudo apt upgrade ‑y && sudo systemctl reboot
				
			
  • If exposing to internet, use VPN or SSH‑tunnel to RDP port.
  • Use Fail2Ban or similar to limit brute force attempts on XRDP.

🌐 Performance Tips

  • Select a lightweight desktop environment (e.g. XFCE, LXDE, MATE) rather than GNOME Heavy.
  • Lower screen resolution in your RDP client.
  • Disable high‑overhead graphical effects.
  • Use compression settings in RDP client, tune color depth.
  • Ensure network latency is low; use wired network if possible.

🏁 Conclusion

Installing XRDP on Ubuntu 24.04 gives you a robust, cross‑platform way to access the GUI of your machine remotely. With the steps above — installing XRDP, choosing the right desktop environment, configuring firewall rules, and applying some security/performance tweaks — most users will get stable remote desktop functionality. If you encounter issues, verifying sessions, logs, and agreeing DE / Wayland vs Xorg choices are often the critical fix points.

Did you find this article helpful? Your feedback is invaluable to us! Feel free to share this post with those who may benefit, and let us know your thoughts in the comments section below.


📕 Related Posts

Leave a Reply

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