The xinit program allows a user to manually start an X display server.
By default, xinit and startx start an X display server pointing to a display device that is enumerated as :0 and then start an xterm on it.
When the xterm terminates, xinit and startx kill the X display server.
Typically, this script runs a number of programs and a window manager.
On desktop Linux systems, a display manager is the most commonly used method.