LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

How to Install Remote Desktop on Ubuntu 20.04 with XRDP

How to Install Remote Desktop on Ubuntu 20.04 with XRDPThis article was contributed by Dustin B. Cisneros of RackNerd – LowEndBox appreciates your contribution as always! Looking for a KVM VPS to run Remote Desktop on? Be sure to check out RackNerd’s latest LowEndBox specials if you are looking for a KVM VPS.

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!

Jon Biloh

2 Comments

  1. Happy to see this was posted! If anyone has questions, please feel free to ask.

    And if you happen to be in the market for blazing fast AMD Ryzen 9 3900x NVMe KVM VPS, https://my.racknerd.com/cart.php?a=add&pid=308 is a good deal to grab :)

    September 3, 2020 @ 2:35 pm | Reply
  2. Theo:

    Hey! it seems that after installing xubuntu and following your instructions. i get the xorg screen when connected to remote host, but after typing details, it shows only blue screen and nothing.

    November 17, 2020 @ 12:40 pm | Reply

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

Your email address will not be published. Required fields are marked *