« Back to Systemd: Frequently Asked Questions

How to disable a systemd unit with systemctl

Sometimes a systemd unit, like a service, should not be starting during boot time or not at all. Let’s have a look how to disable a systemd unit.

Completely disable a unit

The most strict method is to disable a unit using the mask command.

systemctl mask UNIT

With the service masked, it won’t be able to start it anymore. Only when using the unmask command, it can be reactivated again.

Disable during boot

Just want to disable the unit so it won’t be started during the boot process? Then we use the disable command.

systemctl disable UNIT

After changing the service, have a look at it. In the line starting with Loaded, it should list ‘disabled’ after the unit name.

Learn more about systemctl

This article uses the systemctl command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: systemctl

systemctl cheat sheet

Other questions related to systemd

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!