Ubuntu is one of the most widely used Linux distributions, developed by Canonical inc. Ubuntu comes in several flavors, the Ubuntu Desktop Edition, which ships with a GNOME-based desktop by default, and the Ubuntu Server edition, which is mainly meant to be run on headless servers. Ubuntu server edition does not install a GUI. This tutorial will show you how to install an Ubuntu 20.04 Desktop from the command line on an Ubuntu server system.
Prerequisites
- Ubuntu 20.04 Server
- User with root (sudo) privileges
Prepare the system
Before we start installing the Desktop GUI, we will update the package lists.
sudo apt update
And then install any pending updates, if any.
sudo apt upgrade -y
Install a display manager
In this step, we will install the display manager. I have chosen to use the LightDM display manager here as it uses fewer resources than the default display manager GDM3.
sudo apt install lightdm
During installation, you will be asked which display manager shall be the default display manager. Choose ‘lightdm’ here.
Install Ubuntu Desktop
In the final step, we will install the Ubuntu desktop environment using tasksel.
As the tasksel command might not be installed on your system yet, we’ll install that first.
apt install tasksel
I will install the standard Ubuntu desktop here, if you prefer to install a different desktop like KDE Plasma, Mate Core, or Xubuntu, have a look at the next chapter. I’ll list the tasksel commands to install these alternative desktops there.
Now install Ubuntu Desktop using tasksel:
sudo tasksel install ubuntu-desktop
The installation process of the Ubuntu Desktop starts immedeately.
Reboot the system to start the Desktop GUI when the installation of the Ubuntu Desktop environment has finished.
sudo reboot
After reboot, you will be greeted with the Ubuntu Desktop login.
Enter your password and you are logged into the desktop.
Other Desktop environments
The apt and tasksel commands are also capable of installing other desktop environments, I’ll list the commands to install them below.
Installing KDE Plasma
sudo apt install kde-plasma-desktop
Installing Xubuntu
sudo tasksel install xubuntu-core
Installing Mate Core
sudo tasksel install ubuntu-mate-core