How to install Graphical User Interface (GUI) and XRDP for Ubuntu 24.04 Cloud Servers

2025-02-17 By Nathan 1709 Views linux ubuntu gui xrdp
2 reviews

Installing a Graphical User Interface (GUI) on Ubuntu 24.04 Cloud Servers provides a visual environment, making server management easier for those unfamiliar with the command line. Ubuntu Server does not include a GUI by default in order to keep it lightweight and efficient for server-specific tasks. You can choose from multiple desktop environments, such as GNOME, the default Ubuntu desktop, which offers a modern look and a complete set of applications, or Xfce, a lightweight option that performs better on systems with limited resources. After installing the GUI, a reboot ensures that all necessary services start correctly.


XRDP is an open-source implementation of Microsoft’s Remote Desktop Protocol (RDP), enabling remote access to the GUI over the network. It creates a bridge between the remote client and the desktop environment on the server. By default, XRDP listens on port 3389, which you must allow through the server’s firewall to ensure successful connections. Once XRDP is configured and running, you can use an RDP client from your local machine to access the server’s desktop environment with ease. This setup is ideal for remote administration, especially for users who are more comfortable with a graphical interface.


This guide will walk you through setting up a Graphical User Interface (GUI) and configuring XRDP to enable remote desktop access on Ubuntu 24.04 Cloud Servers. After completing this setup, you are able to connect to your server using Remote Desktop Protocol (RDP) from your local machine.


Prerequisites


Before we begin, ensure the following:

  • Ubuntu 24.04 OS is installed (without a desktop environment).
  • A user account with sudo or root privileges.
  • Internet access to download and install packages.
  • A remote desktop client (Windows: mstsc, macOS: Microsoft Remote Desktop, Linux: Remmina).


Why these are required:

  • Sudo privileges allow you to install and manage software.
  • RDP client is essential to access the server after the XRDP setup.
  • Internet connection ensures you can update the system and download the GUI and XRDP packages.


  1. Update and upgrade the Ubuntu system.

    # apt update
    
    # apt upgrade -y
    
    # reboot
    

    ubuntu24gui1

    ubuntu24gui2

    ubuntu24gui3


  • apt update: Update the list of available packages and their versions.
  • apt upgrade -y: Install the latest versions of all packages currently installed on the system. The -y flag automatically answers yes to prompts.
  • reboot: Reboot the system to apply changes and ensure stability.


NOTE: Keeping your system up to date ensures that you have the latest security patches and features, which are crucial for maintaining a stable and secure environment.

  1. Install a Graphical User Interface (GUI), such as GNOME Desktop (the default Ubuntu desktop), which is visually rich but uses more resources.

    # apt install ubuntu-desktop -y
    

    ubuntu24gui4

  2. Install a Xfce Desktop (Lightweight) – A fast, resource-efficient alternative that's ideal for remote desktop setups.

    # apt install xubuntu-desktop -y
    

    ubuntu24gui5


  • apt install ubuntu-desktop: Install the full GNOME desktop environment.
  • apt install xubuntu-desktop: Install the Xfce desktop environment with a minimal set of applications.


NOTE: A GUI makes it easier to manage the server visually. GNOME is a good choice for users familiar with Ubuntu’s default desktop, while Xfce offers better performance and is ideal for remote access.

  1. Reboot your system after the installation.

    # reboot
    
  2. Install and configure XRDP. XRDP allows to connect to the server using Remote Desktop Protocol (RDP).

    # apt install xrdp -y
    

    ubuntu24gui7


  • apt install xrdp: Install XRDP, an open-source implementation of the RDP protocol.
  1. Enable and start XRDP.

    # systemctl enable xrdp
    
    # systemctl start xrdp
    

    ubuntu24gui8


  • systemctl enable xrdp: Ensures that the XRDP service starts automatically on boot.
  • systemctl start xrdp: Starts the XRDP service immediately.
  1. Add XRDP user to ssl-cert group.

    # adduser xrdp ssl-cert
    

    ubuntu24gui9


  • adduser xrdp ssl-cert: Add the xrdp user to the ssl-cert group, giving it permission to access the certificate files needed for encrypted sessions.


NOTE: This step ensures that XRDP has the necessary permissions to function securely and avoid connection errors.

  1. Configure Firewall for XRDP.

    # ufw allow 3389/tcp
    
    # ufw reload
    

    ubuntu24gui10


  • ufw allow 3389/tcp: Open TCP port 3389, which XRDP uses for RDP connections.
  • ufw reload: Reload the firewall to apply the changes.


NOTE: If the firewall blocks port 3389, you won’t be able to connect to your server using RDP.

  1. Test Remote Desktop Connection by opening an RDP client.

    Windows: Run mstsc in the Run dialog (Win+R).
    Linux: Use Remmina or similar.

  2. Enter your server's IP address and connect.

  3. Log in with your Ubuntu username and root password.

  4. The desktop environment you installed earlier can be displayed.

    ubuntu24gui11

    ubuntu24gui12

  5. Configure XRDP to use Xfce (Optional for Xfce Users). If you installed Xfce, you may need to set it as the default session for XRDP:

    # echo "startxfce4" > ~/.xsession
    
    # systemctl restart xrdp
    


  • echo "startxfce4" > ~/.xsession: Set Xfce as the default desktop session for the current user.
  • systemctl restart xrdp: Restart the XRDP service to apply the change.


If XRDP defaults to GNOME or another desktop, you may experience issues. This ensures XRDP launches the Xfce desktop session.


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.