Skip to main content

System Service Installation

Install Guard as a system service so it starts automatically on boot, restarts on failure, and runs continuously without manual intervention.

Quick Install

The install command detects your operating system and creates the appropriate service configuration automatically.

Platform-Specific Details

Guard creates a LaunchDaemon plist file:
Behavior after installation:
  • Starts automatically on boot
  • Restarts automatically on abnormal exit
  • Logs written to /var/log/panguard-guard.log
Manual management:

Manual systemd Setup (Advanced)

For full control over the service configuration, follow these steps:
1

Create a System User

2

Create Directories

3

Deploy the Application

4

Create Environment File

Environment files contain secrets. Always set permissions to 600 and restrict ownership to the service user.
5

Enable and Start


Manager Service

The Manager can also be installed as a systemd service for distributed deployments:

Watchdog Health Monitoring

The system service includes a built-in watchdog mechanism:
  • Checks Guard process health every 60 seconds
  • Restarts on abnormal memory usage
  • Degrades on abnormal CPU usage
  • Stops and notifies if restart count exceeds threshold

Batch Deployment Script

Generate a one-line installation script for deploying across multiple machines:
The generated script will:
  1. Download Panguard AI
  2. Install dependencies
  3. Install as a system service
  4. Start Guard

Data Directory

Override with --data-dir:
Contents:
  • guard.pid — PID file (prevents duplicate instances)
  • baseline/ — Behavioral baseline data
  • rules/ — Custom ATR rules
  • logs/ — Event logs (JSONL with rotation)
  • config.json — Guard configuration

PID Management

Guard uses PID files to manage process state:
  • PID written on startup
  • PID file removed on clean shutdown
  • Prevents multiple instances from running simultaneously
  • Supports graceful shutdown via SIGTERM and SIGINT

Real-Time Protection

Configure Guard for continuous monitoring and response.

Docker Deployment

Run Guard in a containerized environment.

Multi-Endpoint Setup

Connect Guard agents to a centralized Manager.

Environment Variables

Complete environment variable reference.