Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to disable X at boot time? I'm setting up a server so it would be nice if it wouldn't load the graphical interface every time I boot.

share|improve this question

This question has an open bounty worth +100 reputation from RolandiXor ending in 6 days.

The current answer(s) are out-of-date and require revision given recent changes.

With Ubuntu 15.04 on the horizon, we need an answer that covers systemd, if there are any changes. Also, the current answers could do with being clearly marked and cleaned up if necessary, if someone has the time to edit/flag.

On the GDM login screen of 11.04 and earlier, I think there was an xterm session option that would just give you a command line. Alternatively, you may be able to reach something from a recovery option in GRUB, though you probably wouldn't be able to set it as a default that way. –  Christopher Kyle Horton Nov 14 '11 at 7:31
you can also watch this post askubuntu.com/questions/2093/… –  hhlp Nov 14 '11 at 18:04
It is lightdm you want. It replaced gdm in 11.10. –  Elvis Stressborg Nov 15 '11 at 23:27
Thank you. So, how do I stop LightDM from loading on bootup? –  Jim Wilson Nov 16 '11 at 1:43

12 Answers 12

up vote 72 down vote accepted

Edit /etc/default/grub with your favorite editor, eg: nano:

sudo nano /etc/default/grub

Find out this line:


Change it to:


Update Grub:

sudo update-grub

For systems that use systemd
This is an additional step for systemd releases, eg: Ubuntu 15.04, the steps above for grub are still necessary.

You need to tell systemd to not load the graphical login manager:

sudo systemctl enable multi-user.target --force

You will still be able to use X by typing startx after you logged in.

share|improve this answer
What's the benefit of this option instead of just inhibiting lightdm cf. askubuntu.com/a/79698/68124 ? –  Stéphane Gourichon Jan 23 '14 at 20:12
That works for lightdm, this works for any graphical login manager? This is the proper way of loading a Linux system without loading a X server? Just seems more logical? Choose one... :) –  Bruno Pereira Jan 23 '14 at 22:21
Any graphical login manager ? This solution instead is tied to grub which it is not used (or even available) on new mobile platforms where Ubuntu runs, while disabling the service is bootloader-independent. Proper way ? No fact mentioned. More logical ? Inhibiting a particular service is not a logically a boot-time parameter. But you're still right somehow due to another fact: your solution not only inhibits lightdm but also plymouth (at initrd step and others), so its semantics is not "disable X" but "disable any graphical setup" and that needs to fiddle bootloader configuration. Thanks ! –  Stéphane Gourichon Jan 24 '14 at 8:45
Since the question is made for Ubuntu and not the mobile platform (can you even change anything in the mobile version of Ubuntu? Why would that be a good thing? I am guessing you would be locked to a prompt that knows nothing about keyboard input and accepts fancy finger touches and gestures :P) I am assuming we are talking about Ubuntu, the desktop Linux based operative system that I love and can modify to my needs. :) But you are right, there is a semantics issue with the title of the post, feel free to edit it to something more proper! Thanks for the comments. –  Bruno Pereira Jan 24 '14 at 10:36
Don't assume non-PC platforms are mobile phones or tablet only, poking fun at anyone showing that there's something outside Plato's cave. All those anyway start as development boards without screen, keyboard or mouse but rather a serial port as first communication channel, and keyboard support (e.g. via USB, or even USB OTG for the final product) is likely to be available before touchscreen. wiki.ubuntu.com/ARM –  Stéphane Gourichon Jan 25 '14 at 16:57

Installing the GUI will probably cause it to start automatically, but it's very easy to boot to text mode in Ubuntu. Just open /etc/default/grub as root and add text to the


line. Then run:

sudo update-grub

Your system will then always boot to text mode.

If you want to boot to the GUI, just press e in the boot menu and remove text from the kernel line.

If you want to start the GUI after boot, just run:

sudo /etc/init.d/lightdm start

Hope this helps :)

share|improve this answer
ubuntu 11.10 doesn't use gdm as defult login manager –  hhlp Nov 14 '11 at 15:44
also watch this -> askubuntu.com/questions/70188/how-do-i-boot-into-console-mode –  hhlp Nov 14 '11 at 15:46
@hhlp: Fixed. With the latest Lightdm update, the upstart job respects the text kernel cmdline. –  Xiao-Long Chen Nov 14 '11 at 17:13
Is this valid for 12.04 ? –  AsheeshR Feb 27 '13 at 12:42
@AshRj: Yes, it's valid for all versions of Ubuntu using upstart :) –  Xiao-Long Chen Feb 27 '13 at 18:42

For 11.04 and previous versions (and perhaps later)

If you want to boot into text mode:

Edit /etc/default/grub. For example:

sudo gedit /etc/default/grub

Find this line:


Add text:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

Then update Grub:

sudo update-grub

Note: Removing quiet splash (i.e. GRUB_CMDLINE_LINUX_DEFAULT="") will show text during boot but then show a graphical login screen as usual. Replacing quiet splash with text will leave you at a login prompt; to start a GNOME session, use sudo /etc/init.d/gdm start or startx.

To disable GDM:
Install bum Install bum

After installation it will be found under System>>Administration>>Bootup-Manager

Uncheck Gnome Display Manager alt text

share|improve this answer
The GRUB config worked. Out of curiosity, why would I want to disable GDM? –  Olivier Lalonde Dec 6 '10 at 3:22
because doing so would accomplish the same thing. –  RolandiXor Dec 6 '10 at 3:27
Confirmed in 13.04 that GRUB_CMDLINE_LINUX_DEFAULT="" works to show details during boot while still launching graphical login. –  Jesse Glick May 20 '13 at 13:46

