Xrdp is an open-source server that lets you connect to your Ubuntu machine from another computer using the Remote Desktop Protocol (RDP). You get a full graphical desktop session over the network, just like sitting in front of the machine itself.
This guide shows you how to install Xrdp remote desktop on Ubuntu and connect to it from Windows, macOS, or Linux.
Ubuntu servers do not come with a desktop environment by default. If you already run Ubuntu Desktop, skip this step.
You have two good options:
To install Gnome:
bashsudo apt updatesudo apt install ubuntu-desktop
To install Xfce instead:
bashsudo apt updatesudo apt install xubuntu-desktop
Downloading a full desktop environment takes a few minutes depending on your connection speed.
Xrdp is available in the default Ubuntu repository. Install it with:
bashsudo apt install xrdp
The service starts on its own after install. Confirm it is running:
bashsudo systemctl status xrdp
You should see active (running) in the output.
By default, Xrdp reads an SSL certificate that only users in the ssl-cert group can access. Add the xrdp user to that group:
bashsudo adduser xrdp ssl-cert
Restart Xrdp so the change takes effect:
bashsudo systemctl restart xrdp
Xrdp configuration files live in /etc/xrdp/. The main file is xrdp.ini. For basic connections, you do not need to change anything in there. If you want to change which desktop Xrdp launches, edit the startwm.sh file.
Xrdp listens on port 3389. Open that port in your firewall. To allow access from a specific subnet only (the safer choice):
bashsudo ufw allow from 192.168.33.0/24 to any port 3389
To allow access from anywhere (not recommended on public servers):
bashsudo ufw allow 3389
For extra security, consider setting up an SSH tunnel. This routes your RDP traffic through an encrypted SSH connection without opening port 3389 to the outside world at all.
<strong>Tip:</strong> If this server is reachable from the public internet, restrict port 3389 to your IP address only. Leaving it fully open is a security risk.
On Windows: Search for “Remote Desktop Connection” in the Start menu. Enter your server’s IP address in the “Computer” field and click Connect. Enter your Ubuntu username and password when asked.
On macOS: Install the Microsoft Remote Desktop app from the Mac App Store. Add your server IP and connect using your credentials.
On Linux: Use Remmina or Vinagre. Both support RDP and are available in most distribution repositories.
After logging in, your Gnome or Xfce desktop will appear. You can interact with it using your keyboard and mouse just as you would on a local machine.
Xrdp is one of the quickest ways to get remote desktop access on Ubuntu. The setup takes just a few minutes, and once it is working, the experience feels close to using the machine in person. It is a great option for server admin tasks, remote work, or testing GUI apps on a headless machine. Got questions? Leave a comment below.