Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install a Desktop (GUI) on an Ubuntu Server

Add a display manager and a desktop environment to Ubuntu Server, then reach it with VNC.

VPS and Cloud Servers2 min read4 steps8 screenshots

Choose a desktop

  1. GNOME. The modern default desktop of Ubuntu. Clean and complete.
  2. KDE Plasma. Very customizable.
  3. XFCE. Light, good for small servers and older hardware.
  4. MATE. A traditional desktop.

On a VPS, XFCE is usually the best choice, because it needs the least RAM.

Step 1: Update the server

sudo apt update && sudo apt upgrade
Updating the server

Step 2: Install a display manager

sudo apt install lightdm
Installing LightDM

When asked, choose lightdm as the default display manager.

Step 3: Install a desktop environment

Install one of these:

GNOME

sudo apt install ubuntu-desktop

KDE Plasma

sudo apt install kde-plasma-desktop

XFCE

sudo apt install xubuntu-core
Installing XFCE

Reach the desktop remotely with VNC

A VPS has no monitor, so use VNC or xRDP.

Install a VNC server

sudo apt install tightvncserver
Installing TightVNC

Start it once to set a password

vncserver

Edit the startup file

Stop the server first with vncserver -kill :1. Then edit ~/.vnc/xstartup so that it starts XFCE:

#!/bin/sh
xrdb $HOME/.Xresources
startxfce4 &

Start the VNC server

chmod +x ~/.vnc/xstartup
vncserver -kill :1 && vncserver :1
Starting the VNC server

Connect from your computer

Install a VNC viewer, such as RealVNC Viewer, and connect to the IP address of your server with display :1 (port 5901), for example:

192.168.1.12:5901
The RealVNC Viewer
Connecting to the VNC server

Enter the VNC password you set. The XFCE desktop opens.

The XFCE desktop
Warning: VNC traffic is not encrypted by default. Do not open port 5901 to the internet. Use an SSH tunnel, for example ssh -L 5901:localhost:5901 user@server, and connect your viewer to localhost:5901.

Important notes

  • Check that your hardware can run the desktop you choose.
  • A desktop uses RAM and CPU. If you run heavy apps on the server, think twice, or pick a light desktop like XFCE.
  • Keep the server secure: use a firewall and strong passwords.

Quick recap

  • Install lightdm and a desktop such as xubuntu-core.
  • Install a VNC server and start XFCE in xstartup.
  • Connect through an SSH tunnel.