How to Install Xrdp Server (Remote Desktop) on Ubuntu 24.04
Step-by-step guide on how to install Xrdp server on Ubuntu 24.04 LTS. Configure desktop environments, SSL certificates, firewall rules, and RDP.

7 min read
Step-by-step guide on how to install Xrdp server on Ubuntu 24.04 LTS. Configure desktop environments, SSL certificates, firewall rules, and RDP.
- Prerequisites and Supported Releases
- Step 1: Updating System Repositories and Upgrading Packages
- Step 2: Installing the Lightweight XFCE Desktop Environment
Managing remote Linux systems through the command line using SSH is standard practice for system administrators and cloud engineers. However, there are numerous scenarios where a graphical user interface (GUI) is required. Whether you need to run proprietary graphical applications, manage IDEs, perform browser testing in native Linux display environments, or support team members unfamiliar with terminal interfaces, remote desktop access is an invaluable capability.
Xrdp is a high-performance, open-source implementation of Microsoft's Remote Desktop Protocol (RDP) for Unix-like operating systems. Unlike VNC, which often transmits uncompressed screen bitmaps and requires dedicated client software, Xrdp integrates seamlessly with standard RDP clients built into Windows (Remote Desktop Connection), macOS (Microsoft Remote Desktop), and Linux (Remmina). Understanding how to install xrdp server on ubuntu 24.04 enables you to build a secure, responsive remote desktop workstation in minutes.
In this tutorial, we cover the complete installation and configuration of Xrdp on Ubuntu 24.04 LTS (Noble Numbat). We guide you through installing a lightweight, responsive desktop environment (XFCE), configuring Xrdp user permissions, resolving common display and polkit authorization issues, opening firewall ports securely with UFW, and establishing secure remote connections.
Install and configure the Xrdp remote desktop server on Ubuntu 24.04 LTS using the lightweight XFCE desktop environment, SSL certificates, and UFW firewall rules.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat). The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- A physical machine, virtual server, or cloud instance running
Ubuntu 24.04 LTS. - A user account with
sudoadministrative privileges. - At least
2 GB of RAM(4 GB or more recommended for web browsers and graphical applications). - A standard RDP client (Windows Remote Desktop, Microsoft Remote Desktop for macOS, or Remmina for Linux).
Step 1: Updating System Repositories and Upgrading Packages
Before installing a desktop environment and remote desktop daemon, ensure that your system package lists are completely updated. Operating system updates ensure library compatibility across display drivers and cryptographic components.
Run the following commands to update package catalogs and apply any pending package upgrades.
Once the updates finish, your system will be ready for desktop environment installation.
# Update package index and upgrade installed packages
sudo apt update && sudo apt upgrade -y
Step 2: Installing the Lightweight XFCE Desktop Environment
Standard Ubuntu Server installations do not include a graphical desktop environment. Before Xrdp can render a session, a window manager and desktop shell must be present on the host.
While you can install the full GNOME desktop environment (ubuntu-desktop), GNOME requires substantial memory and hardware 3D acceleration. On virtual private servers (VPS) and cloud instances, GNOME can feel sluggish over remote connections. For optimal responsiveness, low latency, and minimal resource usage, we recommend XFCE.
Install XFCE and its collection of utilities by executing the command below.
# Install XFCE4 and recommended supplementary desktop utilities
sudo apt install -y xfce4 xfce4-goodies
Step 3: Installing the Xrdp Server Package
Xrdp is available directly from Ubuntu 24.04's default package repositories. Install the package using APT.
Once installation finishes, the Xrdp service starts automatically. Verify that the daemon is active and listening on the standard RDP port 3389.
Inspect the active service status using systemctl.
# Install Xrdp server
sudo apt install -y xrdp
# Verify Xrdp daemon status
sudo systemctl status xrdp --no-pager
Step 4: Granting Certificate Access to the Xrdp Service
By default, Xrdp utilizes an SSL private key located at /etc/ssl/private/ssl-cert-snakeoil.key to encrypt network traffic between the client and server. However, this key is only readable by members of the ssl-cert group.
If the xrdp service user is not in this group, Xrdp will fail to read the certificate and disconnect remote clients abruptly.
Add the xrdp user to the ssl-cert group by executing the command below.
# Add xrdp user to the ssl-cert system group
sudo adduser xrdp ssl-cert
Step 5: Configuring Session Startup for XFCE
Next, configure Xrdp to launch the XFCE desktop environment whenever a user initiates an RDP session. Edit the global window manager startup script at /etc/xrdp/startwm.sh.
Scroll to the bottom of /etc/xrdp/startwm.sh, comment out the default session triggers, and append exec startxfce4 at the end.
Alternatively, create an individual session file ~/.xsession inside your user home directory to ensure personal sessions launch XFCE reliably.
Restart the Xrdp service to apply all configuration changes.
# Configure user-specific xsession file
echo 'startxfce4' > ~/.xsession
chmod 644 ~/.xsession
# Restart Xrdp daemon to load configuration
sudo systemctl restart xrdp
Step 6: Resolving Polkit Color Management Dialogs
On Ubuntu 24.04, users connecting via remote desktop sessions frequently encounter recurring authorization popups requesting administrative passwords, such as 'Authentication is required to create a color managed device'. These prompts are generated by Polkit because remote Xrdp sessions are classified as inactive local seats.
To eliminate these disruptive prompts and provide a smooth desktop experience, create a custom Polkit rule file at /etc/polkit-1/rules.d/45-allow-colord.rules.
Save the rule file and assign appropriate 0644 permissions.
# Create Polkit override rule to suppress colord prompts
sudo bash -c 'cat <<EOF > /etc/polkit-1/rules.d/45-allow-colord.rules
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile") &&
subject.isInGroup("sudo")) {
return polkit.Result.YES;
}
});
EOF'
sudo chmod 0644 /etc/polkit-1/rules.d/45-allow-colord.rules
Step 7: Configuring UFW Firewall and SSH Tunneling
To allow remote RDP connections, configure Ubuntu's Uncomplicated Firewall (UFW). Xrdp communicates on TCP port 3389.
If you are connecting over a trusted local private network or VPN, open port 3389.
For public cloud servers, restrict access exclusively to your trusted static IP address, or forward port 3389 securely over an SSH tunnel rather than exposing the RDP port directly to the public internet.
To connect via an SSH tunnel, forward local port 3390 to remote port 3389 as shown in the example.
# Option A: Allow port 3389 from a specific trusted IP address
sudo ufw allow from 203.0.113.50 to any port 3389 proto tcp
# Option B: Establish a secure SSH tunnel from your local machine
# ssh -L 3390:127.0.0.1:3389 user@server-ip
# (Connect your RDP client to localhost:3390)
Step 8: Connecting from Windows, macOS, and Linux Clients
With the server configured and firewall rules active, connect using your client of choice.
On Windows, open Remote Desktop Connection (mstsc.exe), enter your server IP address, and click Connect.
On macOS, launch Microsoft Remote Desktop, add a PC with your server IP, and connect.
On Linux, launch Remmina, choose RDP, enter the host address, and initiate the connection.
When the Xrdp login prompt appears, select session type Xorg, enter your Ubuntu username and password, and click OK to launch your XFCE desktop session.
# Verify active remote sessions on the server
who
w
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
Black screen immediately after login followed by session termination
Resolution: This typically occurs when the target user is already logged into an active local desktop session on the physical console. Linux desktop environments prevent simultaneous local and remote X11 sessions for the same user. Log out of all local physical sessions before connecting over Xrdp.
Authentication failed error at login window
Resolution: Ensure the user account has a valid Unix password configured using sudo passwd . Passwordless SSH-key-only accounts cannot authenticate to the Xrdp PAM prompt.
Xrdp fails to start or crashes immediately
Resolution: Check the systemd journal for Xrdp daemon errors by running sudo journalctl -u xrdp -e and inspect /var/log/xrdp.log and /var/log/xrdp-sesman.log.
Security Best Practices and Hardening
Never expose port 3389 directly to the public internet without strict IP whitelisting. Use an SSH tunnel or a private VPN (such as WireGuard) to shield Xrdp from automated brute-force attacks.
Ensure that root remote desktop login is disabled. Always authenticate using an unprivileged user account equipped with sudo privileges.
Always ensure that the xrdp user belongs to the ssl-cert group via sudo adduser xrdp ssl-cert so that TLS encryption keys in /etc/ssl/private/ are accessible.
Configure fail2ban or firewall rate-limiting on port 3389 if you must expose the RDP port directly to the internet.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
ubuntu-desktop. However, GNOME requires more RAM and CPU overhead, and Wayland sessions must be disabled in favor of Xorg inside /etc/gdm3/custom.conf for stable Xrdp compatibility.sudo adduser xrdp ssl-cert and log out of any local GUI sessions./etc/xrdp/xrdp.ini, updating the port=3389 directive, and restarting the service with sudo systemctl restart xrdp.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides


Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!