Categories: UbuntuUbuntu 20.04

How to Install Remote Desktop on Ubuntu 20.04 with XRDP

In this tutorial we will be showing you how to set up a remote desktop on your Ubuntu 20.04 VPS, using the XRDP software. XRDP allows you to graphically access your remote Linux servers. RDP is used to access a remote server through another computer, just as if you are using it locally. XRDP is a handy tool as it provides useful features such as two-way clipboard transfer, audio redirection and drive redirection.

The RDP protocol is also safe to use for sensitive data as it is encrypted with TLS.

In this guide, we will instruct you on how to install and setup XRDP on your Ubuntu 20.04 server.

 

Step 1. Install a desktop environment

Most of the Linux servers do not come with a graphical desktop environment. Instead, they are used via the command-line.

There are a couple of different desktop environments available for your server. These are already present in the Ubuntu repositories, so you don’t need to download anything. We will show you how to install Gnome and Xfce on the server. 

  1. Gnome is the default Ubuntu desktop, to install it, run the following commands:

sudo apt update

sudo apt install ubuntu-desktop

  1. On the other hand, Xfce is a lightweight and fast desktop, ideal for a remote server. To install it, run the following command:

sudo apt update

sudo apt install xubuntu-desktop

After running these commands, it might take some time to get everything installed.

Step 2. Installing Xrdp

The Xrdp comes loaded in the default Ubuntu repositories. Thus, you don’t need to download it. To install Xrdp, run the following command:

sudo apt install xrdp

Step 3. Verify the install

After the installation is done, you can verify it by running the following command:

sudo systemctl status xrdp

If the output shows the status of Xrdp, then the installation has been successful.

Step 4. Allow access to the SSL key

By default, the SSL certificate key that Xrdp uses is only accessible to the members of “ssl-cert” group. To add Xrdp to this group, run the following command:

sudo adduser xrdp ssl-cert

Step 5. Restart Xrdp

Now, to get everything working, we need to restart Xrdp with the following command:

sudo systemctl restart xrdp

After this, Xrdp is installed and working on your Ubuntu server.

Step 6. Configure the Firewall

Now, it is time to configure the firewall to allow access to remote connections.

Xrdp by default listens to port 3389. If you want to give access to a specific IP address, such as 192.168.20.0/20, run this command:

sudo ufw allow from 192.168.20.0/20 to any port 3389

You can also allow access from any IP address with the following command; however, it is not recommended due to security reasons:

sudo ufw allow 3389

Have you successfully set up remote desktop on your Ubuntu 20.04 VPS? Please leave any questions, feedback or comments down below!

Ubuntu Server Admin

Recent Posts

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

23 hours ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago

Get Valkey security patching and support with Ubuntu Pro

Canonical is pleased to announce security patching and support for Valkey through the Ubuntu Pro…

4 days ago