Linux Tactic

How to Install and Configure Xrdp on Ubuntu 2004 for Remote Desktop Sharing

Remote desktop sharing has become increasingly popular in recent years, enabling users to access files, software, and programs installed on a different computer remotely. One way to achieve this is by using Xrdp on Ubuntu 20.04 servers.

This article will walk you through the process of installing and configuring Xrdp, including configuring the necessary firewall settings and connecting to the Xrdp server.

Installing Desktop Environment

To start with, we need to install a desktop environment in Ubuntu 20.04. A desktop environment is a program that provides a graphical user interface (GUI) to interact with the operating system.

Two popular desktop environments are Gnome and Xfce. Open up your terminal and follow these steps:


Install Gnome Desktop Environment using the following command:

sudo apt-get install gdm3

2. Alternatively, you can install Xfce using the following command:

sudo apt-get install xfce4

Once the installation is complete, restart your server.

Installing Xrdp

The next step is to install Xrdp on Ubuntu 20.04. Xrdp is an open-source remote desktop protocol (RDP) server that enables users to connect to a desktop session on another computer.

It is available in the Ubuntu repositories, so you can install it using the following command:

sudo apt-get install xrdp

You will also need to start the Xrdp daemon during system boot-up using the following command:

sudo systemctl enable –now xrdp

Xrdp Configuration

After installing Xrdp, the next step is to configure it properly. There are two primary configuration files you’ll need to tweak: xrdp.ini and

xrdp.ini file

The xrdp.ini file contains the settings for the Xrdp server. To open the file, use the following command:

sudo nano /etc/xrdp/xrdp.ini

Find the [xrdp1] section and replace the port number with 3389, which is the default RDP port.

If you want to use a different port number, remember to open your firewall accordingly to avoid any issues. file

The file is responsible for starting the X Window desktop environment.

In Ubuntu 20.04, the default desktop environment is Gnome 3. To configure the file, execute the following command:

sudo nano /etc/xrdp/

Find and comment out the “test -x /etc/X11/Xsession && exec /etc/X11/Xsession” line, then add the following lines beneath it:


echo “

gnome-session” > ~/.xsession

Configuring Firewall

By default, Xrdp daemon listens on port 3389, which should be opened on the firewall. You can open the port by running the following command:

sudo ufw allow 3389/tcp

It is recommended to use an SSH tunnel to encrypt traffic between your client machine and the Xrdp server to enhance security.

Connecting to the Xrdp Server

To connect to the Xrdp server, you need a Remote Desktop Protocol (RDP) client. On Windows, you can use Remote Desktop Connection, while Linux users can use Remmina or Vinagre.

Use the following steps to connect to the Xrdp server:

1. Launch your RDP client and type in the IP address of your Xrdp server.

2. Enter your Ubuntu username and password when prompted.

3. If everything is configured correctly, you should be connected to the Ubuntu 20.04 desktop environment on your remote machine.


Configuring Xrdp on Ubuntu 20.04 is an excellent way to gain remote access to files, software, and programs installed on another computer. By following the steps outlined in this article, you can easily install and configure Xrdp on your Ubuntu 20.04 server and connect to it using an RDP client.

Remember to secure your connection by using an SSH tunnel and opening the necessary port on your firewall. With Xrdp, you can access your Ubuntu server from any location in the world.

In conclusion, Xrdp on Ubuntu 20.04 is a powerful tool for remote desktop sharing that enables users to access files, programs, and software installed on another computer. This article explored the steps needed to install and configure Xrdp, including necessary firewall settings and connecting to the Xrdp server.

By following the outlined process, users can access their Ubuntu servers from any location, making remote work more accessible and convenient. Ultimately, Xrdp is a valuable addition to any Ubuntu 20.04 server that can streamline workflows and improve productivity.

Popular Posts