DigitalOcean Droplets do not come with a Graphical User Interface (GUI) installed upon creation and are instead usually accessed and managed using the command line. However, you can install Ubuntu Desktop on a Droplet and use a remote desktop client to log in to and interact with the Droplet like a desktop computer. This can allow you to manage certain tools more easily and provide a more familiar environment for you to interact with your server.
In this tutorial, you will set up a display manager on a Droplet, install Ubuntu Desktop, and log in to the Droplet’s GUI using Microsofts Remote Desktop.
To complete this tutorial, you need:
In order for your local machine to interact with the Droplet’s GUI, you need to install a display server on the Droplet. This server allows remote desktop clients to capture your local machine’s mouse clicks and keyboard strokes and send them to the Droplet’s GUI. You can do this by installing xrdp, a free and open-source display server based on Microsoft’s RDP (Remote Desktop Protocol).
To install xrdp, log in to your Droplet using SSH and then update and upgrade the packages on the Droplet:
sudo apt-get update
Follow the prompts until all the packages have been upgraded.
After upgrading the packages, install xrdp on your machine:
sudo apt-get install xrdp
Once installed, enable xrdp to start on boot by running:
sudo systemctl enable xrdp
This command adds xrdp to the list of applications that Ubuntu automatically starts upon boot.
Lastly, make sure that your Droplet’s UFW firewall rules have been set to accept TCP connections on port 3389:
sudo ufw allow 3389/tcp
This is the port that your remote desktop client attempts to connect to on the Droplet.
Once you have set up xrdp as the Droplet’s display server, you can install the Ubuntu Desktop GUI on your Droplet. Ubuntu has many GUI options available, all with varying degrees benifits and advantages, such as GNOME, KDE Plasma Desktop, and MATE Desktop. Ubuntu Desktop is Ubuntu’s official GUI and is based on the popular GNOME desktop environment for Linux.
To install Ubuntu Desktop on your Droplet, run the following command and follow the prompts:
sudo apt-get install ubuntu-desktop
The installation may take several minutes to download and complete.
After installing Ubuntu Desktop, you need to create a user on the Droplet that is not the root
user. You can use this user name and password to log in to the Droplet’s GUI.
To create new user, use the useradd
utility and follow the prompts, replacing your_new_username
with your desired username:
adduser your_new_username
The utility guides you through creating a password for the new user and adding any additional information to the user’s profile.
Once you have created the new user, reboot your Droplet to apply all of the changes:
reboot
Once your Droplet has rebooted, you can log in to your Droplet using Microsoft Remote Desktop.
To do this, open Microsoft Remote Desktop on your local machine and then click the ‘+’ or the Add PC button to add a new remote connection. In the Add PC window, enter the Droplet’s public IPv4 address to the PC name field.
For a more comfortable user experience, we recommend clicking the Display tab, unchecking the Start session in full screen option, and picking a resolution appropriate for your onscreen work environment.
Once you have set up the connection’s options, click Add. Microsoft Remote Desktop adds the connection as a PC.
To log in to the Droplet, hover your mouse over the new PC, click the three-dots menu (…), and then click Connect. When prompted, enter the new user’s username and password. The client logs you into the Droplet’s desktop and your window should look like this.
Ubuntu Desktop does not come with a web browser installed on it. To download Google Chrome onto your new desktop, open a terminal on the Droplet and use the wget
utility to download Chrome:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
You can find the Terminal application in the Activities menu on the desktop.
After Chrome has downloaded, install it using apt install
:
sudo apt install ./google-chrome-stable_current_amd64.deb
Once you have installed Chrome, you can open it from the Activities menu in the upper-left corner of the screen.
In this tutorial, you:
After setting up your Ubuntu remote desktop, you can explore all of the features it has to offer and continue to install any programs you need as you would on any PC.