How to enable xrdp on Raspberry Pi

When it comes to remotely accessing your Raspberry Pi, you have a lot of options available, such as SSH and VNC. Yet another option available would be xrdp, which is the open source implementation of the Remote Desktop Protocol (RDP). RDP is commonly used on Windows systems, where it is installed by default, and other operating systems also like to implement this protocol in some capacity due to its widespread use and reliability.

If you would like to use an RDP client to access your Raspberry Pi, then all you will need to do is install the xrdp service on your system. In this tutorial, we will take you through the step by step instructions of downloading and installing xrdp on the Raspberry Pi, configuring it for remote logins, and then using a remote desktop client to access the Raspberry Pi. Let’s get started!

In this tutorial you will learn:

  • How to install xrdp server on Raspberry Pi
  • How to start, stop, and check status of xrdp service
  • How to remotely connect to Raspberry Pi via xrdp server
How to enable xrdp on Raspberry Pi
How to enable xrdp on Raspberry Pi
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Raspberry Pi
Software xrdp
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to enable xrdp on Raspberry Pi step by step instructions




Follow along with the steps below to install Xrdp, apply the necessary configurations to the Raspberry Pi, and then use a remote desktop client (from Windows 11, in our case), to access the Raspberry Pi. Using xrdp on your Raspberry Pi allows you to connect to the device and use it in the same manner as if you were physically sitting in front of it.

  1. Start by installing xrdp with the following commands on your Raspberry Pi:
    $ sudo apt update
    $ sudo apt install xrdp
    
  2. You can check to make sure that xrdp is running by executing:
    $ sudo systemctl status xrdp
    
    Verifying the current status of the xrdp server on Raspberry Pi
    Verifying the current status of the xrdp server on Raspberry Pi

    You can also use the following systemctl commands to change the behavior of the xrdp service:

    Start or stop the service:
    $ sudo systemctl start xrdp
    $ sudo systemctl stop xrdp
    
    Enable or disable the xrdp service from auto-starting at boot:
    $ sudo systemctl enable xrdp
    $ sudo systemctl disable xrdp
    
  3. Now we must choose which users will have the ability to remotely log in to the Raspberry Pi via xrdp. Add those users to the ssl-cert group. In this example, we will add user linuxconfig to the group, since we plan on letting that user log in via remote desktop:


    $ sudo usermod -a -G ssl-cert linuxconfig
    
  4. Now we are ready to connect to the Raspberry Pi from another device. In our case, we will use a Windows 11 machine. Open your Remote Desktop client and type in the IP address or hostname of the Raspberry Pi, then click connect:
    Typing in the access information for the Raspberry Pi
    Typing in the access information for the Raspberry Pi
  5. Once connected, we will be prompted to log in with our account credentials:
    Use your account credentials to complete the login process for xrdp
    Use your account credentials to complete the login process for xrdp
  6. Finally, we are connected to the Raspberry Pi via xrdp and can control the system as if we were physically in front of it:
    We are now remotely connected to the Raspberry Pi via xrdp
    We are now remotely connected to the Raspberry Pi via xrdp

Closing Thoughts




In this tutorial, we saw how to enable xrdp on a Raspberry Pi system. Remote Desktop Protocol is a popular and reliable method of controlling a PC remotely, which has been around for a long time. In many environments, especially if you have a Windows PC, it is easier to stick with RDP and the open source implementation of xrdp rather than migrate over to a new protocol like VNC for remote desktop sharing.



Comments and Discussions
Linux Forum