Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix "systemctl: command not found" on Linux

Your system may not use systemd, or systemctl is not in your PATH. Check both.

VPS and Cloud Servers2 min read3 steps2 screenshots

Why it happens

  1. The systemd package is not installed.
  2. The folder that holds systemctl is not in your PATH.
  3. Your system uses another init system (such as SysVinit, OpenRC or runit), or you are in a container that has no systemd.

Step 1: Check if systemd is installed and running

Find out which process is the init system:

ps --no-headers -o comm 1

If it prints systemd, you use systemd. Check the version:

systemd --version
The systemd version

Step 2: Check the PATH

echo $PATH
The PATH variable

If /usr/bin or /bin is missing, add it:

export PATH=$PATH:/usr/bin/

Step 3: Install systemd

Debian and Ubuntu

sudo apt-get install systemd

CentOS and Fedora

sudo yum install systemd
sudo dnf install systemd

Arch Linux

sudo pacman -Syu systemd

Step 4: Use the right tool for another init system

If your system does not use systemd, use the tool that matches it. For SysVinit:

sudo service ufw status

For OpenRC: rc-service and rc-update.

If systemctl exists but in another folder, link it. Find it first with which -a systemctl or find / -name systemctl 2>/dev/null:

sudo ln -s /path/to/systemctl /usr/bin/systemctl

Containers and WSL

Many Docker containers and older WSL versions have no systemd. Run services directly or with service name start in the container.

Quick recap

  • Check that systemd runs with ps --no-headers -o comm 1.
  • Fix the PATH or install the package.
  • On systems without systemd, use service.