Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Set Up Remote Desktop on Ubuntu with xrdp

Install xrdp so you can connect to your Ubuntu desktop from Windows with Remote Desktop Connection.

VPS and Cloud Servers2 min read3 steps11 screenshots

Why use remote desktop

Remote desktop lets you use the screen, files and apps of your Ubuntu machine from anywhere. It is helpful for admins who fix problems and for developers who work on a remote server.

Note: xrdp needs a desktop environment on the Ubuntu machine. A server without a desktop must have one installed first.

Step 1: Update the system

sudo apt update
Updating the package list

Step 2: Install xrdp

xrdp is a server for the Remote Desktop Protocol (RDP). Windows can connect to it with its built-in client.

sudo apt install xrdp
Installing xrdp

Start the service and make it start at boot:

sudo systemctl start xrdp
sudo systemctl enable xrdp
Starting and enabling xrdp

Step 3: Check the desktop sharing settings

If you also want to share the desktop that is already on screen, open Settings on the Ubuntu machine. Go to System (or Sharing) and open Remote Desktop.

The Remote Desktop settings

Turn on Desktop Sharing and Remote Control. You can also require a password for access.

Desktop Sharing and Remote Control switches

Step 4: Open the firewall

xrdp uses port 3389. If UFW is on, allow it:

sudo ufw allow 3389/tcp
Allowing port 3389

Find the IP address of the machine:

ip a
The IP address of the machine

Log out of the Ubuntu desktop session. xrdp cannot open a session for a user who is already logged in on the screen.

Logging out of Ubuntu

Step 5: Connect

  1. On a Windows computer, open Remote Desktop Connection. Type the IP address of the Ubuntu machine and click Connect.
    Remote Desktop Connection
  2. In the xrdp login window, enter your Ubuntu user name and password.
    The xrdp login screen
  3. The Ubuntu desktop opens.
    The Ubuntu desktop in a Remote Desktop session
Warning: Do not expose port 3389 to the whole internet. Allow only your own IP address in the firewall, or connect through a VPN or an SSH tunnel.

Quick recap

  • Install and enable xrdp.
  • Allow port 3389 in the firewall.
  • Log out locally and connect with Remote Desktop Connection.