Why does an Ubuntu Server have graphical.target as the default systemd target?

Despite the name of the target, there is nothing graphical running on Ubuntu Server 16.04. You can run this command to check and compare it with your desktop distro if you like:

systemctl list-dependencies graphical.target 

On my Ubuntu 16.04 server, I see that the targets depend on "display-manager.service", but no display manager is installed or running.

I expect Ubuntu servers are set this way for some kind of consistency, although I agree it's confusing.


From the redhat manual:

For example, the graphical.target unit, which is used to start a graphical session, starts system services such as the GNOME Display Manager (gdm.service) or Accounts Service (accounts-daemon.service) and also activates the multi-user.target unit. Similarly, the multi-user.target unit starts other essential system services such as NetworkManager (NetworkManager.service) or D-Bus (dbus.service) and activates another target unit named basic.target.

So it is not wrong for it to be set since it does not activate the display manager when the service that handles the display service is not set.

For a server you can set it to multi-user.target but it is not needed. Looks like you end up on runlevel 4 if you do and runlevel 5 when you don't.

Runlevel    Target Units    Description
0   runlevel0.target, poweroff.target   Shut down and power off the system.
1   runlevel1.target, rescue.target     Set up a rescue shell.
2   runlevel2.target, multi-user.target     Set up a non-graphical multi-user system.
3   runlevel3.target, multi-user.target     Set up a non-graphical multi-user system.
4   runlevel4.target, multi-user.target     Set up a non-graphical multi-user system.
5   runlevel5.target, graphical.target  Set up a graphical multi-user system.
6   runlevel6.target, reboot.target     Shut down and reboot the system.