I've found several solutions to convert Ubuntu 12.04 Desktop to Server, with the following commands:

sudo apt-get install tasksel
sudo tasksel remove ubuntu-desktop
sudo tasksel install server
apt-get install linux-server linux-image-server
apt-get –purge remove lightdm

I just want to know if it is the same process with Ubuntu 14.04. The reason I need to do this is because I need to install moodle (some people may have other reasons to do this so I hope this helps them too) and it requires to run over Ubuntu Server rather than Desktop. Thanks

  • 5
    Why do you think moodle requires Ubuntu Server specifically? Can you link to the instructions you are following? You can install a full LAMP stack just as easily on the Desktop version. Commented Aug 14, 2014 at 20:58
  • Here's the doc; it talks about Ubuntu Server 14.04 Lts only, so that's why I'm not pretty sure about installing it on Desktop docs.moodle.org/26/en/… Commented Aug 14, 2014 at 21:03
  • the assumption made to solve the problem here is wrong, read below why
    – tomodachi
    Commented Feb 16, 2015 at 16:51
  • 2
    You could have left out the line that explains why you want to do this (e.g. moodle), to keep the question generic. After all, moodle is not mentioned in the title nor the tags. Commented Oct 17, 2015 at 14:13

3 Answers 3


NOTE: the following commands are good only to Ubuntu version less/older than 12.04, see Server FAQ, CAUTION: you might end up with a useless system.

Thanks for your answer but I've found you need to add the update line

sudo apt-get update

Also corrected the following line

sudo apt-get -purge remove lightdm


sudo apt-get purge lightdm

The full version of the corrected script is below

# update
sudo apt-get update

# install the 'tasksel' package so we can remove the desktop image       
sudo apt-get install tasksel

# remove the desktop image
sudo tasksel remove ubuntu-desktop

# tell tasksel to start the server image setup
sudo tasksel install server

# install the server images
sudo apt-get install linux-server linux-image-server

# remove lightdm
sudo apt-get purge lightdm

# remove all packages no longer required (~400 MB)
sudo apt-get autoremove
  • 2
    On Ubuntu 15.10 I had to reinstall tasksel after removing the desktop image. Also, the server images don't need to be installed (and can't be) because "Since 12.04, there is no difference in kernel between Ubuntu Desktop and Ubuntu Server" (bit.ly/1S54S2d). Commented Jan 20, 2016 at 20:34
  • Can I use this process (with little adjustment) to reduce Linux Mint 17 to minimal installation and convert it to Ubuntu 14.04? I want to do this because if I can, it saves me some trouble of fresh installation and reconfiguration of many packages. Commented Feb 23, 2016 at 23:01
  • with ubuntu 16.04 this leaves me with an unusable system, no grub, no kernel, ... any ideas?
    – x29a
    Commented Sep 22, 2016 at 18:48
  • I think you should reorder those, and remove ubuntu-desktop just before purging lightdm/gdm3, otherwise removing ubuntu-desktop will remove anything you have installed that depends on the linux kernel.
    – miigotu
    Commented May 1, 2018 at 6:00

The simple answer is yes, but running the commands you are able to install Ubuntu server. Ensure that you make the following changes to the grub configuration file located at /etc/default/grub:

( Comment out ‘GRUB_HIDDEN_TIMEOUT’ )
GRUB_TERMINAL=console ( only for PC )

Then you can run

sudo update-grub

The assumption that you need to uninstall your Ubuntu desktop and install Ubuntu server is faulty.

However for a real installation its always better to have a minimal installation containing only what you need.

Ubuntu server is just a minimal Ubuntu install with a specific kernel optimized for serving many clients. Instead of a single user in the case of a desktop. any application / Service you can run on your Ubuntu server you can run on Ubuntu desktop

Checking the installation requirements on moodle

We can see that what is needed is:

  • a webserver
  • php support for the webserver
  • a database
  • 2
    Sometimes it's desirable to do this, especially if it's a production server, and the person who originally set it up did so as a desktop out of ignorance. There's no need to run Unity on a production server, and reinstalling the whole server seems like overkill.
    – m0j0
    Commented Aug 5, 2015 at 16:48
  • In production, I'd rather go back to scratch and reinstall the whole thing if it had been faulty installed as a desktop. Otherwise, I'm thinking GRUB-hell would be a real risk... In any other case, yes, it's likely not at all going to be an issue if it's originally a desktop installation...
    – Erk
    Commented Aug 24, 2018 at 15:35

You must log in to answer this question.

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