top of page

How to Install a Desktop Environment (GUI) on Ubuntu Server

  • arjun5792
  • Mar 8, 2023
  • 5 min read

Updated: Mar 10, 2023

Would you like your Ubuntu server to have a GUI installed? In the majority of cases, you can absolutely do that, and I'll go over the specific steps in this tutorial.


Before you see that, though, allow me to explain why the server edition does not include a graphical user interface (GUI) and when you might want to install one on your server.


Why is there no GUI on Ubuntu server?


The primary distinction between Ubuntu desktop and server is that the server edition lacks a GUI, or desktop environment. A stripped-down version of Ubuntu desktop without the graphical modules is what Ubuntu Server essentially is.


This was planned. A Linux server plans to run services using the system resources. Because the graphical desktop environment uses a lot of system resources, server operating systems do not by default include a desktop environment.


512 MB of RAM may be sufficient for an Ubuntu server, but a decent Ubuntu desktop will require at least 2 GB of RAM. In the server world, that is regarded as a resource waste.


You are expected to use and manage your system through the command line as a server user (or sysadmin). For this, you should have a basic understanding of Linux commands.


On your server, do you really need to install a GUI?


Some people find it uncomfortable to perform all tasks using commands in the terminal. After all, the majority of people are trained to use computers graphically.


Installing a desktop environment and using it graphically is an option for your server. Although it's not how most people do it, it is a possibility.


However, you must have direct access to the server for this to work. if you are running it on a real computer, such as a server, laptop, desktop, or Raspberry Pi. If you have direct access to the host system, you can install it on a server running inside a virtual machine as well.


Installing GUI won't be a good idea if you have a server deployed using a cloud services provider like Linode, DigitalOcean, or AWS. Use programs like Webmin or Cockpit to graphically manage a remote server if you have one. With the help of these tools, you can use and manage your servers visually within a web browser. In comparison to a full desktop environment, it uses a lot fewer system resources.


How is the Ubuntu server's GUI installed?


Let's look at how to install a desktop environment on an Ubuntu server after the fundamentals are clear.


You'll require the following:


At least 2 GB of RAM must be installed on and running on an Ubuntu Server, executive authority (you need to run sudo commands)


Internet access (you are going to download and install new packages)


In my case, I have direct access to the host machine and the Ubuntu server is set up in a virtual machine. I have applied the same technique to a Raspberry Pi-based Ubuntu server.


Getting your system ready


First, let's update and upgrade everything to make sure that our system is running the most recent packages since you are going to make some system-wide changes:

sudo apt update && sudo apt upgrade


Installing the desktop environment


After the updates are finished, you can move on to installing a desktop environment.

Two strategies exist for doing this:

  • Installing the packages with apt

  • Utilizing the tasksel Debian tool, which facilitates the installation of numerous packages through a single coordinated process (tasks)

Either one will enable you to fully install the desktop environment of your choice as a package, just as if you were installing the desktop version from scratch. This means that you will have access to all of the standard tools and applications that come with the desktop version.


Tasksel must first be installed using the following command before you can use it:

sudo apt install tasksel

After completing this task, you can use tasksel to set up the desktop environment (also referred to as DE).


You are probably already aware of the various desktop environments that are available. You can pick the one you prefer. Some desktop environments (like GNOME) demand more system resources, while others use less (like Xfce, MATE, etc).


Which DE you choose to use is entirely up to you. Since the GNOME Desktop is Ubuntu's default desktop, I'm going with it. I'll share some advice on installing various desktops later on.


Run the following command if you are using tasksel:

sudo tasksel install ubuntu-desktop

Run this command if you only want to use apt:

sudo apt install ubuntu-desktop

The length of this process will vary depending on your hardware and connection speed, from a few minutes to an hour.


I should note that the GNOME Desktop Environment will be fully installed as a result of both actions. For the purposes of this tutorial, I ran both commands, and the outcomes were exactly the same.


Setting up and installing the display manager


You will need a Display Manager, also referred to as a "login manager," after this procedure is finished. This tool will be in charge of managing user sessions and authentication as well as launching the display server and loading the desktop.


GDM3 is the display manager that GNOME Desktop by default uses, but it uses a lot of resources. Use something less heavy and resource-conserving. Let's use lightdm, a display manager that is platform independent, in this situation. With apt, install it:

sudo apt install lightdm

Although you can have multiple display managers installed, only one can run at a time, so the system will ask for one when installing lightdm.


Simply select lightdm from the list and press "Ok". It shouldn't take more than a few minutes to complete this. After completing this task, use the following command to launch the display manager and load the GUI:

sudo service lightdm start

You can use the following commands to determine how your system's display manager is set up:

cat /etc/X11/default-display-manager

and a prompt similar to this will appear:


You should have a greeting screen loaded if everything went as planned. Your desktop will start once you enter your credentials.


Open a terminal window and enter the following commands to shut down the GUI:

sudo service lightdm stop

Putting in additional desktop environments (optional)


I mentioned earlier that we could select a different desktop, so let's look at some options.

  • MATE

MATE is a very nice option for a lightweight desktop that is based on the GNOME2 source code.


Run these commands to install MATE:

sudo tasksel install ubuntu-mate-core

or

sudo apt install ubuntu-mate-core
  • Lubuntu / LXDE/LXQT

Another lightweight option is Lubuntu, which I advise using if your system is underpowered or you're giving an old computer a makeover. Use this command to install it:

sudo tasksel install lubuntu-core

or

sudo apt install lubuntu-core
  • Xubuntu / Xfce

Xubuntu is an Ubuntu-based desktop environment that is light, simple, and stable but also highly customizable. It is based on the Xfce desktop environment. You can use the following command to give it a shot:

sudo tasksel install xubuntu-core

or

sudo apt install xubuntu-core

Other desktops like KDE, Cinnamon, and Budgie are also great options, so there's no reason I'm leaving them out; feel free to install them however you like.


How do I remove the Ubuntu server's GUI?


You can uninstall the previously installed packages if you find that the desktop environment is using too many resources.


Please make a backup of your important data or take a system snapshot because, in some cases, it might lead to dependency problems.


You're aware of how to uninstall packages from Ubuntu:

sudo apt remove ubuntu-desktop

sudo apt remove lightdm

sudo apt autoremove

sudo service lightdm stop

Now restart your computer. You ought to now be viewing the standard command line log.


Conclusion


Although installing a GUI on a desktop is possible, it is rarely necessary. Use a server distribution like YunoHost that is built on top of Debian to give you a server that can be managed via GUI if you are not too comfortable using the command line.


To avoid the additional steps later, I would advise choosing a desktop version if you are installing a system from scratch.


With that knowledge, I'll turn the comment section over to you. Does your server use a GUI? Did you encounter any difficulties while using this tutorial? Visit Server Management Services at Skynats

 
 
 

Recent Posts

See All
How to Sort Out the HTTP/499 Error

Let's learn how to fix the HTTP/409 problem in this article. Our server administration staff has the subject prepared. Come, let's...

 
 
 

コメント


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Server Management. Proudly created with Wix.com

bottom of page