Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shared hosting. I have access to shell. OS is Ubuntu, and I want to check if it is server version or desktop version.

When I login through shell, it shows following information:

Linux [server-name] 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU/Linux
Ubuntu 10.04.1 LTS
share|improve this question
up vote 13 down vote accepted

This answer isn't as cut and dry as some people are making out. You can do a ubuntu-standard package install and use that as a server. You can use ubuntu-minimal as a server. You can take ubuntu-desktop and break it so it doesn't use X... Or even leave X there for administration (eww). You can change the kernel packages from -server to -generic to -rt etc. You can change the motd or even just upgrade from a version where the motd isn't as long as the new one (none of my servers have ever come out with all that guff -- probably because they're upgraded from older LTSes).

I guess the questions that all of us should be asking are: Why does it matter? What are you trying to learn? What difference does it make to you?

If you're trying to run something graphical, check for what you actually need (X, x11vnc, etc). If you're trying to check that there isn't a graphical interface, do the same!

share|improve this answer
+1. Why it matters? Well, consider ksplice. Desktop is free, server is not ... ;) – 0xC0000022L Mar 8 '11 at 23:38
Well, that's a more specific question: what does ksplice check to decide whether you can use the free desktop version. I would guess they check for the desktop vs server kernel build. – poolie Apr 29 '11 at 5:41
dpkg -l ubuntu-desktop 

will tell you if the desktop components are installed.

uname -a

will tell you whether the server or generic kernel is being used.

"Desktop or server" is not a binary thing - it's possible to have some desktop components installed on a machine originally installed as a server, etc.

share|improve this answer
dpkg -i ubuntu-desktop doesn't do what you describe for me. – 8128 Nov 10 '10 at 20:57
Sorry, I meant dpkg -l. (Updated.) – poolie Nov 10 '10 at 21:01
It's possible to have a perfectly working desktop without the ubuntu-desktop package. That's just a metapackage to ensure a certain standard set of supporting applications such as control panels, Debian-specific things etc are installed along with your desktop. If you remove any of these then ubuntu-desktop will effectively be "removed" too but you'll still have a desktop. It'd be much better to check for the xserver-xorg-core package instead. Although, the existence of that package doesn't guarantee it's being used, there's no good reason to have it installed on a non-desktop machine. – thomasrutter Apr 23 '12 at 6:27
Yes, the fact that there is no sharp line between desktop and server has been extensively discussed by most answers, including mine. But ubuntu-desktop is a reasonable test for whether you have Ubuntu desktop. If you install from the desktop CD/ISO, you will have this package. – poolie Aug 5 '13 at 2:42

it can be checked by typing cat /etc/motd. The output will be defferent on server and different on desktop edition.


Ubuntu 10.10

Welcome to Ubuntu!
 * Documentation:


Ubuntu 10.10

Welcome to Ubuntu!
 * Documentation:

  System information as of Wed Nov 10 20:54:11 UTC 2010

  System load:  0.07               Processes:           78
  Usage of /:   30.4% of 14.76GB   Users logged in:     1
  Memory usage: 38%                IP address for eth0: XXXXXXXX
  Swap usage:   0%

  Graph this data and manage this system at
At the moment, only the core of the system is installed. To tune the 
system to your needs, you can choose to install one or more          
predefined collections of software by running the following          

   sudo tasksel --section server  

It is also worth mentioning that this file is easily editable by sudo, which is done very often, because it's the message that user sees when he logs via ssh.

share|improve this answer
This is mostly telling you whether landscape-client is installed. That may happen to be true on servers, but it's not really essentially connected to whether you're using the server OS or not. – poolie Nov 11 '10 at 1:04

There is no clearly defined, simply worded answer for this question.

It is possible to load the desktop features to server, and to remove them from desktop. The root issue is what packages are part of server functionality, and will get the additional period of support and updates.

The best answer (IMHO) can be found in a Launchpad question (from 2008):

what's the difference between server and desktop edition?

share|improve this answer

You must remember that there is no fundamental difference between the Desktop and Server editions.

It is highly likely however that your hosting provider has not got all the graphical pieces, such as GNOME on the top of the stack, because there is no need of them. The installed packages is what makes it a server.

You might be interested in ubuntu-maintenance-check script (link) that tells you the maintenance cycle of each package installed - those that have a longer period are server packages.

share|improve this answer
Apparently from 12.04 onwards all supported packages get the same support lifetime without discriminating between server vs desktop. – poolie Aug 5 '13 at 2:49

This may not be the fastest or purest way to tell, but run:

dpkg --get-selections | grep linux-image | grep -v deinstall

If the currently installed linux-image package contains the word "server" in it, then you're running Ubuntu server.

For example, the current latest kernel package for Ubuntu 10.10 desktop:


And server:


For a more generic package that should be the same across different versions of Ubuntu, linux-image-generic is the default package for Ubuntu desktop and linux-image-server is the default for the server edition.

share|improve this answer
it says generic. thanks – cmnajs Nov 10 '10 at 20:56
You can run the server kernel on a desktop install just as you can run the desktop kernel on a server. This is not a definitive answer by any stretch. – Oli Nov 10 '10 at 22:18
@Oli: as you already pointed out, there seems not to be a definite answer ;) – 0xC0000022L Mar 8 '11 at 23:39

I am running discovery on a large network and I'm trying to distinguish from LINUX installed as a workstation versus a server (because we'll treat them differently).

I was hoping for the an attribute or file that had Ubuntu-Server instead of Ubuntu.

I do find some interesting files in /var/log/installer:

media-info says "Ubuntu-Server" for the server and just "Ubuntu" for desktop. syslog shows the same information for the "cdrom"

Both of these are helpful and I can use them in conjunction with hardware information. This should tell you at least what version was installed originally.

share|improve this answer

None of the above solutions worked very well for me. Sometimes a system doesn't have a motd, or maybe the admin changed it, etc. I'm not even sure why the answer given above was the "correct" answer. Here's what I ended up using.

__check_desktop() {
  if [ `(dpkg-query -W -f='${Status}' ubuntu-desktop 2>/dev/null | grep -c "ok installed")` -eq 1 ]; then
    err "Ubuntu Server is required, but it appears that you are running Ubuntu Desktop"
    exit 1

# Now just call the function:
share|improve this answer

Using sample from motd script:

if uname -r | grep -qs "\-server"; then
        echo "Server"
        echo "Desktop"
share|improve this answer

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.