Guides

Ubuntu Server GUI: install a light desktop, reach it remotely, remove it again

Ubuntu server GUI: install Xfce or GNOME on Ubuntu Server 24.04 or 26.04 without the extras, reach it over xrdp or VNC through SSH, and remove it again.

Published ~8 min read
On this page

Short answer: Ubuntu Server ships without a graphical interface, and most servers never need one: SSH and web panels do the work. If a program needs a desktop, install a light one without the extras, sudo apt install --no-install-recommends xfce4 xfce4-terminal, and reach it through xrdp or VNC inside an SSH tunnel, not through a port open to the internet.

Ubuntu 24.04 · 26.04 · Xfce for remote use over xrdp
sudo apt update
sudo apt install --no-install-recommends xfce4 xfce4-terminal dbus-x11 xorgxrdp xrdp
echo xfce4-session > ~/.xsession        # as the user who will log in
systemctl status xrdp --no-pager
systemctl get-default                   # graphical.target or multi-user.target

That gives you an Xfce desktop that exists only while someone is logged in over Remote Desktop. The xrdp guide for Ubuntu and Debian covers the firewall, the certificate and the black-screen fixes; this page is about the decision, the packages, what a desktop costs, and how to switch it off or remove it again. Package lists are from Ubuntu’s archive and its 24.04 seed files, as of October 2026.

Do you need a GUI on Ubuntu Server?

Usually not. Everything you configure on a server lives in text files and commands, and SSH with key logins is lighter, safer and scriptable. A desktop costs memory and disk, brings many packages to keep updated, and adds a remote-access service that needs securing. Before you install one, check the lighter options:

  • A web console. Cockpit is in Ubuntu’s repositories (sudo apt install cockpit) and shows services, logs, storage and a terminal in the browser on port 9090. Treat it like any admin login: keep it behind a firewall rule or an SSH tunnel.
  • A hosting panel for websites. If the goal is clicking through domains, mailboxes and WordPress rather than managing Linux, a Plesk hosting plan gives you that without a server to run.
  • Windows software. If the program you need runs on Windows, a Windows VPS is the simpler route than Linux with a desktop.

A desktop earns its place for a GUI-only program on Linux, a browser that must browse from the server’s IP address, a graphical installer, or a remote workstation you reach from several places.

Which desktop should a server get?

PackageDesktopLogin screenFits
xfce4Xfce, the bare desktopNoneRemote use over xrdp or VNC; the lightest of the four
xubuntu-desktop-minimalXfce with Xubuntu's core setLightDMA login screen on the server's own display
ubuntu-desktop-minimalGNOME, the Ubuntu Desktop lookGDMGNOME users; Wayland only on 26.04
ubuntu-desktopGNOME with the full application setGDMA desktop PC, not a server

Pick Xfce for a server. It still runs on X11 on both 24.04 and 26.04, which xrdp needs. On Ubuntu 26.04 the GNOME session runs only on Wayland, because GNOME Shell can no longer run as an X.org session (26.04 release notes), so GNOME cannot run inside xrdp there; it brings its own RDP server, gnome-remote-desktop, instead. All four packages exist in 24.04 and 26.04.

Why install with --no-install-recommends?

By default apt installs a package’s recommendations along with its dependencies. For a desktop metapackage that means a desktop PC’s worth of extras. In the 24.04 seed lists, ubuntu-desktop-minimal recommends Firefox, NetworkManager, CUPS printing with a row of printer drivers, Bluetooth, gnome-terminal and gnome-remote-desktop, among others; xubuntu-desktop-minimal recommends CUPS, Bluetooth, the NetworkManager applet, PipeWire and xfce4-terminal. None of that helps a server, and a second network manager next to the server’s netplan setup is a risk you do not need.

--no-install-recommends installs the dependencies only, so add what you do want by name: a terminal, and gnome-remote-desktop if you chose GNOME. To see the cost before you commit, let apt answer its own question with no:

Ubuntu · nothing is installed
sudo apt install --no-install-recommends --assume-no xfce4 xfce4-terminal
sudo apt install --assume-no xubuntu-desktop-minimal      # for comparison, with recommends
# each prints the package list and "After this operation, ... of additional disk space will be used."

How do you install a GUI on Ubuntu Server?

  1. 1Update and check the headroom
    Ubuntu
    sudo apt update && sudo apt full-upgrade
    free -h        # memory and swap
    df -h /        # free disk on the root file system
  2. 2Create a normal user for the desktop

    A desktop session runs a browser, a file manager and everything else as the user who logs in, so do not use root. The steps are in creating a sudo user.

  3. 3Install the desktop

    For remote use only, the command at the top of this page installs Xfce with xrdp and no login screen. For a login screen on the server’s own display:

    Ubuntu · Xfce with LightDM
    sudo apt install --no-install-recommends xubuntu-desktop-minimal xfce4-terminal
    sudo systemctl start display-manager     # or reboot
  4. 4Connect

    Over xrdp with any RDP client, or over VNC through an SSH tunnel as described next. Keep SSH as the main way in and treat the desktop as an extra.

How much RAM and disk does a GUI use?

It depends on the desktop and on what you open in it; a web browser inside the session usually needs more than the desktop itself. Canonical’s figure for a full Ubuntu Desktop is 6 GB of RAM and 25 GB of disk (ubuntu.com download page for 26.04.1, October 2026). A bare Xfce without recommends needs far less, but measure it on your own server rather than trusting any single number:

before and after
free -h                                       # once before, once with the desktop logged in
ps -eo rss,comm --sort=-rss | head -15        # the biggest processes, resident memory in KiB
df -h /                                       # disk before and after the install

Each xrdp or VNC session runs its own X server and desktop processes, so two people logged in cost twice. Plan the desktop on top of what the server’s real work already uses, and on a small plan add swap before a browser tab pushes the server into the out-of-memory killer.

