How To

Install Xrdp Remote Desktop on Ubuntu: Setup and Connect

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.

Install a Desktop Environment First

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:

  • Gnome is the default Ubuntu desktop. It looks polished but uses more memory.
  • Xfce is lightweight and fast, making it a better fit for remote servers with limited resources.

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.

Install Xrdp Remote Desktop on Ubuntu

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.

Configure the Firewall

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>&nbsp;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.

Connect From Windows, Mac, or Linux

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.

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…

3 days 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…

3 days 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,…

4 days 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…

7 days 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…

7 days 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…

7 days ago