Install GUI on a Ubuntu Server

1. Update system

 
 
sudo apt update && sudo apt upgrade -y

2. Install a Desktop Environment

Pick one:

XFCE (lightweight, best for VPS)

 
 
sudo apt install xfce4 -y

GNOME (heavier)

 
 
sudo apt install ubuntu-desktop -y

KDE Plasma (medium-heavy)

 
 
sudo apt install kde-standard -y

3. Install an RDP server (xRDP)

 
 
sudo apt install xrdp -y sudo systemctl enable --now xrdp

4. Set your GUI for xRDP (only needed if you installed XFCE)

 
 
echo xfce4-session > ~/.xsession

Then restart xRDP:

 
 
sudo systemctl restart xrdp

5. Create a non-root user (RDP won’t allow root login by default)

You already know you need a user, so just run:

 
 
sudo adduser linuxuser sudo usermod -aG sudo linuxuser

6. Allow the RDP port in firewall (if UFW is active)

 
 
sudo ufw allow 3389

7. Connect using RDP

From your local machine:

  • Windows → Open Remote Desktop Connection

  • Mac → Use Microsoft Remote Desktop

  • Linux → Use Remmina or any RDP client

Login with:

 
 
IP: your_vps_ip User: linuxuser Password: the one you set

Optional: Fix black screen issues (common on VPS)

 
 
sudo sed -i 's/console/anybody/g' /etc/X11/Xwrapper.config

Optional: Install a VNC server instead of RDP

 
 
sudo apt install tigervnc-standalone-server -y vncserver

Recommendation for your case

Since it’s a VPS, XFCE + xRDP is the most stable and fastest combo.

 

 

 

 

Here is also a bash script for it:

 

# Ubuntu 24.04 VPS — XFCE + xRDP one-shot installer
# Usage:
# curl -fsSL https://example.com/script.sh | bash <-- (don’t do this)
# Instead: copy/paste this whole block into your VPS as root (or with sudo).

set -e

echo "==> Updating system..."
sudo apt update
sudo apt upgrade -y

echo "==> Installing XFCE desktop..."
sudo apt install -y xfce4 xfce4-goodies

echo "==> Installing xRDP..."
sudo apt install -y xrdp

echo "==> Enabling xRDP service..."
sudo systemctl enable --now xrdp

echo "==> Setting XFCE as default session for xRDP (for current user)..."
echo xfce4-session > ~/.xsession

echo "==> Restarting xRDP..."
sudo systemctl restart xrdp

echo "==> Firewall: opening RDP port 3389 if UFW is active..."
if sudo ufw status | grep -qi "Status: active"; then
sudo ufw allow 3389/tcp
echo "UFW rule added: 3389/tcp"
else
echo "UFW not active — skipping."
fi

echo "==> (Optional) Helping avoid some common 'black screen' issues..."
if [ -f /etc/X11/Xwrapper.config ]; then
sudo sed -i 's/^allowed_users=.*/allowed_users=anybody/' /etc/X11/Xwrapper.config || true
fi

echo ""
echo "=============================="
echo "DONE."
echo "RDP is listening on port 3389."
echo ""
echo "IMPORTANT:"
echo "1) Create a non-root user (recommended) if you haven't:"
echo " sudo adduser linuxuser"
echo " sudo usermod -aG sudo linuxuser"
echo ""
echo "2) Connect from your PC using an RDP client to:"
echo " <your_vps_ip>:3389"
echo " Login with: linuxuser"
echo "=============================="

  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Setup Tor hidden service

To ensure that your website is only reachable via the Tor network and not accessible over...

Tor Exit Policy

Understanding Tor Exit Policies What is a Tor Exit Policy? Tor, an anonymity network, routes...

Setup Python App in cPanel (Webspace)

The integrated features make it simple to deploy a Python app in cPanel. Create the Python...

Self-hosted RustDesk server

RustDesk is a great alternative to software like TeamViewer or AnyDesk, giving you the option to...