---
title: "Install a GUI on Ubuntu Server, AlmaLinux or Rocky Linux · CloudSat"
description: "Install a GUI on Ubuntu Server, AlmaLinux or Rocky Linux: pick the smallest one that works, avoid the network trap, set the boot target, reach it over RDP."
url: https://cloudsat.io/learn/install-a-desktop-on-a-linux-server
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

[Remote access](https://cloudsat.io/learn/topic/remote-access)

# Install a GUI on Ubuntu Server, AlmaLinux or Rocky Linux

Install a GUI on Ubuntu Server, AlmaLinux or Rocky Linux: pick the smallest one that works, avoid the network trap, set the boot target, reach it over RDP.

CloudSat team November 18, 2026 8 min read

Server images ship without a desktop on purpose. Nothing draws pixels, so every megabyte and every CPU cycle goes to the work the machine exists for. Sometimes a graphical environment is still the right call: a program that only has a GUI, a browser that should run next to your servers, or a Linux workstation you can reach from anywhere. Here is how to choose one, install it on Ubuntu Server or on AlmaLinux and Rocky Linux, reach it remotely and back out.

## Decide what kind of GUI you need

"GUI" can mean three different things. Install the smallest one that does the job.

| You need | Install | Extra load | How you reach it |
| --- | --- | --- | --- |
| Point-and-click server administration | Cockpit web console | Small, it starts on demand | A browser, port 9090 |
| A few graphical programs | Xfce | Light | xrdp, or VNC through an SSH tunnel |
| The distribution's full desktop | GNOME | Heavy | GNOME Remote Desktop over RDP |

If the goal is managing services, logs, storage, updates and accounts, you do not need a desktop at all. Cockpit gives you those pages plus a terminal in a browser tab, and systemd starts it only when someone connects:

```bash
# Ubuntu
sudo apt install -y cockpit

# AlmaLinux or Rocky Linux
sudo dnf install -y cockpit

# both
sudo systemctl enable --now cockpit.socket
```

Keep port 9090 closed to the internet and reach it through SSH with `ssh -L 9090:localhost:9090 alice@203.0.113.10`, then open `https://localhost:9090` on your own machine.

## Before you install

A desktop is a large change on a machine you cannot touch, so prepare three things.

- **Room.** Run `free -h` and `df -h /`. Memory matters more than CPU. For comparison, Canonical's recommended spec for Ubuntu 26.04 LTS on a PC is a 2 GHz dual-core processor, 6 GB of memory and 25 GB of disk. One remote user without an office suite needs less, but plan on 2 GB for Xfce with a browser and 4 GB or more for GNOME. apt and dnf show the disk space needed before they ask to continue.
- **A way back in.** Take a snapshot, and know how to reach the server's screen without the network. On CloudSat, the **Console access (VNC)** option in [Recovery tools](https://cloudsat.io/docs/recovery-tools) shows the screen even when SSH stops answering.
- **A normal user.** A desktop session should never run as root. Create an account with `sudo adduser alice` on Ubuntu, or `sudo useradd -m alice && sudo passwd alice` on AlmaLinux and Rocky Linux.

## Ubuntu Server 24.04 and 26.04

### GNOME

```bash
sudo apt update
sudo apt install -y ubuntu-desktop-minimal
```

`ubuntu-desktop-minimal` brings GNOME, the GDM login screen and a small set of utilities, and recommends Firefox, a terminal and GNOME Remote Desktop. The bigger `ubuntu-desktop` adds office and media applications that rarely belong on a server. On Ubuntu 26.04, GNOME runs on Wayland only, so plan to reach it with GNOME Remote Desktop rather than xrdp.

### The network trap

The GNOME package set includes `ubuntu-settings`, which switches netplan's renderer from systemd-networkd to NetworkManager. On Ubuntu 24.04 this can leave the main interface without DNS servers after the install, while IP traffic keeps flowing, a known problem that is still open in Ubuntu's bug tracker. Reboot right after the install, or apply the new configuration, from a session you can afford to lose:

```bash
sudo netplan apply
resolvectl status | grep -A2 "DNS Servers"
ip -br addr
```

If the address or DNS servers are missing after that, fix it from the console rather than over the network you just broke.

### Xfce instead

```bash
sudo apt update
sudo apt install -y xubuntu-desktop-minimal
```

This installs Xfce with the LightDM login screen. Xfce still runs on X11 on both releases, which is what xrdp needs; the full setup is in our guide to [a Linux desktop over RDP with xrdp](https://cloudsat.io/learn/linux-desktop-over-rdp-with-xrdp).

## AlmaLinux and Rocky Linux 9 and 10

If you came looking for CentOS 7 instructions, this is where they now point. CentOS Linux 7 reached its end of life on June 30, 2024 and gets no security updates, so build a fresh server on a current release and move the data across.

The graphical environment is a dnf group on both versions:

```bash
sudo dnf group install -y "Server with GUI"
```

On version 9 the group installs GNOME together with the X.Org server. On version 10 there is no X.Org server at all, only Xwayland for older applications, and the same group brings GNOME on Wayland together with GNOME Remote Desktop and a package of GNOME defaults meant for servers.

Xfce exists only on version 9, from EPEL. EPEL 10 offers KDE Plasma 6 but no Xfce.

```bash
sudo dnf install -y epel-release
sudo dnf config-manager --set-enabled crb
sudo dnf group install -y "Xfce" "base-x"
```

The `base-x` group supplies the X.Org server for minimal installs, and EPEL's Xfce group pulls in GDM as its login screen.

## Choose what starts at boot

Installing a desktop does not always change what the machine boots into. Check, then set it:

```bash
systemctl get-default
sudo systemctl set-default graphical.target    # login screen at every boot
sudo systemctl isolate graphical.target        # switch now, no reboot

sudo systemctl set-default multi-user.target   # text only again
```

With `multi-user.target` as the default, the desktop stays on disk but nothing graphical starts, which frees its memory.

## Reach it with GNOME Remote Desktop

GNOME includes its own RDP server, `gnome-remote-desktop`, with three modes. The wrong one is the usual reason it "does nothing" on a server.

| Mode | What the client gets | Protocols | Good on a server? |
| --- | --- | --- | --- |
| Desktop sharing | The session already open on the machine's screen; locking the screen ends the connection | RDP and VNC | No, nobody sits at a server's screen |
| Remote login | The GDM login screen, then a session of your own | RDP only | Yes |
| Headless single user | A session started without any display, for one account | RDP and VNC | Only for special setups |

Remote login arrived with GNOME 46, so it is available on Ubuntu 24.04 and 26.04 and on AlmaLinux and Rocky Linux 10. Version 9 ships an older GNOME without it; use xrdp there.

The quickest route is the graphical one: open the console once, sign in at GDM, and turn on **Remote Login** under **Settings** > **System** > **Remote Desktop**. Over SSH, the same thing takes a TLS certificate owned by the daemon's own account and a few `grdctl` commands:

```bash
GRD=~gnome-remote-desktop/.local/share/gnome-remote-desktop
sudo -u gnome-remote-desktop mkdir -p "$GRD"
sudo -u gnome-remote-desktop openssl req -new -newkey rsa:4096 -nodes -x509 -days 730 \
  -subj "/CN=$(hostname -f)" -keyout "$GRD/tls.key" -out "$GRD/tls.crt"

sudo grdctl --system rdp set-tls-key "$GRD/tls.key"
sudo grdctl --system rdp set-tls-cert "$GRD/tls.crt"
sudo grdctl --system rdp set-credentials    # asks for a user name and password
sudo grdctl --system rdp enable
sudo systemctl enable --now gnome-remote-desktop.service
sudo grdctl --system status
```

The credentials you set here are a gate in front of the login screen, not a Linux account. Your RDP client asks for them first, then GDM asks for the real account's password. If the service fails to start with a user or permission error, which has been reported on some minimal Ubuntu 24.04 installs, check that the account exists with `getent passwd gnome-remote-desktop` and read `journalctl -u gnome-remote-desktop -b`.

### Connect without opening port 3389

The daemon listens on TCP 3389. Leave that port closed and carry RDP inside SSH:

```bash
# on your own computer
ssh -N -L 13389:localhost:3389 alice@203.0.113.10
```

Then point any RDP client at `localhost:13389`. The local port is 13389 because a Windows PC may already use 3389 for its own Remote Desktop service. Expect a certificate warning on the first connection, since the certificate is self-signed.

## Keep the desktop cheap

- **Stop sleep.** GNOME has automatic suspend settings, and a server should never suspend. Mask the sleep targets so no idle timer can trigger one: `sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target`.
- **Expect CPU rendering.** Without a GPU, GNOME draws its compositor on the CPU through Mesa's llvmpipe software renderer. Turning off animations inside the session helps: `gsettings set org.gnome.desktop.interface enable-animations false`.
- **Measure.** Compare `free -h` before and after you sign in, and list the biggest processes with `ps -eo rss,comm --sort=-rss | head -15`.
- **Patch more.** Every package the desktop added is now yours to update, so keep automatic security updates on.

If you would rather skip the setup, CloudSat's [Linux desktop RDP](https://cloudsat.io/linux-desktop-rdp) servers start from the IceWM over XRDP app or the Linux Mint image with Xfce already installed.

## Undo it

The clean way back is the snapshot you took before the install, or a rebuild of the server. Removing the packages works too, but on Ubuntu it changes netplan's renderer again, so it carries the same risk as the install. When you only want the resources back, set `multi-user.target` as the default and reboot.

## FAQ

### Does a desktop make a server less secure?

It adds software to patch and, once remote access is on, another listening service. Keep RDP and VNC ports closed to the internet, tunnel them over SSH or a VPN, and never sign in to the desktop as root.

### Can I install a GUI on CentOS 7?

You can, but CentOS 7 itself should be retired: it has had no security updates after June 30, 2024. Use AlmaLinux or Rocky Linux 9 or 10.

### Xfce over xrdp or GNOME over GNOME Remote Desktop?

Xfce over xrdp is lighter and suits small servers. GNOME Remote Desktop is the only RDP route for GNOME on Ubuntu 26.04 and on version 10 of AlmaLinux and Rocky Linux, where GNOME has no X11 session left.

### Can several people use the desktop at once?

With remote login, yes: each person signs in at the GDM screen and gets a separate session. Size memory per person, not per server.

**Run it on CloudSat.** Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. [See plans](https://cloudsat.io/plans) or [deploy a server](https://dash.cloudsat.io/console/deploy).

## Keep reading

[All guides in Remote access](https://cloudsat.io/learn/topic/remote-access)

- [Kasm Workspaces on a GPU server: install and GPU sessions](https://cloudsat.io/learn/kasm-workspaces-setup-and-gpu-sessions): Remote access Kasm Workspaces on a GPU server: install and GPU sessions 7 min read
- [How the Remote Desktop Protocol works, step by step](https://cloudsat.io/learn/how-the-remote-desktop-protocol-works): Remote access How the Remote Desktop Protocol works, step by step 7 min read
- [xrdp on Ubuntu, Debian and Rocky Linux: a desktop over RDP](https://cloudsat.io/learn/linux-desktop-over-rdp-with-xrdp): Remote access xrdp on Ubuntu, Debian and Rocky Linux: a desktop over RDP 6 min read
- [Is VNC safe? How to secure it, and what to use instead](https://cloudsat.io/learn/secure-vnc-or-replace-it): Remote access Is VNC safe? How to secure it, and what to use instead 6 min read
