« Back to Systemd: Frequently Asked Questions

How to start and enable a unit with systemctl

After the installation of a software package or when configuring a custom unit, it may be needed to start the unit. In most cases, we also want our unit to start during boot time. There are a few ways to achieve this, let’s have a look.

Manual start and enable

First we start the unit using the start command.

systemctl start UNIT

After that, we enable the unit.

systemctl enable UNIT

If everything went well, the unit is now started and will also start during the next boot.

Combine the options

There is a quicker way to achieve the steps above. This is to enable the service and start it right away using the --now option.

systemctl enable --now UNIT

Same result, but in one command!

Check the status

After starting the service, have a look at the status of the unit to see if everything is expected.

systemctl status UNIT

Especially the line in the output with Loaded and Active will reveal if the unit is running and enabled.

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!