How to Check and Set Linux systemd Runlevels


Runlevel today implemented on systemd, previously most Linux distributions were equipped with the init system, Sys-V style. Sys-V used seven different runlevels to determine which processes can be started on the system. For example, runlevel 3 was usually reserved for the command line and associated programs, while runlevel 5 launched a GUI and all the processes required to do so. Results may vary by distribution.

The vast majority of Linux distributions have adopted systemd as their init system. Some distributions still use Sys-V where the traditional implementation of runlevels still exists. The systemd implementation adopted the concept of runlevels, converting them to systemd “targets”.

On some systems there are still scraps of Sys-V, on which commands such as runlevel can still be found. But some modern systemd distributions have completely eradicated this support. In this tutorial we show how to check the current runlevel on Linux.

Check current Linux runlevel?

Below are two commands to determine the current Linux runlevel.

$ runlevel
N 5
$ who -r
  run-level 5 2022-11-07 14:52

As you can see, runlevel 5 has started here. Alternatively, the command who -r can be ran. The runlevel command is only available on some systemd distributions, but should work on any sys-V system.

The different runlevels were assigned to corresponding systemd targets. This command can be used to check the targets.

$ ls -l /lib/systemd/system/runlevel*

Below is the output of the runlevels at a Linux Mint, which is based on Ubuntu/Debian.

$ lrwxrwxrwx 1 root root 15 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 13 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 17 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 17 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 17 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 16 Aug 31 17:27 /lib/systemd/system/ ->
lrwxrwxrwx 1 root root 13 Aug 31 17:27 /lib/systemd/system/ ->

Total 0

Total 0

Total 0

Total 0

Total 0

Linux Runlevels

0Halt shut down the system
1Single-user mode (Rescue and special administration)
2Multi-user mode not start network interfaces and daemons
3Multi-user mode with Networking starts system normally
4Not Used
5Multi-user mode as runlevel 3 + display manager X11 GUI
6Reboot the system

As with runlevels, there are 7 systemd targets by default. The two main targets are and The following command displays the default systemd targets.

$ systemctl get-default

In this example, is started, which makes sense because we need a graphical desktop environment. On a server where often no GUI is running, is usually started.

$ systemctl get-default

Use the command to see which services are associated with this target.

$ systemctl list-dependencies

Try the following command to see which systemd target (or runlevel) a service needs to run. In this example, we check the SSH service.

$ systemctl show -p WantedBy sshd.service

How to set systemd?

The Linux systemd runlevel can be set with this command.

$ sudo systemctl set-default

The next time the system boots in multi-user mode (

How useful was this post?

Click on a star to rate it!

Average rating 4.7 / 5. Vote count: 3

No votes so far! Be the first to rate this post.

Leave a Reply

Your email address will not be published. Required fields are marked *