I'm currently setting up a home server using a very, very old PC. It has Ubuntu 11.10 installed on it, but it can't actually handle the GUI. I want to install the server edition of Ubuntu, which is command line only, but have no idea how to do so. What can I do?

5 Answers 5


Actually, if you just have problem with running the GUI there's no need to install another distribution, simply modify the startup sequence to prevent the graphical interface from coming up and work from the command line as you desire.

I don't have access to a system right now, but I believe the script you'll need will be found in the /etc/init.d or /boot/grub directory. Perhaps someone here can give you the name of the script before I get home to check.

I just found this: Starting Ubuntu without the GUI

I see three ways to do it:

  1. Changing the default runlevel

    You can set it at the beginnign of /etc/init/rc-sysinit.conf replace 2 by 3 and reboot. You can enable the graphical interface with telinit 2.(More about runlevels)

  2. Do not launch the graphical interface service on boot

    update-rc.d -f xdm remove

    Quick and easy. You can re-enable the graphical interface with service xdm start or revert your changes with update-rc.d -f xdm defaults

  3. Remove packages

    apt-get remove --purge x11-common && apt-get autoremove

    I think it suits best for a computer considered as a server. You can re-enable the graphical interface by reinstalling the packages

There's also this: Possible to install ubuntu-desktop and then boot to no GUI

The point being, you can prevent the GUI from coming up if that's your main issue.

  • I tried the second method, to no effect. After trying the third method, I get nothing. No root prompt, no command line, not even a blinking cursor. Luckily, there's no actual data on this computer (yet), besides the OS. What can I do next?
    – Jules
    Jun 2, 2012 at 19:18
  • @Verandaguy Oh, sorry to hear this. It's hard to say w/o detailed knowledge of your system what to do next. Changing the startup/boot sequence is not for the faint of heart, but I am relieved to hear that the system only contains the OS. so the worst case is somewhat limited (still a hassle I realize). I still think you should be able to recover from this with the help of the live CD which should let you boot into the system. From there you could undo the changes you made (or assuming you made copies of the files before you modified them, copy them back).
    – Levon
    Jun 2, 2012 at 22:13
  • Alright, I have no idea what I did, but I rebooted, and it naturally booted into server 12.04. Strangely enough, I didn't see any install/try screens (the server CD is in the drive, but not installed), and since it's 12.04, it has to be server, rather than a GUI-less desktop edition. Thanks anyway, it seems my computer boots into server through restarts, and without the CD. I'm not complaining.
    – Jules
    Jun 3, 2012 at 1:46
  • @Verandaguy happy to have, what appears, a happy ending. Sorry for the scare (I'm sure - I'd have been worried too)
    – Levon
    Jun 3, 2012 at 1:47
  • Not much of a scare, to be honest. Like I mentioned, it's basically an empty computer, apart from Ubuntu itself.
    – Jules
    Jun 3, 2012 at 2:18

I think that an easy way is with tasksel via command line.
Open a terminal and digit:

$ sudo apt-get install tasksel


$ sudo tasksel

It will show a simple gui-cli that lets you to choose what you want by a simple check/uncheck (for eg. uncheck "Ubuntu desktop" and also check "Basic Ubuntu server" and "LAMP server".
That's it

  • Is "Basic Ubuntu Server" an option within tasksel? And why would OP want to install the LAMP stack?
    – jasonwryan
    Feb 23, 2014 at 5:21
  • Yes, see this other question. However, Basic Ubuntu Server do not contains LAMP (Linux Apache MySql PHP) packages. For any kind information, see the official documentation Feb 25, 2014 at 4:47

There's no difference between a server and desktop distribution , just involving different packages.

The two things you should do was:

  1. Replace default generic kernel with server kernel , by: apt-get install -y linux-image-server

  2. Disable or remove all graphical software , xorg-server.

    To disable them , disable lightdm for auto start , edit /etc/init/lightdm.conf , comment all these lines (place a '#' in front of each line)

start on ((filesystem
           and runlevel [!06]
           and started dbus
           and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
                or stopped udev-fallback-graphics))
          or runlevel PREVLEVEL=S)

If you uninstall the desktop packages and install the server packages through tasksel, you should be prepared to do a LOT of reconfiguration, as this will remove your network settings, wireless card drivers, etc.

If all you need to do is get rid of the gui, follow steps 1-2 from the first answer. It's up to you whether or not to purge the GUI completely.

I also replaced the generic kernel with the server kernel as noted in the answer @warl0ck and commented out the lines in the lightdm.conf file.

After this, rather than tasksel to add/remove packages, I manually removed packages from the command line. Unless you're going to use the LibreOffice suite, Firefox, etc., you can remove all these packages. The easiest way to get a list of packages is to run:

sudo dpkg --get-selections | grep -v deinstall > ~/packages
nano ~/packages

This will output a list of all installed packages to your home folder and open it.

When you uninstall a core package (such as libreoffice-common), it should automatically remove dependent packages.

To uninstall, type

sudo apt-get remove package-name

Once all the uninstalls are done, run the following command to autoremove package listings and dependencies no longer used.

sudo apt-get autoremove

This worked for me turning my desktop installation into a "server."

If the GUI would be useful, you might look into installing xubuntu instead, as it's a much lighter distribution. I didn't particularly care for it, but it's definitely more lightweight.


Disable the GUI from Ubuntu System.

Here I am going to show, how to disable GUI without removing package of lightdm, gdm, compiz unity. You can start it manually.

Please follow the below steps.

Step 1-: Open the "grub" file.

$ sudo nano /etc/default/grub

Step 2-: Replace the line with "text" like below.

Default line


Replace with-:


Step 3-: Update the grub file using below command-:

$ sudo update-grub

Step 4-: Restart the system.

 $ sudo init 6

Addition Step to start GUI session.

$ sudo service lightdm restart

Disable GUI from Ubuntu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .