Notice: I published an updated version of this tutorial here, for Debian Lenny.
Debian Lenny installs by default the entire X Window System and the GNOME desktop environment.
In order to have only a minimum and basic Debian installation, when the installer reaches to the window where it asks you to select which software you want to install (including Web Server, Desktop Environment, Basic System and several more options), deselect Desktop Environment and make sure Basic System remains selected (use SPACE to select/deselect options).
After Debian installs the basic system, it will ask for a reboot, then it will present you with a nice shell login. Login as user, type su, then enter your root password. Now you'll be logged on as root, so be very careful with the commands you issue.
Next, to install a desktop environment, issue one of the following commands:
apt-get install x-window-system-core kdm kde-core
apt-get install x-window-system-core gdm gnome-core
The first one will install the X window system, the K Display Manager, and only the basic libraries and applications KDE provides, while the last one will install the GNOME Display Manager and GNOME's libraries and basic applications.
Now everything should be in place, so it's time to fire up the GUI:
Or, for GNOME:
Login with your username and that should be all.
Updated: Jun 16, 2008 (Created: Jun 16, 2008)