Kali Linux without gui

Although Kali Linux downloads come with a GUI installed by default, a desktop environment is only a supplemental component of a Linux system, and is not essential. Many Linux administrators prefer to interact with the command line terminal instead of a GUI, and may even come to find the GUI as an unnecessary hindrance that they would rather do without. Like any other Linux system, it is possible to use Kali Linux without a GUI.

In this tutorial, we will show you how to use Kali Linux without a GUI. We can do this by simply disabling the desktop environment from running upon system boot. Optionally, we can also remove the GUI completely, which will save some disk space and make future package updates a bit more streamlined. It is up to you whether you want to choose the option to load into the GUI in the future or not.

Keep in mind that some Kali Linux packages may be optimized to work with a GUI or may even require it. Since Kali includes a plethora of cybersecurity tools by default, at least a handful of them are intended to work with GUI. It is a good idea to make sure that the tools you plan to use can all be managed from command line. You will also be missing the ability to do other simple things like open a web browser or watch a video.

In this tutorial you will learn:

  • How to disable the GUI on Kali Linux
  • How to uninstall the GUI from Kali Linux
Kali Linux without gui
Kali Linux without gui
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Kali Linux
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Disable GUI on Kali Linux

The step by step instructions below will show you how to disable the GUI on Kali, uninstall the desktop environment, and re-enable the GUI in case you decide to use it again.

  1. The following Linux command will disable GUI on boot hence upon the reboot the system will boot into multi user target:
    $ sudo systemctl set-default multi-user
  2. To re-enable the GUI to start automatically upon system boot, change the systemd target to graphical:
    $ sudo systemctl set-default graphical
  3. Assuming that you are using the default Xfce desktop environment on Kali, and do not plan to use it again in the future, we can remove it completely from the system with the following command:
    $ sudo apt purge --autoremove xfce4* kali-desktop-xfce libxfce4*

Closing Thoughts

In this tutorial, we saw how to use Kali Linux without a GUI. We learned how to disable the GUI or to uninstall it completely. It is standard practice for seasoned system administrators (Kali’s target audience) to use Linux as command line only, so the process is relatively simple and can be reversed easily in case the user needs to use a GUI penetration tool or for another reason.