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.
- graphical.target: The default setting that loads the display manager, desktop environment, and graphical login screen.
- multi-user.target: A non-graphical, multi-user system configuration that boots directly into a command-line interface.
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-defaultIf 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.targetYou 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 rebootUpon 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 gdm3Note: If you are using a flavor of Ubuntu other than the standard GNOME desktop, replace
gdm3with your specific display manager, such assddmfor Kubuntu orlightdmfor 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.targetOnce the command processes, reboot your machine to return to the standard Ubuntu graphical login screen.