How to Install xRDP Server on Ubuntu 20.04

xRDP is an open source software that allows you to work with a remote computer using a desktop session, just like on a local computer. In this tutorial, we will install an xRDP server on Ubuntu 20.04.

Installing desktop environment

First, we need to provide our Ubuntu server system with a desktop environment. Let’s install Gnome in this example.

apt install ubuntu-desktop

Installing and configuring xRDP

To install xRDP package, run:

apt install xrdp

You also need to grant access to the /etc/ssl/private/ssl-cert-snakeoil.key file for xrdp user. It is available to members of the ssl-cert group by default.

adduser xrdp ssl-cert

Restart the service.

systemctl restart xrdp

Firewall configuration

You need to open access on port 3389.

ufw allow 3389

It is more secure to open it only for your IP address or network. For example:

ufw allow from to any port 3389

The best practice is to use an SSH tunnel to connect to the remote desktop and make xRDP listen only for local connections.

xRDP connection to Ubuntu server 20.04

Please note that the user who will connect to xRDP must log out before doing so!

It’s time to establish an xRDP connection to your Ubuntu server.
Connect to your server using any RDP client.

Screenshot 1. xRDP log in screen.

Enter the user credentials of your Ubuntu server.
Now you can see the remote desktop initial screen.

Screenshot 2. Remote desktop initial screen.