If you are using lightdm as a login manager it can be prevented from loading by disabling it.

You can use an override:

sudo bash -c 'echo "manual" >> /etc/init/lightdm.override'

And to start lightdm on command:

sudo start lightdm

To restore your system so that lightdm is always started on boot:

sudo rm /etc/init/lightdm.override

For more information, the upstart cookbook is your friend:

share|improve this answer

You could use Ubuntu Server edition.

share|improve this answer
+1 for the straight solution. –  Anwar Shah Sep 26 '12 at 16:12

It has already beed answered in several old questions, but cannot find them just now, so I sum up the various situations here.

  1. To stop an X server started by startx, simply terminate the session.

  2. To stop an X server started by the Login Manager (GDM), run

    sudo service gdm stop

    then move to a tty, for example pressing Ctrl-Alt-F1, then login here in text mode.

  3. To avoid at all the starting of the Login Manager (and X), modify


    changing the line


    to become

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

    then update the grub configuration file with

    sudo update-grub

    so that the next time you go directly to text mode, and you need startx to initiate a X session, or alternatively sudo service gdm start.

share|improve this answer

I did following

Step 1 First update your repository by running

sudo apt-get update

Step 2 There is some bug in old version of lightdm, so we need to upgrade the same. To do so run,

sudo apt-get install lightdm

Step 3 Now we have to modify grub config. Step 3a Open /etc/default/grub with your faviourite editor and change




Step 3b Also comment GRUB_HIDDEN_TIMEOUT=0 This line is for unhiding the GRUB menu

Step 4 Now we will upgrade GRUB configuration

sudo update-grub

Step 5 Ubuntu 11.10 Desktop edition use lightdm for GUI. We need to disable the same

sudo update-rc.d -f lightdm remove

Step 6 Now restart your machine.

Found at Disable GUI Boot in Ubuntu 11.10

share|improve this answer

When you install Ubuntu-desktop, it will automatically set lightdm to start with the system. You will have to disable this (probably by editing /etc/rc.local) and use startx to run the graphical interface when you need it.

share|improve this answer

I did following

Step 1 First update your repository by running

sudo apt-get update

Step 2 There is some bug in old version of lightdm, so we need to upgrade the same. To do so run,

sudo apt-get install lightdm

Step 3 Now we have to modify grub config.

Step 3a Open /etc/default/grub with your faviourite editor and change




Step 3b Also comment GRUB_HIDDEN_TIMEOUT=0 This line is for unhiding the GRUB menu

Step 4 Now we will upgrade GRUB configuration

sudo update-grub

Step 5 Now restart your machine.

share|improve this answer
According to lightdm.conf it is not necessary to remove lightdm. –  Bruno Pereira Jan 12 '12 at 20:18
if you did not remove it you will get GUI after doing all this. –  Vidyadhar Jan 14 '12 at 7:59
Sorry, just tested it in 11.10, this is not true, no need to remove lighdm, step 5 is not necessary. –  Bruno Pereira Jan 14 '12 at 8:56
Ok I have removed the 5th step regarding lightdm –  Vidyadhar Jan 15 '12 at 8:14

I noticed this thread revolves around assuming you are using LightDM as the Display Manager. Though this may be the usual DM/welcomer, that isn't part of the original question. (And he did not specify..)

In my case:

I use KDE/KDM on my server. Instead, I simply disable the upstart/service from starting under runlevel 2:

/etc/init/kdm.conf: (kdm: 4:4.8.5-0ubuntu0.3 , Upstart Version: 1.5-0ubuntu7.2)


start on ((filesystem


           and runlevel [!06]


           and runlevel [!026]

Assuming your default runlevel is 2 on fresh reboot, you will have a console and not KDM. Then you can run DM/DE manually when needed = Use 'startx' /etc. To return machine to console and exit X server completely after this, just use 'log out'.

Other dm .confs scripts are similar. (I setup my server like this.. to be able to work using a GUI occasionally - but, not pull resources when not using/needed or simply rebooting.)

share|improve this answer

The steps are:

Customize the grub 2 configuration:

  • sudo nano /etc/default/grub, to open the file with root privilege,

Find the line


and change it to


Save the changes (hit ctrl + o followed by ENTER) and close the file (ctrl + x).

To apply the new configuration do this

  • sudo update-grub

Now restart your PC

  • sudo reboot

There you are... A text-graphic login screen... Supply your credentials to log-in to the tty (default tty1). You can change the tty's with crtl + alt + [F1 to F6] for tty1 to tty6. You may also start the X session (X11 session), the graphical user interface, with sudo start lightdm (ctrl + alt + F7).

PS: In case you want to revert the changes you've made here follow the link:

How to revert back to GUI as the default interface from CLI in Ubuntu desktop?

share|improve this answer

I think it's possible. I've not tried on Ubuntu but on Arch Linux or Gentoo works.

Not letting LightDM or GDM/KDM starting right after booting will help. You'll start with a command line login screen.

share|improve this answer
This answer would be much improved by explaining how to achieve "not letting LightDM or GDM/KDM start" when the system starts up. For example, do you recommend accomplishing this by renaming startup scripts? (If so, you could explain exactly how to do that.) I recommend editing this question to expand it in this way. –  Eliah Kagan Jul 19 '12 at 5:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.