Ubuntu Server is renowned for its efficiency and resource conservation, primarily due to its default command-line interface. However, there are situations where a graphical user interface (GUI) can significantly enhance usability and streamline certain tasks on your Ubuntu 22.04 server. Whether you need to run graphical applications, prefer a desktop environment for server management, or simply find a GUI more intuitive for specific operations, this guide is for you.
This comprehensive tutorial will walk you through the process of installing a GUI on your Ubuntu 22.04 server, making it more user-friendly without sacrificing its inherent server capabilities.
How to install GUI on Ubuntu Server
Prerequisites
Before you begin, ensure you have the following:
- An Ubuntu 22.04 server installation.
- A user account with
sudo
privileges for administrative tasks. - A stable internet connection to download packages.
Step 1: System Update
It’s crucial to start with a system update to ensure all existing packages are up to date. This minimizes potential conflicts and ensures compatibility with the new GUI components. Open your terminal and execute the following commands:
sudo apt update
sudo apt upgrade
The apt update
command refreshes the package lists, while apt upgrade
upgrades all outdated packages to their latest versions. This process might take some time depending on your system’s current state and internet speed.
Step 2: Choose and Install a Display Manager
A display manager is responsible for managing graphical login and starting the display server and desktop environment. While Ubuntu’s default display manager, gdm3, comes bundled with GNOME desktop environment, lighter alternatives like LightDM or Slim are often preferred for servers to conserve resources.
For this guide, we will demonstrate the installation using LightDM, a popular, lightweight, and configurable display manager. To install LightDM, use the following command:
sudo apt install lightdm
When prompted, confirm the installation by typing Y
and pressing Enter
.
Note: If you prefer to use the even lighter Slim display manager, you can install it instead using the command sudo apt install slim
. However, LightDM provides a good balance between features and resource usage for most server GUI needs.
Step 3: Select Your Desktop Environment
Now comes the exciting part – choosing and installing your preferred desktop environment. Several desktop environments are available for Ubuntu 22.04, each offering a different balance of features, aesthetics, and resource consumption. Here are some popular options:
Option 1: Install the Standard Ubuntu Desktop (GNOME)
The default Ubuntu Desktop environment is based on GNOME, a modern and feature-rich desktop. It’s well-integrated with the Ubuntu ecosystem and provides a user-friendly experience. To install the standard Ubuntu Desktop, run:
sudo apt install ubuntu-desktop
During the installation, you’ll be prompted to choose a display manager if you have multiple options installed. Select LightDM (or Slim if you chose to install it earlier) and press Enter
.
Selecting LightDM as the display manager during Ubuntu Desktop installation
Once the installation completes, reboot your server to start the GUI:
sudo reboot
After rebooting, you will be greeted by the graphical login screen of your chosen display manager and the Ubuntu Desktop environment. Enter your credentials to log in and access your Ubuntu 22.04 server with a full GUI.
Default Ubuntu desktop environment on Ubuntu Server
Note: For a more minimal GNOME experience, you can install the vanilla GNOME desktop using: sudo apt install vanilla-gnome-desktop vanilla-gnome-default-settings
.
Option 2: Install KDE Plasma Desktop
KDE Plasma is a highly customizable and visually appealing desktop environment known for its flexibility and extensive features. If you prefer a more traditional desktop experience with a wealth of customization options, KDE Plasma is an excellent choice. Install it using:
sudo apt install kubuntu-desktop
After installation, reboot your server to boot into the KDE Plasma desktop environment.
Option 3: Install XFCE Desktop
XFCE is a lightweight yet functional desktop environment that prioritizes speed and efficiency. It’s an ideal choice for servers where resource usage is a concern, or if you prefer a faster, less resource-intensive GUI. Install XFCE with:
sudo apt install xubuntu-desktop
Reboot your server, and you will have the XFCE desktop environment running on your Ubuntu 22.04 server.
XFCE desktop environment on Ubuntu Server
Option 4: Install MATE Desktop
MATE is a fork of the classic GNOME 2 desktop environment. It provides a traditional desktop paradigm and is known for its stability and ease of use. Install MATE using:
sudo apt install ubuntu-mate-desktop
Option 5: Install LXQt Desktop
LXQt is an extremely lightweight Qt-based desktop environment. It’s designed for systems with limited resources and offers a very responsive and fast GUI experience. If you need the most resource-efficient GUI for your Ubuntu 22.04 server, LXQt is a top contender. Install it with:
sudo apt install lubuntu-desktop
After installation and reboot, you can enjoy the lightweight LXQt desktop environment.
LXQt desktop environment on Ubuntu Server
Step 4: Switching Between Desktop Environments (If Multiple Installed)
If you have installed multiple desktop environments, you can easily switch between them from the display manager login screen. With LightDM, you can typically find a session selection option (often a gear icon or a dropdown menu) on the login screen. This allows you to choose which desktop environment to use for your current session.
For Slim display manager, you can cycle through installed environments by pressing F1 repeatedly at the login screen. The currently selected environment will be displayed at the bottom of the screen.
Step 5: Removing the GUI and Display Manager
If you decide you no longer need the GUI and want to revert your Ubuntu 22.04 server back to a command-line only system to conserve resources, you can easily remove the installed GUI and display manager.
-
Open a terminal window within your GUI environment.
-
Use the
apt remove
command to uninstall the desktop environment and display manager packages. For example, to remove LXQt and LightDM, use:sudo apt remove lubuntu-desktop lightdm
Replace
lubuntu-desktop
andlightdm
with the actual desktop environment and display manager you installed. -
Reboot your server:
sudo reboot
-
Finally, to clean up any leftover dependencies, use the
autoremove
command:sudo apt autoremove
Conclusion
Congratulations! You have successfully installed a GUI on your Ubuntu 22.04 server. You can now leverage the benefits of a graphical interface for server management or running graphical applications as needed. Remember to choose a desktop environment that aligns with your resource constraints and usability preferences. Whether you opted for the full-featured Ubuntu Desktop, the customizable KDE Plasma, the lightweight XFCE or LXQt, or the classic MATE, you now have a more versatile Ubuntu 22.04 server environment.
Consider exploring different desktop environments to find the perfect fit for your workflow. And if you’re looking for robust and reliable server infrastructure, explore rental-server.net for a range of server solutions to meet your needs.
Was this article helpful?