Remote access: xrdp, or VNC through an SSH tunnel

xrdp

xrdp speaks RDP, so the Remote Desktop client you already have connects (mstsc on Windows, Windows App on a Mac, Remmina on Linux), and every user gets a desktop of their own. It is the better choice for most people. Keep port 3389 closed to the internet and tunnel it through SSH, as the xrdp guide shows.

VNC, bound to localhost

on the server · as the desktop user
sudo apt install tigervnc-standalone-server tigervnc-tools
tigervncpasswd                                     # set the VNC password
echo xfce4-session > ~/.xsession
tigervncserver :1 -localhost yes -geometry 1600x900
tigervncserver -list
on your computer
ssh -N -L 5901:127.0.0.1:5901 alice@203.0.113.10
# leave it running, then point a VNC viewer at 127.0.0.1:5901 (display :1 is port 5901)

tigervncserver -kill :1 ends the desktop. The tunnel works from Windows, macOS and Linux alike; the SSH tunnel guide explains the -L syntax and how to keep it running.

The VNC console in a hosting panel is a different thing: it shows the server’s own screen when SSH or RDP cannot reach it, and needs no VNC server inside the system. RDP vs VNC explains why it is no substitute for a remote desktop.

Boot to the command line with systemctl set-default

systemd starts its default target at boot, and its own default is graphical.target, which adds a display manager to everything in multi-user.target. Without a desktop that makes no difference: on a Debian 12 server with systemd 252 and no desktop installed, systemctl get-default printed graphical.target, and the display manager it asks for simply did not exist. Once LightDM or GDM is installed, it starts at every boot. To keep the desktop but not run its login screen:

Ubuntu · run from SSH
systemctl get-default
sudo systemctl set-default multi-user.target    # text login from the next boot on
sudo systemctl isolate multi-user.target        # stop the display manager now
sudo systemctl start display-manager            # start the login screen once, when needed
sudo systemctl set-default graphical.target     # back to a login screen at every boot

xrdp and a VNC server started with tigervncserver do not need the display manager, so remote desktops keep working with the text default. Run isolate from an SSH session: from inside a graphical session on the console, it ends that session.

How do you remove the GUI again?

A desktop metapackage pulls in many packages marked as automatically installed. Removing the packages you named and then running autoremove takes the rest out again. Read the list apt prints before you confirm.

Ubuntu
zgrep -h -A3 'Commandline: apt install' /var/log/apt/history.log*   # what you installed, and when
sudo apt purge xubuntu-desktop-minimal xfce4-terminal xrdp xorgxrdp   # the packages you named
sudo apt autoremove --purge                                         # their automatic dependencies
sudo systemctl set-default multi-user.target
rm -f ~/.xsession

Replace the package names with the ones from your own install command. If autoremove lists something you still use, keep it with sudo apt-mark manual PACKAGE and run autoremove again. Your files in /home stay; the settings folders the desktop created there (~/.config/xfce4, ~/.cache) can go by hand.

When the desktop does not start

  • “Unable to contact settings server” with a mention of dbus-launch: the session bus helper is missing. Install dbus-x11, which the commands above already include, and log in again.
  • A black screen over xrdp: usually the same user is still logged in to another desktop session. The xrdp black-screen causes go through it in order.
  • Login loops back to the login screen: files in your home directory such as ~/.Xauthority became owned by root after running a graphical program with sudo. sudo find ~ -xdev -user root lists them.
  • The server feels slower since the install: systemctl list-units --type=service --state=running shows what the desktop added. With --no-install-recommends that list stays short.

A desktop on an Ubuntu VPS

On a VMHeaven Ubuntu VPS, start from the Ubuntu 24.04 image, add Xfce with --no-install-recommends and reach it over xrdp through an SSH tunnel. Take a snapshot in the panel first: if you change your mind soon after, restoring it is quicker than an autoremove (it also rolls back everything written since the snapshot). The panel’s VNC console stays available as the way in when neither SSH nor RDP answers. A desktop with a browser in it wants memory to spare; the Standard KVM line carries more memory per plan than Hi-CPU at the same price.

Frequently asked

How do I install a GUI on Ubuntu Server?

Run 'sudo apt update', then 'sudo apt install --no-install-recommends xfce4 xfce4-terminal dbus-x11' for a light Xfce desktop, and add xrdp and xorgxrdp to reach it with a Remote Desktop client. For a login screen on the server's own display, install xubuntu-desktop-minimal instead, which brings LightDM. Without --no-install-recommends, apt also installs printing, Bluetooth, NetworkManager and other desktop extras.

Which desktop is best for Ubuntu Server?

Xfce. It is light, and it still runs on X11 on Ubuntu 24.04 and 26.04, which xrdp needs. GNOME (ubuntu-desktop-minimal) uses more memory, and on Ubuntu 26.04 it runs only on Wayland, so it cannot run inside xrdp and needs GNOME's own remote desktop service instead.

How do I make Ubuntu boot to the command line instead of the GUI?

Run 'sudo systemctl set-default multi-user.target' and reboot, or run 'sudo systemctl isolate multi-user.target' from an SSH session to stop the display manager at once. The desktop stays installed: 'sudo systemctl start display-manager' starts the login screen when you need it, and 'sudo systemctl set-default graphical.target' brings it back at every boot.

How do I remove the GUI from Ubuntu Server?

Purge the packages you installed by name, for example 'sudo apt purge xubuntu-desktop-minimal xfce4-terminal', then run 'sudo apt autoremove --purge' to remove the dependencies that came with them. Read the list before you confirm, and keep anything you still need with 'sudo apt-mark manual PACKAGE'. /var/log/apt/history.log shows what the original install added.

Related articles

All guides