How To

Install Xrdp on Ubuntu 18.04: Remote Desktop Setup Guide

Xrdp is an open-source implementation of the Microsoft Remote Desktop Protocol (RDP). It lets you access your Ubuntu desktop remotely from a Windows, macOS, or Linux machine using any RDP-compatible client.

This guide shows you how to install Xrdp on Ubuntu 18.04 and connect to it using a Remote Desktop client.

<strong>Prerequisite:</strong>&nbsp;You need a sudo account and a desktop environment installed on your Ubuntu machine.

Install a Desktop Environment

Xrdp requires a graphical desktop environment. If your Ubuntu server does not have one, install Xfce, which is lightweight and works well with Xrdp:

bashsudo apt updatesudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

Install Xrdp on Ubuntu

Install Xrdp from the default Ubuntu repositories:

bashsudo apt install xrdp

After the install, the Xrdp service starts automatically. Verify it is running:

bashsudo systemctl status xrdp

Xrdp uses a self-signed SSL certificate located at /etc/ssl/private/ssl-cert-snakeoil.key. Add the xrdp user to the ssl-cert group so it can read the certificate:

bashsudo adduser xrdp ssl-cert

Restart the Xrdp service to apply the change:

bashsudo systemctl restart xrdp

Configure the Desktop Session

Tell Xrdp to use Xfce as the session type. Create or edit the .xsession file in your home directory:

bashecho xfce4-session &gt; ~/.xsession

Open the Firewall Port

If UFW is enabled, allow RDP traffic on port 3389:

bashsudo ufw allow 3389

Connect with a Remote Desktop Client

On Windows, open the built-in Remote Desktop Connection app. Enter the IP address of your Ubuntu machine and click Connect. Use your Ubuntu username and password to log in.

On macOS, install the Microsoft Remote Desktop app from the App Store, add a new connection with your Ubuntu IP address, and connect.

On Linux, use a client like Remmina and select RDP as the protocol.

Xrdp is now installed and running on your Ubuntu 18.04 machine. You can access the full desktop environment from any device that supports RDP. Got questions? Leave a comment below.

Cyber Defence

Recent Posts

git fetch vs git pull: How They Work and When to Use Each

Both git fetch and git pull talk to a remote repository, but they do very different things to your…

1 week ago

git cherry-pick Command: Apply Commits from Another Branch

Sometimes the change you need already exists, just on the wrong branch. A hotfix lands…

1 week ago

Best Email APIs for Secure Business Email: Why Developers Are Moving Beyond SMTP

Email is still one of the most important communication channels inside modern applications. Password resets,…

1 week ago

Nginx Commands in Linux: Start, Stop, Reload, Test, and Log

Nginx is a high-performance web server and reverse proxy trusted by some of the largest…

2 weeks ago

ufw Command in Linux: Manage Firewall Rules with Examples

ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…

2 weeks ago

who Command in Linux: Show All Logged-In Users and Sessions

When you share a server with a team or investigate unexpected activity, the first question…

2 weeks ago