Celeb Glow
general | April 01, 2026

What is the difference between "systemctl start" and "systemctl enable"?

I installed MariaDB server to my machine. While setting up, I was met with the problem of whether I should have it enabled all the time, as the documentation I follow suggests with these steps:

sudo yum install mariadb mariadb-server
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
1

3 Answers

systemctl start and systemctl enable do different things.

enable will hook the specified unit into relevant places, so that it will automatically start on boot, or when relevant hardware is plugged in, or other situations depending on what's specified in the unit file.

start starts the unit right now.

disable and stop are the opposite of these, respectively.

This means that when you first install MariaDB, you might want to run systemctl enable mariadb.service to enable it so it starts on boot. You might also want to run systemctl start mariadb.service, or just reboot, in order to start MariaDB. To stop MariaDB, run systemctl stop mariadb.service (it will start again on next boot or when you manually start it). To disable it so it doesn't start on boot anymore, run systemctl disable mariadb.service.

Update:

As noted in gerardw's answer, starting from version 220, released in may 2015, both enable and disable started to take the optional --now switch in order to also start or stop the unit, depending on the used command.

To both disable and stop a unit with the same command, use systemctl disable mariadb.service --now. Similarly, to both enable and start a unit, use systemctl enable mariadb.service --now.

Source: systemctl man page

5

From the systemctl manpage:

enable NAME... Enable one or more unit files or unit file instances, as specified on the command line. This will create a number of symlinks as encoded in the "[Install]" sections of the unit files. After the symlinks have been created, the systemd configuration is reloaded (in a way that is equivalent to daemon-reload) to ensure the changes are taken into account immediately. Note that this does not have the effect of also starting any of the units being enabled. If this is desired, either --now should be used together with this command, or an additional start command must be invoked for the unit. ... Enabling units should not be confused with starting (activating) units, as done by the start command. Enabling and starting units is orthogonal: units may be enabled without being started and started without being enabled. Enabling simply hooks the unit into various suggested places (for example, so that the unit is automatically started on boot or when a particular kind of hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds the socket (in case of socket units), and so on.

Essentially, enable marks the service for starting up on boot, and start actually starts the service immediately.

5

As of systemctl version 220, enable and disable support a --now switch to start / stop services concurrent with the enabling / disabling.

e.g. systemctl --now enable foobar.service

Use systemctl --version to check your installed version.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy