The Unnecessary GUI Overhead
Ubuntu is distributed in several flavors, but the standard Desktop edition uses GNOME as its default desktop environment. The login screen and session management are handled by gdm3 (GNOME Display Manager). When you boot a standard Ubuntu Desktop installation, gdm3 initializes the Xorg or Wayland graphical server and presents you with a visual login prompt.
However, many users install the Ubuntu Desktop edition on a machine (like an old laptop or a Raspberry Pi) and then later decide to use it purely as a headless server, hiding it in a closet and interacting with it exclusively via SSH. If you never connect a monitor to the machine, running gdm3 and loading the entire graphical stack into memory is a massive waste of RAM and CPU cycles. You can significantly improve server performance by disabling the display manager.
How to Disable the GDM3 Display Manager
You can tell systemd to boot directly to the multi-user command line interface, bypassing the graphical interface.
- Open your Ubuntu Terminal or connect via SSH.
- Change the default systemd boot target from
graphical.targettomulti-user.target:
sudo systemctl set-default multi-user.target
- On your next reboot, the system will start in text-only server mode without launching
gdm3. - If you want to stop the GUI immediately without rebooting, run:
sudo systemctl stop gdm3.service
Your Ubuntu machine will now function exactly like a standard Ubuntu Server installation, conserving valuable memory and CPU resources for your actual server applications (like Docker, Apache, or MySQL).