Disabling a service removes it from the automatic startup path that systemd uses at boot and when other units pull it in through its install links. That matters when a daemon should stay installed for manual use, maintenance windows, or staged cutovers, but should no longer start automatically after restart.

The systemctl disable command works on the unit file's [Install] metadata rather than the process that may already be running. In practice it removes the symlinks created by systemctl enable, usually from directories such as /etc/systemd/system/multi-user.target.wants/, so the unit becomes disabled even though the unit file itself still exists and can still be started manually or by another unit.

Examples below use cron.service because it is present on many Debian and Ubuntu systems. Other distributions may use a different unit name, such as crond.service on many Red Hat family systems. A running service stays active after disable unless systemctl disable –now is used, and units without an [Install] section are typically static units that cannot be enabled or disabled directly.

Steps to disable a service using systemctl:

  1. Open a terminal on the system that manages the service.
  2. If the exact unit name is unclear, list the installed service unit files first.
    $ systemctl list-unit-files --type=service | grep -E 'cron|crond'

    Replace the pattern with the real service name when needed, for example sshd, nginx, docker, or postgresql.

  3. Check the current enablement state before changing it.
    $ systemctl is-enabled cron.service
    enabled

    Using the full unit name keeps the result unambiguous. A value of disabled means the unit is already not boot-enabled, while static usually means the unit has no install rules of its own.

  4. Disable the service's install links.
    $ sudo systemctl disable cron.service
    Removed "/etc/systemd/system/multi-user.target.wants/cron.service".

    On systems that still ship SysV compatibility helpers, systemctl may print extra synchronization lines before the symlink removal message. The important result is that the unit becomes disabled.

    Disabling a unit removes its enablement symlinks, and systemctl also disables any extra units listed under the unit file's [Install] Also= setting. This changes automatic activation at boot or via install targets, not whether the unit file exists.

  5. Verify that the service is now disabled.
    $ systemctl is-enabled cron.service
    disabled

    If systemctl disable warns that the unit has no installation config, the unit is usually static and must be controlled through the timer, socket, path, target, or dependent unit that starts it.

  6. Check the runtime state separately when the service was already running.
    $ systemctl is-active cron.service
    active

    systemctl disable does not stop a running service. It only prevents the service from being enabled automatically through its install links on future boots or target activation.

  7. Stop and disable the service in one step when both changes are intended.
    $ sudo systemctl disable --now cron.service
    $ systemctl is-enabled cron.service
    disabled
    $ systemctl is-active cron.service
    inactive

    Use mask instead of disable only when all activation paths must fail, including manual starts and dependency-based activation. disable is the safer choice when the service should remain available for manual or conditional use.