See the Server GUI documentation for how to do this. Before installing a GUI on an Ubuntu Server system, please take note of the good reasons given there for not to install or run GUI's on production servers.
On any Ubuntu system with a display manager installed (which provides graphical login), you can disable graphical login (requiring a user to run startx
to start X11) using these instructions. However, since GDM is replaced with LightDM in Oneiric (though you can still install and use GDM if you want), you should run sudo service lightdm start
instead of sudo service gdm start
if you're on Ubuntu 11.10 (or later, as more releases come out).