How to Completely Disable ‘GDM3’ (GNOME Display Manager) in Ubuntu Server

In Ubuntu environments, GDM3 (GNOME Display Manager) is the default graphical login manager that presents the graphical user interface (GUI) upon boot. While essential for desktop computing, running a display manager on a dedicated Ubuntu Server consumes valuable system resources (RAM and CPU cycles) that should ideally be allocated to primary server workloads, such as database management or web hosting.

This guide explains how to completely disable GDM3 and the graphical desktop environment on an Ubuntu Server, forcing the system to boot directly into a lightweight, headless command-line interface (CLI).

Disable the Graphical Target via systemd

Modern Ubuntu distributions utilise systemd as the init system. You can easily instruct systemd to bypass the graphical target during the boot sequence and default to the multi-user terminal target.

  1. Open your terminal or connect to your Ubuntu Server via SSH.
  2. Execute the following command to change the default boot target to the multi-user (command-line) target:
    sudo systemctl set-default multi-user.target
  3. To verify that the change has been applied successfully, run:
    systemctl get-default
    The output must explicitly state multi-user.target.
  4. Reboot your server to initiate the headless environment:
    sudo reboot

Upon reboot, the server will no longer load GDM3 or the GNOME desktop, presenting you only with a standard TTY login prompt.

Completely Remove GDM3 and the GNOME Desktop (Optional)

If you wish to reclaim the disk space occupied by the graphical environment and ensure that GDM3 cannot be accidentally restarted, you can purge the packages from your system entirely.

  1. Log into your server’s command-line interface.
  2. Run the following command to remove the Ubuntu desktop meta-package and the display manager:
    sudo apt-get remove --purge ubuntu-desktop gdm3
  3. After the removal process completes, execute the autoremove command to clean up orphaned dependencies and libraries associated with the GUI:
    sudo apt-get autoremove --purge
  4. Finally, clear the local repository of retrieved package files:
    sudo apt-get clean

By actively changing the systemd target and aggressively purging the desktop packages, you transform your Ubuntu installation into a highly optimized, resource-efficient headless server.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.