How to Install XRDP on Ubuntu Server?

Learn how to set up XRDP on Ubuntu Server, install a graphical interface, configure Xorg, and access your server through an RDP client.
8 min read
Intermediate
Install XRDP on Ubuntu Server ?

By default, Ubuntu servers use a command-line interface, which is suitable for managing most server tasks through SSH. However, if you need to manage your Ubuntu VPS through a graphical interface, you can install XRDP, which provides a way to connect to your server using the Remote Desktop Protocol (RDP).

It works with standard RDP clients and provides a graphical session without requiring you to use SSH for everyday interactions. You can set it up on your local Ubuntu system to access it remotely or use it on an Ubuntu VPS running in the cloud online. If you don’t have a VPS, you can get one from VPSMakers.

In this guide, we’ll cover the complete XRDP installation process on an Ubuntu server. This includes updating packages, installing a desktop environment, and installing and configuring XRDP. We’ll also cover establishing a connection and resolving common issues.

Note:

All steps and solutions in this guide have been tested and verified by the VPSMakers technical team on an Ubuntu VPS running Ubuntu 24.04 LTS Server and a local machine running Ubuntu 26.04 LTS. The installation and configuration steps are also applicable to older Ubuntu versions, so you can follow this guide on earlier releases as well.

Prerequisites for Installing XRDP on Ubuntu Server

Before installing XRDP, make sure you have a running Ubuntu server installation. This guide uses Ubuntu 24.04, but as mentioned before, other versions can be used too. You also need root or sudo privileges to install packages, modify system configurations, and manage services.

Make sure you have an internet connection to download XRDP and the desktop environment packages. Since Ubuntu Server doesn’t include a graphical desktop environment by default, you will need to install a graphical interface first to establish a connection.

You can follow this guide to install GNOME GUI on your Ubuntu VPS:

How to Install Gnome on Ubuntu server
READ How to Install Gnome on Ubuntu server

Finally, if you’re using Windows as your client device, make sure Remote Desktop Connection (RDC) is available. You also need to ensure that port 3389 is allowed through the firewalls on both the server and client networks. If you’re using Ubuntu as your client device, you can install Remmina on Ubuntu to connect to your remote server.

How to Install XRDP on Ubuntu Server

After installing a desktop environment on your Ubuntu server, the next step is to install XRDP. XRDP is available in the default Ubuntu package repositories, so you can install it directly from the APT package manager without adding any third-party repository.

Update Ubuntu Package List

First, update the apt package list to make sure you are installing the latest available version from the configured repository. You can use the command below, or if you want more detailed information about updating packages in Linux, you can follow this guide:

update in Linux handled by package manager, you’ll learn how to update all packages or specific package, simulate upgrade, full upgrade on Linux.

Read the full article

Run the following command after logging in with SSH to update apt list:

sudo apt update

Install XRDP on Ubuntu Server

Next, run the following command to install XRDP along with its required dependencies. Apt will download and install XRDP itself.

sudo apt install xrdp -y

Once the installation is complete, you can verify that XRDP is installed by checking its version:

xrdp --version

After installation, XRDP creates a system service that handles incoming remote desktop connections. In the next step, we’ll start and enable this service so it runs automatically whenever your Ubuntu server reboots.

Note:

While installing XRDP, you may encounter network errors or issues such as getting stuck at “Waiting for headers.” You can resolve these problems by configuring a DNS server on Ubuntu and changing the APT repository.

Configure XRDP on Ubuntu

XRDP uses a configuration file located at /etc/xrdp/xrdp.ini which controls settings such as the listening port, connection security, and available session types. After installing, you may need to configure it to ensure the remote desktop session works correctly.

Check XRDP Service Status

Before making any changes, check whether the XRDP service is running or not. If the service is active, you should see active (running) in the output.

sudo systemctl status xrdp
OUTPUT
 xrdp.service - xrdp daemon
     Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; preset: enabled)
     Active: active (running) since Sun 2026-11-29 09:15:37 UTC; 30min ago

If it is not started yet, you can use the following command:

sudo systemctl start xrdp

Configure XRDP Session on Ubuntu

After installing and starting XRDP, you need to configure the remote desktop session, so XRDP knows which graphical environment to start when you connect to your Ubuntu server.

To do this, create an .xsession file in the home directory of the user you’ll use for the RDP connection. The command depends on your installed desktop environment; depending on that, select the tab and run the command.

BASH
echo "gnome-session" > ~/.xsession
BASH
echo "xfce4-session" > ~/.xsession
BASH
echo "startplasma-x11" > ~/.xsession

Warning:

Choose the command that matches your installed desktop environment. Do not run all three commands, as each one overwrites the previous session configuration.

Install Xorg In Ubuntu Server

Due to compatibility requirements, GNOME and KDE sessions through XRDP require the Xorg display server and the xorgxrdp integration package. If you’re using XFCE instead, you can skip this step if the required Xorg components are already installed.

