How to install GUI in Ubuntu Server Edition
First type
sudo apt-get install xinit
To install Gnome
sudo apt-get install ubuntu-desktop
To install KDE is
sudo apt-get install kubuntu-desktop
and to install XFCE
sudo apt-get install xubuntu-desktop
after installing reboot the system
sudo reboot
No X server by design
By design, Ubuntu Server Edition does not include an X server or any graphical desktop applications. This is a deliberate choice as we believe that most servers should be serviced remotely, are safer without the addition of code that needs direct communication from user space to hardware, and should not be used as a desktop by their administrator. “So I applaud the Ubuntu team’s common sense (and courage) in keeping the X Window System out of the default installation of Ubuntu Server.“
–Mick Bauer in April 2008 Linux Journal – “Security Features in Ubuntu Server”