To run your Raspberry Pi without the GUI and use only the command line, follow these steps:
Temporarily Disable GUI
- Open a Terminal (if you have access to the GUI).
- Enter the following command to stop the GUI temporarily:
sudo systemctl stop lightdm
Replace lightdm
with the display manager your system uses (e.g., gdm
, sddm
, etc.).
- When you’re done and want to restart the GUI, you can run:
sudo systemctl start lightdm
Disable GUI on Boot
If you want to disable the GUI permanently and boot straight into the command line:
- Open a Terminal.
- Run the following command to edit the configuration file:
sudo nano /etc/default/grub
- Find the line starting with
GRUB_CMDLINE_LINUX_DEFAULT
and modify it to:
GRUB_CMDLINE_LINUX_DEFAULT="text"
- Save the file and exit (
Ctrl+X
, thenY
, thenEnter
). - Update GRUB with:
sudo update-grub
- Finally, reboot your Raspberry Pi:
sudo reboot
With these steps, your Raspberry Pi will boot into command line mode by default, saving on power consumption. If you ever need to use the GUI, you can manually start it with the command startx
or re-enable it for future boots.