• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

Using Systemctl to Enable Services on Boot on Linux

Bhagwad Park

Published on: May 7, 2025

Categories: Linux Command Line, VPS Hosting 0

A service on Linux is a process that runs in the background that you can start, stop, enable, and disable. For modern operating systems, we interact with them using the “systemctl” tool, which interfaces with the systemd subsystem, which in turn manages the “init” system and service manager. As Linux admins, we don’t need to worry too much about what happens in the backend – all we need to know is how to enable and disable services.

  • Enabling a Service Using systemctl on Linux
  • What it Means to “Enable” a Service
  • Checking the Status of an Existing Service
  • Checking to See if Enabling Works
  • Getting a List of Currently Disabled Services
  • What systemctl enable Actually Does
  • Starting, Enabling, and –now
  • Static Services
  • Conclusion

Enabling a Service Using systemctl on Linux

To enable a service using systemctl, use the command:

sudo systemctl enable <service>

Where <service> is the name of the service you want to enable.

What it Means to “Enable” a Service

Enabling a service in Linux means you want it to start automatically when the system boots. It does not mean that the service starts automatically. We have specific flags for when we want to enable and start a service at the same time. Specifically:

sudo systemctl enable --now <service>

This command tells Linux to both enable the service you want as well as to start running it immediately. Here are the various “statuses” in which we find a service:

  1. enabled – Will start automatically on boot
  2. disabled – Won’t start on boot
  3. active – Currently running
  4. inactive – Not running right now
  5. static – Can’t be enabled directly (no [Install] section)
  6. masked – Completely disabled (can’t even be started manually)

Some of these statuses can be valid at the same time as others. For example, a service can be “enabled”, and also “inactive”, meaning that it’ll start the next time the OS reboots, but isn’t running now.

Checking the Status of an Existing Service

Before you enable a service, it’s a good idea to check and see what its current status is. Let’s take the “rsync” service, for example. To see what the status is, we type:

systemctl status rsync

This gives us the following output:

Current Service Status
Current Service Status

Let’s see what this output means. It says “disabled”. This means that the service won’t start on boot. It also says “inactive”, which means that it’s not currently running. From this state, we could start it, enable it, or both.

Checking to See if Enabling Works

Currently, the rsync service is neither enabled nor active. Let’s enable it and see what happens via the following command:

sudo systemctl enable rsync

After executing this command, I get the status again using:

systemctl status rsync

And here’s the output:

Enabling Rsync

You can see that the service “rysnc” is now enabled. Crucially, it still says “inactive”, which means that it’s not yet running. This goes to show that a service can be both “enabled” as well as inactive.

Now let’s reboot the system and see what happens:

sudo reboot

After the system starts up, we can once again check the status of the service and see what it says:

Rsync Tries to Start

As you can see, I restarted the system after I enabled “rsync”, and have run the status command again. This time, it still says that it’s inactive, but that’s because it tried to start and failed! The reason is given in the description, which says that rsync needs to have a configuration file to start, so this is by design. It’s not important for us, because we just wanted to test it and see if the service would have started if everything went well, and we can see that it did.

Now that we’ve seen it works, we can safely disable the rsync service again:

sudo systemctl disable rsync

Don’t forget to use “sudo” here, since the command might run without sudo, but some subprocesses might fail even when you authenticate correctly, so it’s best to use sudo in the initial command.

Getting a List of Currently Disabled Services

If you’re looking to enable a service, but aren’t sure exactly what it’s called, you can use this command to see which services on the system are currently enabled or disabled:

systemctl list-unit-files --type=service --state=disabled

This gives the following output:

List of Disabled Services

Each of the currently disabled services shows up as a “.service” file. The two columns represent the current state of the service, and the other column is the recommended preset by the vendor. If the two don’t match, it’s because either you or some other process changed the enabled status – most likely it wasn’t you!

Note that each of these services is a file with the “.service” extension. While enabling or disabling services, you don’t need to include the “.service” part, unless there’s another kind of file with the same name and a different extension.

What systemctl enable Actually Does

The mantra in Linux is that “everything is a file”, and this is true for services as well. Not only are services represented as files, but the enable/disable functionality is implemented through files, too. For example, on my system, the service files reside in the following directory:

/lib/systemd/system/

And when we enable them via systemctl, the tool simply creates a symbolic link to the service file in the following directory:

/etc/systemd/system/multi-user.target.wants/

We can see this by listing the files in the target directory via:

ls /etc/systemd/system/multi-user.target.wants/

And here’s the output:

Symbolic Links

You can see that these are all symbolic files by the default color. So the systemctl tool isn’t doing anything mysterious. There’s no concept of a “registry”, like we have in Windows, that contains the settings in a centralized manner. Everything’s a file, and we can create symbolic links to files in directories to indicate which services need to run when we boot the system.

Starting, Enabling, and –now

When it comes to deciding when services run, there are three options of which you need to be aware:

  1. Starting services
  2. Enabling services
  3. Enabling and starting services

We’ve already seen how starting a service isn’t the same as enabling it. Enabling it means you’re telling it to start the next time it runs, while starting a service makes it run immediately. If you want to enable a service and have it start immediately, then use the following command:

sudo systemctl enable --now <service>

Static Services

Some services aren’t meant to be enabled. They’re called “static” services and are started automatically when another process needs them. You can get a list of static services on your system using the following command:

systemctl list-unit-files --state=static

This gives the following output:

Static Files in Linux

As you can see, the list is quite long. It seems many services in Linux aren’t meant to be enabled by users! These services can still be started manually, but you’ll get an error if you try and enable one of them. Here’s an example:

Trying to Start a Static Service
Trying to Start a Static Service

As you can see, the system generates an error when we try and enable static services.

Masked services take things even further by disabling even manual starts!

Conclusion

Most of the time, you’ll be enabling/disabling services on Linux using systemctl for packages that you install on your own. This isn’t the same as starting the service, though you can do both at the same time using the “–now” parameter. Enabling a service means that it starts on boot. Linux achieves this by including a symbolic link to the file in the appropriate directory.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How To Use The Iperf Command On Linux

In this blog post we will explore background, what is Iperf, how to install, and everything from basic to more advanced usage.

The Dmseg Command: Everything You Need To Know

In this guide, we cover basic usage of the dmesg command to help you master this powerful tool within Linux.

Understanding The Impact Of Spaces In Filenames on Linux

In this post, we are going to explore this in depth best practices in both how to handle and, how to avoid using spaces in filenames.

Brew Install Node Guide

Check out our beginner friendly guide to learn how to install node.js with homebrew on Linux with easy commands that you can copy and paste!

Reader Interactions

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA