{"id":3595,"date":"2023-11-18T11:41:07","date_gmt":"2023-11-18T03:41:07","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3595"},"modified":"2026-03-16T13:02:58","modified_gmt":"2026-03-16T05:02:58","slug":"xrdp-7-steps-install-remote-desktop","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/xrdp-7-steps-install-remote-desktop","title":{"rendered":"XRDP: 7 Easy Steps to Install GUI and Remote Desktop"},"content":{"rendered":"<header class=\"entry-header \">\n<div class=\"entry-meta\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3596\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-300x169.jpg\" alt=\"GUI and XRDP\" width=\"847\" height=\"477\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-300x169.jpg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-1024x576.jpg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-768x432.jpg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-1536x864.jpg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-2048x1152.jpg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-370x208.jpg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-1230x692.jpg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-800x450.jpg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/Modern-Digital-Marketing-Blog-Banner-1-390x219.jpg 390w\" sizes=\"(max-width: 847px) 100vw, 847px\" \/><\/div>\n<div><\/div>\n<\/header>\n<div class=\"entry-content clear\">\n<p>Installing a Graphical User Interface (GUI)\u00a0 and XRDP on a Linux system isn&#8217;t mandatory as system administration and configuration can be done through SSH. However, a GUI offers advantages, especially for Windows users new to terminals. It can be a cost-effective way to manage a <a href=\"https:\/\/servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> server without a Windows license, simplifying complex tasks. The terminal remains relevant, but tasks like file management and configuration editing become more straightforward with a GUI. This tutorial guides through installing <a href=\"https:\/\/www.xfce.org\/\" rel=\"nofollow noopener\" target=\"_blank\">XFCE4 GUI<\/a> and <a href=\"http:\/\/www.xrdp.org\/\" rel=\"nofollow noopener\" target=\"_blank\">XRDP<\/a> on CentOS and Debian systems, divided into three sections: meeting prerequisites, software installation, and connecting to the server.<\/p>\n<h1 id=\"h-prerequisites\" class=\"wp-block-heading\"><span id=\"prerequisites\" class=\"uag-toc__heading-anchor\"><\/span>Prerequisites<\/h1>\n<ol>\n<li data-sourcepos=\"5:1-6:0\">\n<p data-sourcepos=\"5:4-5:119\">An already installed instance running any Linux operating system: This means you have a Linux system up and running.<\/p>\n<\/li>\n<li data-sourcepos=\"7:1-8:0\">\n<p data-sourcepos=\"7:4-7:122\">A working internet connection: You need an internet connection to download and install the necessary software packages.<\/p>\n<\/li>\n<li data-sourcepos=\"9:1-10:0\">\n<p data-sourcepos=\"9:4-9:193\">A VNC client or SSH client: A VNC client allows you to connect to a remote computer and view its desktop, while an SSH client allows you to connect to a remote computer and execute commands.<\/p>\n<\/li>\n<li data-sourcepos=\"11:1-12:0\">\n<p data-sourcepos=\"11:4-11:178\">A user which is allowed to log in to the operating system: This means you have a user account with the necessary privileges to install software and make changes to the system.<\/p>\n<\/li>\n<li data-sourcepos=\"13:1-14:0\">\n<p data-sourcepos=\"13:4-13:183\">A little bit work on the terminal either via SSH or VNC: You should be comfortable working with the terminal, which is a text-based interface for interacting with the Linux system.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"h-installation-and-configuration-of-xrdp-and-the-gui\" class=\"wp-block-heading\"><span id=\"installation-and-configuration-of-xrdp-and-the-gui\" class=\"uag-toc__heading-anchor\"><\/span><strong>Installation and Configuration:<\/strong><\/h2>\n<h3 data-sourcepos=\"13:1-13:29\"><strong>Step 1: Create a new user<\/strong><\/h3>\n<p data-sourcepos=\"15:1-15:47\">Use the following command to create a new user:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">useradd -m -s \/bin\/bash USERNAME\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"21:1-21:45\">Replace <code>USERNAME<\/code> with the desired username.<\/p>\n<h3 data-sourcepos=\"23:1-23:76\"><strong>Step 2: Update the package manager database and install XRDP and the GUI<\/strong><\/h3>\n<p data-sourcepos=\"25:1-25:21\">Ubuntu-based systems:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt update\r\napt install xrdp vnc4server xubuntu-desktop\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"32:1-32:21\">CentOS-based systems:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">yum install -y epel-release\r\nyum groupinstall \"Server with GUI\" -y\r\nyum -y install xrdp tigervnc-server\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"40:1-40:26\"><strong>Step 3: Configure XRDP<\/strong><\/h3>\n<h5 data-sourcepos=\"42:1-42:33\"><strong>3.1: Create a TLS certificate<\/strong><\/h5>\n<p data-sourcepos=\"44:1-44:54\">Use the following command to create a TLS certificate:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">openssl req -x509 -newkey rsa:2048 -nodes -keyout xrdp.key.pem -out xrdp.crt.pem -days 3650\r\n<\/code><\/pre>\n<\/div>\n<h5 data-sourcepos=\"50:1-50:29\"><strong>3.2: Set file permissions<\/strong><\/h5>\n<p data-sourcepos=\"52:1-52:57\">Set the file permissions for the TLS certificate and key:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">chown root:root xrdp*.pem\r\nchmod 640 xrdp*.pem\r\n<\/code><\/pre>\n<\/div>\n<h5 data-sourcepos=\"59:1-59:32\"><strong>3.3: Move files to \/etc\/xrdp<\/strong><\/h5>\n<p data-sourcepos=\"61:1-61:62\">Move the TLS certificate and key to the <code>\/etc\/xrdp<\/code> directory:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">mv xrdp*.pem \/etc\/xrdp\r\n<\/code><\/pre>\n<\/div>\n<h5 data-sourcepos=\"67:1-67:31\"><strong>3.4: Edit the xrdp.ini file<\/strong><\/h5>\n<p data-sourcepos=\"69:1-69:35\">Open the xrdp.ini file for editing:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">nano \/etc\/xrdp\/xrdp.ini\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"75:1-75:66\">Locate the following lines and change them to match the following:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">security_layer = TLS\r\ncertificate = \/etc\/xrdp\/xrdp.crt.pem\r\nkey_file = \/etc\/xrdp\/xrdp.key.pem\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"83:1-83:67\"><strong>Step 4: Verify that the system starts into the graphical target<\/strong><\/h3>\n<p data-sourcepos=\"85:1-85:53\">Check if the system starts into the graphical target:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">systemctl get-default\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"91:1-91:70\">If the output is not <code>graphical.target<\/code>, set it as the default target:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">systemctl set-default graphical.target\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"97:1-97:35\"><strong>Step 5: Enable the xrdp service<\/strong><\/h3>\n<p data-sourcepos=\"99:1-99:24\">Enable the xrdp service:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">systemctl enable xrdp.service\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"105:1-105:60\"><strong>Step 6: Set the desktop environment for the created user<\/strong><\/h3>\n<p data-sourcepos=\"107:1-107:55\">Set the desktop environment for the newly created user:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">echo \u201exfce4-session\u201c &gt; \/home\/USERNAME\/.xsession\r\nchown USERNAME: \/home\/USERNAME\/.xsession\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"114:1-114:59\">Replace <code>USERNAME<\/code> with the username you created in Step 1.<\/p>\n<h3 data-sourcepos=\"116:1-116:29\"><strong>Step 7: Reboot the server<\/strong><\/h3>\n<p data-sourcepos=\"118:1-118:18\">Reboot the server:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">reboot\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"124:1-124:14\"><strong>Connection<\/strong><\/h2>\n<p data-sourcepos=\"126:1-126:89\">After the server is rebooted, you should be able to connect to it via RDP using an RDP client. This allows you to control the system remotely using a graphical desktop environment.<\/p>\n<h2 data-sourcepos=\"124:1-124:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"5:1-5:371\">This tutorial has provided step-by-step instructions on how to install GUI and XRDP on Ubuntu and CentOS operating systems. By following these instructions, you will be able to remotely access your Linux system using a graphical desktop environment. This can be useful for a variety of tasks, such as managing your system, installing software, and working on documents.<\/p>\n<p data-sourcepos=\"7:1-7:18\">Key takeaways:<\/p>\n<ul data-sourcepos=\"9:1-12:0\">\n<li data-sourcepos=\"9:1-9:193\">The prerequisites for installing a GUI and XRDP are a working internet connection, a VNC or SSH client, a user with login privileges, and a little bit of experience working with the terminal.<\/li>\n<li data-sourcepos=\"10:1-10:260\">The installation and configuration process involves updating the package manager database, installing XRDP and the GUI, configuring XRDP, checking the system startup target, enabling the xrdp server, setting the desktop environment, and rebooting the server.<\/li>\n<li data-sourcepos=\"11:1-12:0\">Once the server is rebooted, you can connect to it via RDP using an RDP client.<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Installing a Graphical User Interface (GUI)\u00a0 and XRDP on a Linux system isn&#8217;t mandatory as system administration and configuration can be done through SSH. However, a GUI offers advantages, especially for Windows users new to terminals. It can be a cost-effective way to manage a Linux server without a Windows license, simplifying complex tasks. The terminal remains relevant, but tasks&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1207,1208],"class_list":["post-3595","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-gui","kbtag-xrdp"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3595"}],"version-history":[{"count":7,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3595\/revisions"}],"predecessor-version":[{"id":6304,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3595\/revisions\/6304"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3595"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3595"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}