Run the following command to install Xorg and its XRDP integration:

sudo apt install xrdp xorgxrdp xserver-xorg-core -y

Once the installation is finished, follow the steps in the next section to restart the XRDP services; then you can connect to your Ubuntu.

Restart XRDP Service

After configuring the session, restart XRDP using the following command to apply the changes:

sudo systemctl restart xrdp

Allow XRDP Through the UFW Firewall

After setting all things up you need to allow the XRDP connection from the UFW firewall if you are using on your Ubuntu. When you buy Ubuntu VPS from VPSMakers or another provider, UFW is installed but disabled; you can enable it for better security and allow only your required connections.

First, check if UFW is running or not:

sudo ufw status

If UFW is enabled, allow incoming connections on port 3389 using the following command. If UFW is not installed and configured on your Ubuntu, you can follow this guide to set it up.

Learn how to set up UFW on Ubuntu, including installation, SSH configuration, default policies, firewall activation, logging, and verification.

Read the full article
sudo ufw allow 3389/tcp

You can then verify that the rule has been added successfully:

sudo ufw status

For more detailed information about how you can allow a connection from UFW using a port number or IP address, you can follow this guide. You can also use it to restrict XRDP connections to only specific IP addresses.

How to Open a Port or IP With UFW in Ubuntu?
READ How to Open a Port or IP With UFW in Ubuntu?

Note:

If your VPS provider has an external firewall or security group, make sure TCP port 3389 is also allowed there. UFW rules alone cannot override restrictions applied by an external firewall.

Connect to Ubuntu Server Using Remote Desktop (RDP)

After setting all things up, you can connect to your XRDP using any RDP-compatible client, including Remote Desktop Connection (RDC) in Windows, Windows APP on Android, and Remmina in Linux.

In this example, we are using Remote Desktop Connection on a Windows computer; you can instead use any other RDP client app. The whole process is the same. Search for RDC in the Windows Start menu or press Win + R to open the Run dialog and enter mstsc.

Enter the Ubuntu Server IP address or domain name, if any, to bind to, and press Connect.

Connect to XRDP using RDC

You may encounter a certificate warning during the connection process because XRDP uses a self-signed certificate that is not issued by a trusted Certificate Authority (CA). This is expected with the default configuration.

If you’ve verified that you’re connecting to your own server, you can accept the warning and continue. You’ll then be prompted to enter your Ubuntu username and password to log in.

Connect to XRDP using Remote Desktop Connection app on Windows

You can now connect to Ubuntu and use it through a graphical interface. However, the manually installed desktop environment may not look exactly like the standard Ubuntu Desktop edition and may require some additional customization to match its original appearance. Despite that, it works smoothly and provides a good remote desktop experience.

How to Uninstall XRDP from Ubuntu

If you no longer need remote desktop access to your Ubuntu VPS Server, you can remove XRDP from Ubuntu using the APT package manager.

First, stop and disable the XRDP service:

sudo systemctl disable --now xrdp xrdp-sesman

Then remove XRDP and its related packages:

sudo apt remove xrdp xorgxrdp -y

If you also want to remove unused dependencies, run:

sudo apt autoremove -y

Note:

These commands remove XRDP and its related packages from Ubuntu while leaving your installed desktop environment, such as GNOME or XFCE, intact. If you also want to remove the desktop environment, you must uninstall it separately.

Summary

By installing a graphical desktop environment and XRDP on your Ubuntu Server VPS, you can set up a remote desktop connection and manage your server through a graphical interface.

The installation process includes updating the APT package list, installing a desktop environment such as GNOME, KDE, or XFCE, and installing XRDP. You will then need to configure XRDP according to your chosen desktop environment. For GNOME and KDE setups, installing Xorg and the xorgxrdp integration package is also necessary to provide the graphical session required by XRDP.

In this guide, we’ve covered everything from installing the required packages and configuring XRDP to establishing a remote desktop connection. We’ve also included fixes for some of the installation and connection issues we encountered during our own testing.

Share:

Was this article helpful?

Your feedback helps us improve our technical guides.

Related Posts

You May Also Like

Explore more tutorials, guides, or documentation, from VPSMakers.

Learn how to set up XRDP on Ubuntu Server, install a graphical interface, configure Xorg, and access your server through an RDP client.
Richard Mourar
November 29, 2026
Learn how to block websites on MikroTik using DNS filtering, Layer 7 protocols, and TLS Host rules. Includes WinBox and CLI instructions.
Jacob Rafet
November 29, 2026
Learn how to temporarily or permanently disable IPv6 on Ubuntu, Debian, and other Linux distributions with simple commands.
Robert Smith
November 28, 2026
Learn how to easily update MikroTik router firmware manually using WinBox and CLI. Stay up to date with the latest updates!
Jacob Rafet
November 24, 2026