How to Change Runlevels (targets) in SystemD

Systemd is a modern init system for Linux: a system and service manager which is compatible with the popular SysV init system and LSB init scripts. It was intended to overcome the shortcomings of SysV init as explained in the following article.

  1. The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linux

On Unix-like systems such as Linux, the current operating state of the operating system is known as a runlevel; it defines what system services are running. Under popular init systems like SysV init, runlevels are identified by numbers. However, in systemd runlevels are referred to as targets.

Suggested Read: Managing System Startup Process and Services (SysVinit, Systemd and Upstart)

In this article, we will explain how to change runlevels (targets) with systemd. Before we move any further, let’s briefly under the relationship between runlevels numbers and targets.

  • Run level 0 is matched by poweroff.target (and runlevel0.target is a symbolic link to poweroff.target).
  • Run level 1 is matched by rescue.target (and runlevel1.target is a symbolic link to rescue.target).
  • Run level 3 is emulated by multi-user.target (and runlevel3.target is a symbolic link to multi-user.target).
  • Run level 5 is emulated by graphical.target (and runlevel5.target is a symbolic link to graphical.target).
  • Run level 6 is emulated by reboot.target (and runlevel6.target is a symbolic link to reboot.target).
  • Emergency is matched by emergency.target.

How to View Current target (run level) in Systemd

When the system boots, by default systemd activates the default.target unit. It’s main work is to activate services and other units by pulling them in via dependencies.

To view the default target, type the command below.

#systemctl get-default 

graphical.target

To set the default target, run the command below.

# systemctl set-default multi-user.target  

How to Change the target (runlevel) in Systemd

While the system is running, you can switch the target (run level), meaning only services as well as units defined under that target will now run on the system.

To switch to runlevel 3, run the following command.

# systemctl isolate multi-user.target 

To change the system to runlevel 5, type the command below.

# systemctl isolate graphical.target

For more information about systemd, read through these useful articles:

  1. How to Manage ‘Systemd’ Services and Units Using ‘Systemctl’ in Linux
  2. How to Create and Run New Service Units in Systemd Using Shell Script
  3. Managing System Startup Process and Services (SysVinit, Systemd and Upstart)
  4. Manage Log Messages Under Systemd Using Journalctl [Comprehensive Guide]

In this guide, we showed how to change runlevels (targets) with systemd. Use the comment form below to send us any questions or thoughts concerning this article.

Tutorial Feedback...
Was this article helpful? If you don't find this article helpful or found some outdated info, issue or a typo, do post your valuable feedback or suggestions in the comments to help improve this article...

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

12 thoughts on “How to Change Runlevels (targets) in SystemD”

  1. What’s the equivalent of run-level 2? i.e. multi-user, but no networking.

    Troubleshooting some (probable) networking issues that prevent the server from fully booting. Normally I would boot into run-level 2, so I have multi-user, but without networking enabled.

    Reply
  2. There used to be a good GUI graphical interface for viewing enabling and disabling stuff on the various runlevels… what happened to that?

    Reply
  3. Thanks for the clear, concise explanation. It is needed and appreciated. However, I’m looking for a way to find the current target, not necessarily the same thing as the default target.

    I’m writing a script using the runlevel man page as a guide. Some bright soul pointed out `who -r` gives the current run level (but not target). There should be an easier way (like get.target or similar).

    Have I missed something? TIA.

    Reply
  4. Nice article and helpful info since I did need to know this.

    Unfortunately I needed to look up something this simple as systemd is change for change sake and is unnecessarily over complicated.

    There was nothing wrong with # init 3

    Reply
  5. Thanks. This is well written. I had read another source that did not mention the graphical target so I ended up without a GUI for a while :)

    Reply
    • @Fred

      Ooops, that’s correct. We will update the article soon; it is supposed to read:
      “Run level 0 is matched by poweroff.target (and runlevel0.target is a symbolic link to poweroff.target)”

      Reply

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.