How to Install XRDP Server (Remote Desktop) on Debian 12

A remote desktop server called XRDP enables its users to connect to their PCs from any location in the world. It is a versatile and compatible open-source server that implies the Remote Desktop Protocol (RDP). 

The XRDP (RDP) can be installed on the latest release of Debian known as the Debian 12. This post will explain the installation method of XRDP on Debian 12 with a step-by-step guide using the terminal. 

What is the Installation Method of XRDP on Debian 12?

To install the XRDP on Debian 12, open the terminal and execute the commands explained in the next section. 

Step 1: Update and Upgrade Debian 12

The default repository of Debian 12 comes with hundreds of packages that can be installed on the computer. To ensure all the packages are up to date, run the command:

$ sudo apt update && sudo apt upgrade -y

Step 2: Install the Desktop Environment on Debian 12

To use the XRDP, make sure a desktop environment has been installed on Debian 12. The machine can be installed with a wide variety of Desktop Environments.

If you are planning to install the XFCE desktop environment, then use the command:

$ sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils -y

Step 3: Install the XRDP on Debian 12

Now, install the XRDP on Debian 12 by using the package available in the default repository of Debian 12:

$ sudo apt install xrdp -y

Step 4: Verify the XRDP Installation

To verify the installation of the XRDP on Debian 12 with the above command, we will find out the status of XRDP service:

$ sudo systemctl status xrdp

Step 5: Add XRDP to ssl-cert

A certificate known as a key file and located at “/etc/ssl/private/ssl-cert-snakeoil.key” is important to create a successful connection between the remote and client machine. Use the following command to include the XRDP user in the SSL-cert:

$ sudo adduser xrdp ssl-cert

Step 6: Restart the XRDP

To save the above changes, restart the service of the XRDP using the systemctl command:

$ sudo systemctl restart xrdp

Step 7: Configure Firewall Settings

When the other machines connect to our machine, they need permission from the firewall. 

3389” is the default that the XRDP protocol uses. To allow the traffic through this port, run the command:

$ sudo ufw allow 3389/tcp

After making the ufw changes, reload the ufw with the command:

$ sudo ufw reload

How to Use the XRDP Server on Debian 12?

To use the XRDP server on Debian 12, create a connection between Windows and Debian 12. 

Now, launch the “Remote Desktop Connection” on Windows:

Add the IP address of the machine and then click on “Connect”:

Now add the “username” and “password” of Debian 12, then click on the “Ok”:

The connection between Windows and Debian 12 has been established successfully:

How to Uninstall XRDP Server on Debian 12?

To uninstall the XRDP server on Debian 12, use the purge option of the apt package manager:

$ sudo apt purge xrdp -y

That’s all about the installation of XRDP Server on Debian 12. 


To install the XRDP server (remote desktop) on Debian 12, install the package from the default repository by running the command “sudo apt install xrdp -y”. This post has explained the step-by-step method for the installation of the XRDP on Debian 12. Also, the steps to establish a connection between Windows and Debian 12 have been explained.