System has not been booted with systemd 🐧 Linux

System has not been booted with systemd as init system (PID 1). Can't operate.

You ran systemctl inside an environment without systemd as PID 1 — a Docker container or older WSL.

Seen on: Linux

Meaning

Containers run your app as PID 1, not systemd, and WSL only enables systemd when configured. Start the service directly (service nginx start, or run the binary) or enable systemd in WSL.

Common causes

  • Running systemctl inside a Docker container
  • WSL without systemd enabled
  • chroot/rescue environments

⚡ Quick fix

  1. In containers, run the process directly in the foreground (CMD)
  2. Use service <name> start where SysV scripts exist
  3. On WSL, enable systemd in /etc/wsl.conf and restart WSL

Detailed fix by platform

WSL

  1. bash
    # /etc/wsl.conf
    [boot]
    systemd=true
    # then in PowerShell: wsl --shutdown

Docker

  1. CMD ["nginx", "-g", "daemon off;"]

How to diagnose

  1. PID 1 — ps -p 1 -o comm=
  2. Environment — Container, WSL or VM?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.