# Install Ubuntu Desktop on Any Ubuntu Server

> Turn a cloud server into a remote dev machine: install the Ubuntu desktop, boot into the GUI, and connect from any RDP client through XRDP.

*2026-09-17T03:23:45Z*

Some developers want to use a cloud server as a personal computer, for fast development and remote use. It's a very good idea, but a cloud server ships without a desktop. How do you install an Ubuntu desktop on it?

It's easy with a few commands. In this guide you will install the Ubuntu desktop on an Ubuntu server, make the server boot into the graphical interface, and then set up XRDP so you can control it from any RDP client.

_Note: written in October 2023; package names and defaults may differ on newer Ubuntu releases._

## Install the Ubuntu desktop

1. Start by installing tasksel:

```bash
sudo apt install -y tasksel
```

2. Now you are ready to install `ubuntu-desktop`:

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

3. Cloud servers don't have a display by default, so the system boots to a text-only target. Set the graphical target so the GUI comes up:

```bash
sudo systemctl set-default graphical.target
```

And wow, it's working now.

## Install XRDP for remote control

Having a desktop on the server is only useful if you can reach it. If you want remote control over RDP, follow these steps. The commands below change system files and the firewall, so run them as root or prefix them with `sudo`.

1. Install xrdp:

```bash
sudo apt install xrdp -y
```

2. Add the `xrdp` user to the `ssl-cert` group so xrdp can use SSL:

```bash
usermod -a -G ssl-cert xrdp
```

3. Add these lines to the xrdp session script so the desktop session starts cleanly:

```bash
echo 'unset DBUS_SESSION_ADDRESS' >> /etc/xrdp/startwm.sh
echo 'unset XDG_RUNTIME_DIR' >> /etc/xrdp/startwm.sh
```

_Note: the original post wrote `Unset` with a capital U; the shell command is lowercase `unset`, which is what is used here._

4. xrdp is ready to connect. There is just one step left: allow port 3389, the RDP port, through the firewall:

```bash
ufw allow from 192.168.1.0/24 to any port 3389
ufw reload
```

This rule only accepts connections from the `192.168.1.0/24` network. Replace it with the address range you will actually connect from.

## Connect

Now you can connect to your remote server with any RDP client and use it like a personal computer.

---

Source: https://fadymondy.com/en/blog/install-ubuntu-desktop-on-any-ubuntu-server
