Installing Xfce Desktop Environment and XRDP service on Remote Ubuntu 22.04

In this guide, we'll walk you through the step-by-step process of installing Xfce and XRDP service on your Ubuntu 22.04 server, enabling you to access a graphical interface and enjoy a streamlined desktop environment.

Prerequisites

You already log in to your remote Linux server
Once your server is deployed, the login credentials are usually sent to your registered email. You can also get server login information, including username, password, and port in the Database Mart control panel, please refer to guide on how to manage servers in Database Mart control panel.

Please refer to the guide How to Connect to a Linux Server Remotely to log in to your Remote Linux Server. Next, input your login password as prompted.

Log in to Linux servers

Install Xfce Desktop Environment and XRDP Service on Remote Ubuntu 22.04 Servers

Install Xfce on Ubuntu Servers

In this example, we will use the Ubuntu 22.04 operating system.

As the following several operations require the root permission, we will switch to the root user first using the command below.

sudo -i
Switch to the root user by running command sudo -i

After that, issue the commands below to update your list of packages, followed by installing Xfce and the xfce4-goodies pacakge, which includes additional software and artwork that are related to the Xfce desktop.

apt update
apt install xfce4 xfce4-goodies
Run apt update
Install Xfce

Before the installation, you are often prompted to confirm the disk space this operation will use. Input "y" to continue the installation.

Confirm Xfce installation

During the installation, you will be prompted to choose a default display manager - gdm3 or Lightdm - for Xfce. Choose either one and press enter to continue.

Introduction to display manager
Choose a default display manager

Install XRDP on Ubuntu

XRDP is a protocol that allows you to connect to your Ubuntu system remotely using the Remote Desktop Protocol (RDP).

Issue the commands below to install xrdp service.

apt install xrdp -y

After installing xrdp, verify the status of xrdp using the following command.

systemctl status xrdp
Install XRDP
Confirm XRDP status

Configure XRDP

Now, we will configure that xfce4-session is used as a session manager upon graphical login request. If you don’t write this information into the .xsession file, no session manager is chosen, and the RDP session will fail to connect to the graphical display. Use the echo command and then restart xrdp service.

echo "xfce4-session" | tee .xsession
systemctl restart xrdp
restart XRDP service

Test the RDP Connection

Now, we can test if you can connect to the remote Ubuntu server using RDP.

Open RDP service on your local machine. Then, input your Linux Ubuntu server IP in the Computer field and click Connect.

Open RDC

Then, you can see the RDP login interface. Enter your Linux server login username and password and click OK.

Enter login username and password

With the authentication passed, you should be able to access your Ubuntu Desktop environment.

Xfce desktop environment