How to Install a Desktop Environment on My Ubuntu VPS?
Linux is a fascinating operating system. There are more than 300 distributions, all offering an incredible range of features and serving completely different user experiences.
Even after you pick a distro, you still have different versions and flavors to choose from. The result of this is that you sometimes may end up missing a particular functionality.
For example, after you order an Ubuntu VPS, you may find that it doesn’t have a desktop environment. Luckily, Linux’s endlessly customizable nature means you can install it without too much hassle. Let’s see how.
Table of Contents:
- The Difference Between Ubuntu Desktop and Ubuntu Server
- Why Doesn’t My Server Have a GUI and When Might I Need It?
- How to Install a Desktop Environment on an Ubuntu VPS?
- Installing a VNC Server on an Ubuntu VPS
The Difference Between Ubuntu Desktop and Ubuntu Server
Ubuntu is one of the most popular Linux distributions out there. First released in 2004, it has attracted millions of former Windows and macOS users, and it has grown famous for its excellent performance, rich repository of software packages, and, last but by no means least, easy-to-use Graphic User Interface (GUI).
People may be expecting to see the aforementioned GUI when they order an Ubuntu VPS. Instead, they are more likely to get instructions on connecting to the server via SSH and controlling it via an old-fashioned console.
That’s because there are two versions of Ubuntu – Ubuntu Desktop and Ubuntu Server.
The two versions have the same kernel and same support cycle, but the default software packages they come with differ because they are built with different users in mind. Ubuntu Server is supposed to work on servers, so its integrated functionality is geared toward making sysadmins’ lives easier. By contrast, Ubuntu Desktop is designed for general use, and among its default applications, you’ll find things like a word processor and a browser.
However, the biggest difference between the two is in the way you interact with them. By default, Ubuntu Server doesn’t have a GUI at all. It’s designed to work only via the Command-Line Interface (CLI). If you have a VPS running Ubuntu Server and want a desktop environment, you’ll need to install it yourself.
Why Doesn’t My Server Have a GUI and When Might I Need It?
When it comes to servers, it’s all about performance. Developers and hosting providers try to extract every ounce of speed out of the underlying hardware, which means that everything, from the operating system to the applications and services installed on it, needs to be perfectly optimized and stripped of any unnecessary components.
The desktop environment usually is left out of Ubuntu servers because, more often than not, users simply don’t need it. When it comes to website hosting, for example, most people use a web hosting control panel. Even if they need to install additional applications, they usually do it via the console.
However, VPS servers are used for more than just hosting websites.
For example, a VPS can be a suitable solution for developers who want to test websites and see how they perform in different parts of the world. Organizations also use virtual servers to create a collaborative environment where multiple people connect to the same machine.
On the one hand, these users might not be proficient in Linux commands. On the other, the applications they use may only be designed to work in a GUI. All in all, there are many reasons why you might need a graphical user interface on an Ubuntu server. Let’s see how you can get one.
How to Install a Desktop Environment on an Ubuntu VPS?
To install a desktop environment on your VPS, you need to log into the server via SSH. Don’t forget to use an account with root privileges. Otherwise, you won’t be able to complete the installation.
When you’re in, it might not be a bad idea to update the existing software packages with the following commands:
sudo apt-get update
sudo apt-get upgrade
Now, you can move on to the desktop environment.
Linux users are spoiled for choice when it comes to desktop environments. There are quite a few options like KDE Plasma and GNOME that offer a sleek interface and endless customization options.
Today, however, we’ll focus on Xfce. Xfce is a free desktop environment for Linux and other Unix-based operating systems that has been around since 1996. One of its main advantages is its lightweight design, which promises to have minimum impact on your server’s performance.
As an added bonus, you can set it up on your Ubuntu server with a single command:
sudo apt-get install xfce4 xfce4-goodies
At some point during the installation, you will be asked to pick a default display manager. A display manager is a program that provides you with graphical login capabilities. Whichever one you choose, you’ll follow the same steps for setting up and controlling the server and its GUI.
There are quite a few packages to unpack and install, so the installation may take a while to complete.
With the Xfce GUI set up, it’s time to find a way of controlling the desktop environment from your home computer. This is where VNC comes in.
Installing a VNC Server on an Ubuntu VPS
You have so far used only SSH to manage your Ubuntu VPS. This is the best and most secure way of executing commands and accessing core configuration files. However, it only works via the command-line interface, meaning you won’t be able to use it to access the newly installed desktop environment. For that, you’ll need VNC.
VNC stands for Virtual Network Computing – a desktop sharing system based on the Remote Frame Buffer protocol. VNC works on many different platforms, and it’s used extensively for the purposes of remote technical support. You will be using it to access your Ubuntu VPS’s desktop environment.
To use VNC, you need to set up and configure a VNC server on your VPS and then use a VNC client to connect to it.
There are many VNC servers to choose from, and each one has its own steps for installing and configuring. Today, we’ll show you how to set up TigerVNC – a high-performance VNC server with client applications supporting Windows, Linux, and macOS. To set up the server, enter:
sudo apt-get install tigervnc-standalone-server
The installation is straightforward, but configuring TigerVNC takes a bit more time.
Start by entering the vncserver command and picking the password you’ll use to access your VPS.
At this point, TigerVNC will also ask you if you’d like to set a view-only password. With it, a user will view the desktop environment without having any control over it.
You can change your VNC password later with the vncpasswd command.
The password is set, but TigerVNC still needs to be configured to show the desktop environment whenever a client connects to it. This means editing its startup file.
First, stop TigerVNC with the following command:
vncserver -kill :1
The file you need to edit is ~/.vnc/xstartup. If you have previously made changes to it, it’s a good idea to create a backup just in case. The command is:
mv ~/.vnc/xstartup ~/.vnc/xstartup-backup
Open the xstartup file with your favorite editor and add the following lines:
Save the changes and exit the text editor.
Finally, you can restart the VNC server and use a client to remotely log into the VPS.
In general, Linux servers tend to be faster than Windows machines, and a lot of that performance advantage is down to the fact that server-focused distributions often come without a resource-intensive GUI.
Most people manage just fine without it, but in some cases, a desktop environment is a necessity rather than a convenience. Thankfully, Linux is flexible enough to allow you to set it up and access it remotely.
Can I install a GUI on a Linux VPS?
Although most Linux virtual servers don’t come with a GUI by default, you have the option of installing one of a range of desktop environments available for the open-source operating system. However, you need to remember that the graphic interface will use more hardware resources, so you should expect a drop in performance.
How do I connect to the desktop environment on my Ubuntu VPS?
By default, you access your VPS via SSH. However, because SSH only works through the command-line interface, it’s not suitable for using a desktop environment. To use the GUI remotely, you’ll need to set up a VNC server on your Ubuntu VPS.
Is Ubuntu Server faster than Ubuntu Desktop?
All other things being equal, Ubuntu Server is significantly faster than Ubuntu Desktop. This is because the server edition doesn’t have a resource-intensive GUI to overload the hardware, and it also lacks additional features and modules that aren’t strictly related to server-centric tasks.