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.
- Gnome is the default Ubuntu desktop, to install it, run the following commands:
sudo apt update
sudo apt install ubuntu-desktop
- 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!