If you need to connect to a remote desktop, then XRDP will come to the rescue. This tool stands for X Remote Desktop Protocol and is an open remote desktop protocol. Using it allows you, as a remote user, to connect to a Linux graphical desktop over a network. Let’s look at the process of installing xRDP on Linux (in particular, let’s look at installation on the Ubuntu 22.04 operating system). Here’s how to install XRDP on Linux:

XRDP installation

Use your Linux distribution’s package manager to install the XRDP package. For example, for Ubuntu this can be done using the command that will be described below (it is recommended to update the packages first):

sudo apt update

sudo apt install xrdp

Setting up the XRDP service

It is imperative that after installing XRDP it should start automatically. If not, try starting it manually. Use the following command for this:

sudo systemctl start xrdp

To have XRDP run every time the system starts, run the following simple command:

sudo systemctl enable xrdp

You’ll receive the following answer

Checking the connection

After successfully running the previous two commands, you should now be able to verify that XRDP is installed and running. Next, we advise you to try to connect to the remote desktop from another computer using any RDP client. Enter your server’s IP address and Linux user credentials.

Setting up a firewall

If you have a firewall enabled, make sure it allows incoming connections on port 3389 (RDP port). To do this use the following command:

ufw allow from 192.168.1.0/24 to any port 3389

You’ll receive the following answer

This article covered the basic steps to install and configure XRDP on Linux. You will then be able to connect to your Linux desktop remotely using any RDP client. Your xRDP connection will look like this