It's relatively simple actually, use your package manager. For Ubuntu/dEbian based distros you could use the following command to install xfce4 for instance:
sudo apt-get install xfce4
To take advantage of your desktop environment you would then need some kind of VNC or remote desktop software, for that I can recommend tightvnc (VNC) or xrdp (Remote desktop).