I believe OS GUI takes some machine resources and is not really needed for a web server.
What OS do people install to make a Linux-based web server without GUI?

12 Answers 12


We've been using CentOS for our SaaS app for a long time. Just configure the install to not include any GUI (X)

You can fully automate the install starting from a simple kickstart approach, to a full PXE setup.

BTW, the advantage of CentOS, is that it will be supported for a longer time than other distros. I think 7 years at the moment.

  • I agree. Either in kickstart or on the boot line "linux text" is how I install my stuff – Matt Simmons Mar 3 '10 at 2:34

Personally I like Debian the most for servers. The installer gives you the option to install a desktop environment, print server, file server, base system.

For your case you would just select install base system. In that case the installer will just install the base packages to get your server up and running. From that moment you have a rock-solid and very lightweight server and it's trivial to install other packages that you may need via apt-get or aptitude

  • 1
    The Debian Stable base install makes for a very nice small installation, and it's easy to add anything missing using aptitude. – Paul Tomblin Oct 28 '08 at 14:56

Most linux distros can be installed without a GUI. Personally I would recommend Debian for servers, but you'll probably also hear from the Gentoo, Linux from scratch, and Red Hat crowd. Pretty much any distro could handle a web server pretty easily.

  • From what I've seen, Ubuntu Server, Debian, Gentoo, RedHat, CentOS, and one or two that I'm missing are the popular server distros. – Thomas Owens Oct 28 '08 at 14:47
  • @Thomas: Pretty much the same here, although I haven't encountered any Ubuntu servers just yet. – tloach Oct 28 '08 at 14:50
  • My hosts use Debian as well :) Although I have also used CentOS in the past – Phill Sacre Oct 28 '08 at 15:05
  • I personally use two Ubuntu servers because they were fairly idiot-proof to install/maintain. One is my public website, the other my Subversion repository and test deployment box. Any of the distros listed can do the job. – Ken Gentle Oct 28 '08 at 15:07

Ubuntu server is fairly common I think.

  • It is also a good choice for the inexperienced, as it is quite user-friendly and there is tons of online help. – Liam Oct 28 '08 at 14:59
  • 1
    Ubuntu has a great community, most of their support is applicable to Debian also, so either one would be good. – jsl4980 Oct 28 '08 at 15:13
  • Yeah. I'm just learning linux and I picked Ubuntu Server. It's worked well for me so far and it's ubiquitous enough that it's easy to find help. – Daniel B. Jul 24 '11 at 0:42

The distributions I most often encounter are:

  • Debian
  • Ubuntu Server
  • CentOS

And Fedora.

All of them come with a CLI only setup for server use AFAIK.


Ubuntu server only has CLI.

Most other distributions offer a server or headless install.

  • Jack-O-Lanterns may be attached at a later date. – Daniel B. Jul 24 '11 at 0:43

I think most Linux servers operate in runlevel 3, which doesn't run a GUI. As part of the install process, just don't install X and you should be all set. I'm not sure what will happen if you try to switch to runlevel 5 (normal windowing system on most systems) on a system that doesn't have a GUI... it may just act like runlevel 3.

I've used SuSE, RedHat, Fedora, CentOS, and Ubuntu for servers. The ones that I set up, I just let have the GUI (in runlevel 5)... it comes in handy when you need to remote in, and with no one logged in the overhead is negligible. The ones that I didn't set up myself I think normally ran in runlevel 3, but I don't know if they had a GUI installed. I prefer the Fedora/CentoOS/RedHat family for any system just because of the massive number of well-maintained packages available for install.

  • 2
    "Run level 5 = GUI, run level 3 = no GUI" is a Red Hat-ism. Run levels 0 (shutdown), 1 (single-user mode), and 6 (reboot) are the only ones with universal meaning. Run levels 2-5 can be arranged however the distro/sysadmin likes - in Debian, they are all identical by default. – Dave Sherohman Oct 28 '08 at 16:48
  • Note this is only true for init based linux. Ubuntu uses a different mechanism (upstart) and always runs at run level=3 – Martin Beckett Oct 28 '08 at 22:51
  • @mgb that's wrong on two counts. Ubuntu like Debian runs by default at level 2 regardless of if you have X installed or not. If you don't believe me open up a terminal and type runlevel to display the current init runlevel. By default it will start gdm if present in level 2. Which you can see in /etc/rc2.d. Also upstart emulates sysv init so things should work pretty similar on a Linux distro that uses upstart vs the standard init system. – 3dinfluence Mar 3 '10 at 3:25
  • @mgb I stand corrected about the gdm being in /etc/rc2.d/. It's a symlink in /etc/init.d/ which a directory with all the tasks that upstart runs. But runlevel 2 is the default runlevel in Ubuntu not 3. – 3dinfluence Mar 3 '10 at 3:41
  • ok - but the point stands - you can't just switch to runlevel 2 and disable the gui. – Martin Beckett Mar 8 '10 at 17:20

I don't think Ubunutu Server Edition has a GUI, and in some distros, you can choose what GUI (or lack of GUI) you want.


You might want to check out the Ubuntu Server Edition "JeOS" (Just Enough Operating System). It is a stripped down version of Ubuntu and targeted at virtual appliances, but we've used it for some of our VM servers. The URL is http://www.ubuntu.com/products/whatisubuntu/serveredition/jeos.


Note that even if the GUI (that is, the X Window System) is installed, you don't have to start it. So you can configure normal startup to not start X, and still have the capability of running a GUI should you want to. The only resource this takes is some disk space.

Note also, that the way X works, it may be very useful to have the X client applications on your web server host, allowing them to use the local X Server on your desktop. (Yes, I know the terminology is confusing, but it's consistent).

  • Why it might be useful? – z-boss Mar 4 '10 at 13:16
  • Because if you are working from a desktop with an X Server, you can run the GUI tools on the web server host and have their display (and keyboard and pointer) on the desktop. That works even if the web server host has no graphics capability at all. – mpez0 Mar 5 '10 at 0:17

Hmm. Just uncheck GNOME and KDE while installing any linux OS on DESKTOP or SERVER, so that it will install only CLI and only Command Prompt will be available once the installation is finished. No need to change run levels also.


sudo apt-get remove gnome; sudo apt-get remove gdm; sudo apt-get remove kde; sudo apt-get remove kdm; sudo apt-get remove xfce; sudo apt-get remove xdm;

This should work for Ubuntu. Do it by entering CTRL+ALT+F1, log into root, and type the commands above depending on the DE.

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