Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install a desktop environment on a Ubuntu server

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to install a desktop environment on a Ubuntu server. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Do you want to install GUI on your Ubuntu server? You can install it in most cases, and I will explain the installation steps in detail in this tutorial.

Before we officially begin, I'll tell you why the server version of Ubuntu doesn't come with GUI, and under what circumstances you can install GUI on the server.

Why does the Ubuntu server have no GUI?

If you compare the desktop version of Ubuntu with the server version, you will find that the main difference between the two is the lack of GUI (such as desktop environment) in the server version. The Ubuntu server is basically a downgraded version of the desktop version without the graphics module.

It was done on purpose. The Linux server needs to consume system resources to run the service. The graphical desktop environment consumes a lot of system resources, so the server operating system does not include the desktop environment by default.

You can use Ubuntu servers on machines with only 512 MB RAM, but Ubuntu desktops need at least 2 GB of RAM to provide normal functionality. Running a desktop environment on a server is considered a waste of resources.

As a server user (or system administrator), you should use and manage your system from the command line. In order to achieve this level, you need to have a wealth of knowledge about Linux commands.

Typically, you have to manage a server from the command line

Do you really need to install GUI on your server?

Some users may not be used to using the command line to get the job done under the terminal. After all, most users have the condition to operate the computer through a graphical interface.

You may install a desktop environment on your server and use a graphical interface. Most people wouldn't do that, but it's feasible.

But this only works if you can manipulate the server directly. Suppose you run it on a physical machine, such as a server, desktop or laptop, or something like a raspberry pie. If you can operate the host system directly, you can also install it on a server running on a virtual machine.

If you deploy a server through a cloud server provider such as Linode, DigitalOcean or AWS, then installing GUI will not work. If you want to manage your remote server through a graphical interface, you can use tools such as Webmin or Cockpit. You can use these tools to use and manage your server in your Web browser. Compared with a mature desktop environment, it can greatly reduce resource consumption.

Tools like Cockpit allow managing Linux servers graphically

How do I install GUI on a Ubuntu server?

When you know the basics, let's take a look at the steps to install a desktop environment on a Ubuntu server.

You need to make the following preparations:

The Ubuntu server has been configured and the RAM is at least 2 GB

Administrator privileges (you need to use sudo to execute commands)

The network connection is normal (you need to download and install the new package)

I installed the Ubuntu server on the virtual machine, and I can manipulate the host machine directly. I used the same method to install the Ubuntu server on the raspberry pie.

Be careful!

If you are for experimental purposes such as study and research, then you can do these operations. Do not add GUI to the server in the production environment. Subsequent deletions of GUI may cause dependency problems, and some cases can damage the system.

Prepare the system

First of all, because you are going to make some system-level changes, update and upgrade first to ensure that our system's packages are up-to-date:

Sudo apt update & & sudo apt upgrade install Desktop Environment

After the update, you can install the desktop environment.

There are two ways:

Use apt to install the package

Use a Debian tool called tasksel, which can install multiple packages through one-stop processing (tasks)

Either way, you can install the complete desktop environment as a full package, just as you install the desktop version from scratch. I mean, you can get all the default applications and tools just like the desktop version.

If you want to use tasksel, you need to install it first with the following command:

Sudo apt install tasksel

After execution, you can use tasksel to install the desktop environment (also known as DE).

You may know that there are many desktop environments available. You can choose the one you like. Some desktop environments consume more system resources (such as GNOME) and some take up less (such as Xfce, MATE, and so on).

You can decide which DE to use for yourself. I will install the GNOME desktop because it is the default desktop for Ubuntu. I will also introduce the installation of other desktops later.

If you are using tasksel, execute the following command:

Sudo tasksel install ubuntu-desktop

If you use apt, execute the following command:

Sudo apt install ubuntu-desktop

This process can take from a few minutes to an hour, depending on your network speed and hardware.

I would like to remind you that the full GNOME desktop environment will be installed after the execution of the above two commands. In this article, I will execute both commands, and the results of both commands are the same.

Install and configure display Manager

After the installation is complete, you will need a component called display Manager or Login Manager. The function of this tool is to start the display server and load the desktop when managing user conversations and authentication.

The GNOME desktop uses GDM3 as the display manager by default, but it is a bit heavy from a resource point of view. You can use a more lightweight and resource-friendly manager. Here we use a platform-independent display manager lightdm. Install it using apt:

Sudo apt install lightdm

When we install lightdm, we are asked to choose the default display manager, because even if you can install multiple managers, you can only run one.

Use the arrow key to select an option and then use the tab key to select and press enter

Select "lightdm" in the list and click ". This should take less than a few minutes. When you are finished, you can start the display Manager and load GUI with the following command:

Sudo service lightdm start

You can check the current display Manager using the following command:

Cat / etc/X11/default-display-manager

The result after running is similar to this:

Checking the default Display Manager

If all goes well, you will now come to the welcome screen.

Greetings screen of GNOME Desktop with LightDM on an Ubuntu server

Enter your credentials and your desktop will run.

GNOME Desktop fully loaded on Ubutnu server

If you want to close GUI, open a terminal and type:

Sudo service lightdm stop installs other desktop environments (optional)

I said earlier that we can choose different desktops. Let's take a look at some other options:

MATE

MATE is a lightweight desktop based on GNOME2 source code. It is completely open source and is a good option.

Install MATE with the following command:

Sudo tasksel install ubuntu-mate-core

Or

Sudo apt install ubuntu-mate-coreLubuntu / LXDE/LXQT

If your system resources are limited or your computer is old, then I recommend another lightweight Lubuntu. Install it using the following command:

Sudo tasksel install lubuntu-core

Or

Sudo apt install lubuntu-coreXubuntu / Xfce

Xubuntu is a derivative of Ubuntu based on Xfce, lightweight, simple, stable but highly customizable. If you want to use it, execute the following command:

Sudo tasksel install xubuntu-core

Or

Sudo apt install xubuntu-core

Just because there are some desktops that aren't listed, like KDE,Cinnamon and Budgie, doesn't mean they're bad, they're excellent, and you can try to install them yourself.

How do I remove GUI from a Ubuntu server?

If you feel that the desktop environment takes up too much computing resources, you can delete the previously installed package.

Note that deleting GUI may cause dependency problems in some cases, so back up important data or create a system snapshot.

How to delete a package from Ubuntu

Sudo apt remove ubuntu-desktopsudo apt remove lightdmsudo apt autoremovesudo service lightdm stop

Now restart your system. You should go back to the normal command line to log in.

Thank you for reading! This is the end of this article on "how to install a desktop environment on a Ubuntu server". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report