Skip to content

Installation

Installation

Cbox FPM Exporter is distributed as a single static binary with no runtime dependencies. It works on any Linux distribution including Alpine.

Quick Install

# Latest version
curl -fsSL https://raw.githubusercontent.com/cboxdk/fpm-exporter/main/install.sh | sh

# Specific version
curl -fsSL https://raw.githubusercontent.com/cboxdk/fpm-exporter/main/install.sh | VERSION=v1.0.0 sh

# Custom install directory
curl -fsSL https://raw.githubusercontent.com/cboxdk/fpm-exporter/main/install.sh | INSTALL_DIR=/opt/bin sh

This auto-detects your OS and architecture and installs to /usr/local/bin.

Pre-built Binaries

Download the latest release from GitHub Releases:

# Linux (amd64) - Works on ALL distributions including Alpine
wget https://github.com/cboxdk/fpm-exporter/releases/latest/download/fpm-exporter-linux-amd64
chmod +x fpm-exporter-linux-amd64
sudo mv fpm-exporter-linux-amd64 /usr/local/bin/fpm-exporter

# Linux (arm64)
wget https://github.com/cboxdk/fpm-exporter/releases/latest/download/fpm-exporter-linux-arm64
chmod +x fpm-exporter-linux-arm64
sudo mv fpm-exporter-linux-arm64 /usr/local/bin/fpm-exporter

# macOS (Apple Silicon)
wget https://github.com/cboxdk/fpm-exporter/releases/latest/download/fpm-exporter-darwin-arm64
chmod +x fpm-exporter-darwin-arm64
sudo mv fpm-exporter-darwin-arm64 /usr/local/bin/fpm-exporter

# macOS (Intel)
wget https://github.com/cboxdk/fpm-exporter/releases/latest/download/fpm-exporter-darwin-amd64
chmod +x fpm-exporter-darwin-amd64
sudo mv fpm-exporter-darwin-amd64 /usr/local/bin/fpm-exporter

Build from Source

Requires Go 1.24 or later:

git clone https://github.com/cboxdk/fpm-exporter.git
cd fpm-exporter

# Build for current platform
make build

# Build for all platforms
make build-all

Built binaries are placed in build/:

  • build/fpm-exporter-linux-amd64
  • build/fpm-exporter-linux-arm64
  • build/fpm-exporter-darwin-amd64
  • build/fpm-exporter-darwin-arm64

Docker

Run alongside your PHP-FPM container:

docker run -d \
  --name fpm-exporter \
  -p 9114:9114 \
  -v /var/run/php-fpm.sock:/var/run/php-fpm.sock \
  cboxdk/fpm-exporter:latest serve

Kubernetes

Deploy as a sidecar container in your PHP-FPM pod:

apiVersion: v1
kind: Pod
metadata:
  name: php-app
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "9114"
spec:
  containers:
    - name: php-fpm
      image: php:8.3-fpm
      volumeMounts:
        - name: fpm-socket
          mountPath: /var/run

    - name: fpm-exporter
      image: cboxdk/fpm-exporter:latest
      args: ["serve"]
      ports:
        - containerPort: 9114
      volumeMounts:
        - name: fpm-socket
          mountPath: /var/run

  volumes:
    - name: fpm-socket
      emptyDir: {}

Systemd Service

Create /etc/systemd/system/fpm-exporter.service:

[Unit]
Description=Cbox FPM Exporter
After=network.target php-fpm.service

[Service]
Type=simple
User=www-data
ExecStart=/usr/local/bin/fpm-exporter serve
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable fpm-exporter
sudo systemctl start fpm-exporter

Verify Installation

Check the exporter is running:

# Check version
fpm-exporter version

# Start and test metrics endpoint
fpm-exporter serve &
curl http://localhost:9114/metrics

Next Steps