By default, public Linux images provided by Alibaba Cloud do not include a desktop environment to ensure optimal server performance and stability. Installing a graphical user interface (GUI) can significantly improve user experience and operational efficiency.
Applicability and risks
Before you begin, read and acknowledge the following key limitations and risks.
-
Operating system compatibility: Alibaba Cloud Linux does not support GUI installation.
-
Remote connection tool limitations: After a GUI is installed, VNC connections default to the graphical interface. Connections using Workbench and Session Manager are not affected.
-
Performance impact: A GUI continuously consumes significant CPU and memory resources, typically requiring at least an additional 1 to 2 GiB of memory. This can lead to slower responses on low-specification instances. We recommend installing a GUI only for specific, necessary use cases, such as automated testing or graphics rendering. For routine server management, use command-line tools.
Quick selection
Choosing a lightweight desktop environment reduces resource consumption.
|
Desktop environment (DE) |
Resource usage (Memory) |
Minimum specifications |
|
Low (approx. 500–800 MB) |
2 vCPU, 2 GiB |
|
|
Medium (approx. 800 MB–1.2 GiB) |
2 vCPU, 4 GiB |
|
|
High (approx. 1.5 GiB+) |
4 vCPU, 8 GiB |
Procedure
Before installation, we recommend creating a manual snapshot of your ECS instance. This allows for quick data recovery if an issue occurs.
Install XFCE on Ubuntu 18/20/22/24
-
Update the package list and upgrade installed packages.
sudo apt update && sudo apt upgrade -y -
Install the XFCE desktop environment.
sudo apt install -y xfce4 xfce4-goodies lightdm lightdm-gtk-greeterLightDM is a lightweight display manager that loads the login window, authenticates the user, and starts the desktop session at boot.
-
Restart the ECS instance.
sudo reboot -
Connect and verify.
Wait for the system to restart. The graphical interface appears, confirming a successful installation.
By default, Ubuntu does not allow the root user to log in to a graphical session. Create a standard user for desktop sessions and grant sudo privileges as needed to avoid operating the desktop directly as root.
Install GNOME on Anolis 8/CentOS Stream
-
Update packages.
sudo dnf update -y -
Install the GNOME desktop environment.
sudo dnf groupinstall "Server with GUI" -y"Server with GUI" is a package group that includes GNOME and common utilities.
-
Set the system to boot into the graphical target by default.
sudo systemctl set-default graphical.target -
Restart the instance to apply the changes.
sudo rebootAfter the instance restarts, log in over VNC from the ECS console to see the GNOME login screen. Enter the instance's username and password to access the desktop.
Install MATE on CentOS 7/8
CentOS 7 and 8 have reached their End of Life (EOL). Official software repositories are no longer available. Continuing to use these versions poses security risks and may cause installation failures.
-
Upgrade all packages.
sudo yum -y upgrade -
Install the MATE desktop environment.
sudo yum groups install "X Window System" sudo yum groups install "MATE Desktop" -
Set the instance to boot into the graphical desktop environment by default.
sudo systemctl set-default graphical.target -
Restart the ECS instance.
sudo reboot
Production best practices
When using a GUI in a production environment, follow these best practices.
-
Resource planning: Reserve sufficient CPU and memory for your selected desktop environment to ensure a successful installation and smooth operation. Continuously monitor resource usage by viewing instance monitoring data and upgrade the instance specifications if necessary.
-
Security hardening:
-
Principle of least privilege: Create a non-root standard user dedicated to GUI login. Avoid using the root account for desktop sessions.
-
System updates: Regularly run
sudo dnf updateorsudo apt upgradeto promptly patch security vulnerabilities in the desktop environment and underlying system.
-