How to Disable Graphical Login in Ubuntu

This article provides a straightforward, step-by-step guide on how to disable the graphical login screen (GDM, LightDM, or SDDM) in Ubuntu and boot directly into the text-based command-line interface (CLI). It covers the standard method using systemd, how to reverse the process, and how to access the GUI on demand after a text boot.

Understanding the Ubuntu Boot Targets

Ubuntu uses systemd to manage its system services and boot processes. The environment you see upon booting is determined by “targets,” which are similar to the old Linux runlevels.

By changing the default boot target, you can permanently stop the GUI from loading at startup without uninstalling your desktop environment.

Steps to Boot Ubuntu into Text Mode

To change your default boot environment, you will need to use the terminal. If you are currently in the graphical interface, open a terminal window by pressing Ctrl + Alt + T.

Step 1: Check the Current Default Target

Before making any changes, verify your current configuration by running the following command:

systemctl get-default

If your system currently boots to the desktop, the output will display graphical.target.

Step 2: Set the Default Target to Text Mode

To configure Ubuntu to boot into the CLI by default, change the system target to multi-user.target using this command:

sudo systemctl set-default multi-user.target

You will be prompted to enter your administrator password to confirm the change.

Step 3: Reboot the System

Apply the changes by restarting your computer:

sudo reboot

Upon restarting, Ubuntu will bypass the graphical welcome screen and present you with a text-based login prompt asking for your username and password.

How to Start the GUI Manually from Text Mode

If you are booted into text mode but temporarily need to access your graphical desktop, you can start your display manager manually without changing your permanent boot settings.

Run the following command to launch your desktop interface:

sudo systemctl start gdm3

Note: If you are using a flavor of Ubuntu other than the standard GNOME desktop, replace gdm3 with your specific display manager, such as sddm for Kubuntu or lightdm for Xubuntu.

How to Re-enable the Graphical Login Screen

If you decide you want to revert your system back to booting directly into the graphical desktop, you can restore the original systemd target at any time.

Open your terminal in text mode or on your desktop and execute:

sudo systemctl set-default graphical.target

Once the command processes, reboot your machine to return to the standard Ubuntu graphical login screen.