Installlion's Logo

How to install Xrdp on Ubuntu 20.04

  1. Prerequisites
  2. Installation and Configuration
  3. Desktop Connection
  4. Conclusion

xRDP is a free open source implementation of Microsoft’s RDP (Remote Desktop Protocol) that allows non-Microsoft Windows operating systems (such as Linux and BSD) to provide a fully functional RDP-compatible remote desktop.

Without further ado, let’s get down to installing Xrdp  on Ubuntu Desktop  20.04  and  18.04 .


This tutorial assumes you already have Ubuntu 20.04  or  Ubuntu 18.04 installed . If you have a minimal installation without a graphical interface, then it is recommended to install the desktop environment or GNOME .

To install the Ubuntu desktop environment, run the command:

sudo apt install ubuntu-desktop

his tutorial describes how to set up an xRDP server to connect to Ubuntu 18.04 with a lightweight Xfce RDP environment. This can be very convenient if you need to log into a Linux system from Windows using a graphical interface.

Installation and configuration

Connect to your ubuntu server via SSH and update the system:

sudo apt-get update

sudo apt-get upgrade -y

Install and enable the xRDP utility:

sudo apt-get install xrdp
sudo systemctl enable xrdp
sudo systemctl restart xrdp

Install xfce environment :

sudo apt-get install xfce4 xfce4-terminal

Open the RDP port for remote connectivity:

sudo ufw allow 3389/tcp

Restart the xRDP server for the changes to take effect:

sudo /etc/init.d/xrdp restart

Desktop connection

If you do not know the IP address of the Ubuntu server, you can view it by entering the command:

ifconfig -a

In our case, it will be To connect, open the Windows application Remote Desktop Connection (mstsc.exe). Enter the IP address of the server and click Connect:

When connected, a security warning will appear. Click Yes:

In the window that opens, select Xorg as a session, enter the username and password for the user, click OK:

This will connect to the desktop.

Xfce environment desktop:

If, when connecting to xrdp, it shows a black screen, you need to go to the / etc / xrdp folder and make changes to the file .

sudo nano /etc/xrdp/

Need to add:


Before the line:

test –x /etc/X11/Xsession && exec /etc/X11/Xsession

After making the changes, you need to restart the XRDP service:

sudo systemctl restart xrdp

Now you can run mstsc again . exe and connect to our ubuntu server.


Well that’s all, in this article you learned How to Install Xrdp on Ubuntu 20.04. It’s not difficult at all and even a Linux newbie can do it. If something didn’t work out for you or if you find an error, leave a comment.