Are you looking to use a Graphical User Interface (GUI) on your Ubuntu 22.04 server? Do you want a graphical desktop for Ubuntu? Do you want to connect to your Ubuntu server with Remote Desktop (RDP/RDC)?
By default, the Desktop flavor of Ubuntu (Ubuntu Desktop) comes pre-packaged with a GUI, and is meant for personal or professional use on a desktop or laptop. However, if you’ve purchased an Ubuntu server from a web hosting company, chances are you’ve received the Ubuntu Server or Ubuntu Core edition. These editions of Ubuntu do not come pre-packaged with a GUI.
Furthermore, Remote Desktop Protocol (RDP) was invented as a priority software, made by Microsoft specifically for Windows. However, the friendly devs at neutrinolabs have developed a non-priority version, for free! It’s called xrdp.
In this guide, first, we will show you how to install KDE (K Desktop Environment). Then, we will go through installing xrdp, Last, you will connect to your Ubuntu 22.04 server with it’s new KDE desktop using RDP!
Add a User
If your server only has the root user, and no other users created, now is the time to create a new user on the system. By default, the KDE login does not allow login to the user root. xrdp does allow login as root (in case you ignore this warning and skip this step).
In other words: you won’t be able to login as the root user to your server using a plugged-in monitor, or a KVM or VNC console. For this reason, you should add a new user with the same permissions. You can, however, still login as the root user with Remote Desktop after following this guide.
Connect to your server via SSH and add a new user:
sudo adduser <username>
Replace <username> with your username of choice.
Give superuser privileges:
sudo usermod -aG sudo <username>
Now, when you login to KDE as this user, you can then switch to root with su root
Update & Upgrade
The first step in installing any new software on Ubuntu, is first to update the repo list. This assures us that we receive all of the newest available packages for our system. Run in terminal:
sudo apt update && sudo apt upgrade
Install KDE
There are a few different KDE packages available. kde-plasma-desktop package is somewhat of a minimum package that installs only the bare minimums and nothing else. This is a good option for those who want a smaller download/installation size, or that want to manually choose which packages to install after.
kde-standard is well, the standard package. kubuntu-desktop is the full-featured release provided as the Ubuntu Desktop version. In this guide, we will use kubuntu-desktop. To install KDE:
sudo apt install kubuntu-desktop
Install xrdp
Now it’s time to install the xrdp service so that we can connect to the new GUI. Run this in terminal:
sudo apt install xrdp
That’s it! You now have KDE installed with xrdp.
You may find many guides out there with steps to edit xrdp config settings. By default, this guide, with no additional configuration works on Ubuntu 22.04 as of the writing of this guide: February 17, 2023.
Connect with Remote Desktop
If you are on a Windows PC, open up Remote Desktop Connection by searching for it in the Windows search bar. Enter in your Ubuntu server’s IP address. You can leave User name blank. Click Connect.
You will be brought up with the xrdp login screen.
You can use the default Xorg session. Input your username (ie. root) and password, click OK, and your new KDE desktop will load!