selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Self-Hosted Metrics (SHM) logo

Self-host Self-Hosted Metrics (SHM)

v1.2.7

Privacy-first telemetry server for self-hosted software

ReleaseOpen SourceAGPL-3.0
Docker ComposeCompose file & guide
docker compose up -d
Updated14 hours ago
LanguageGo
Setup difficultyModerate
MobileResponsive
ThemeDark mode
Stars
165
CPU
0.1 vCPU
RAM
64 MB (app) + 256 MB (PostgreSQL)
Storage
~1 KB per snapshot
Port
8080 (HTTP server port for dashboard and API)
Requires
PostgreSQL
Docker
ghcr.io/kolapsis/shm
Dashboard overview showing aggregated metrics and KPI cardsInstance details view with metrics breakdownMetrics graph visualization over timeModern dark-mode dashboard showing business metrics and system health

What is Self-Hosted Metrics (SHM)?

SHM (Self-Hosted Metrics) is a privacy-first telemetry server for self-hosted software developers. It allows developers to collect aggregate usage statistics from their distributed applications without spying on users. The server is a single Go binary with an embedded dashboard that automatically adapts to any JSON payload sent by clients. Clients (available as Go and Node.js SDKs) generate Ed25519 keypairs for cryptographic identity and send signed snapshots. The server stores data in PostgreSQL and provides a dark-mode dashboard with KPI cards, tables, and graphs. It also offers public badges for README embedding. Deployment is via Docker Compose with PostgreSQL.

Should you self-host Self-Hosted Metrics (SHM)?

Self-Hosted Metrics (SHM) scores 45/100 on selfhost.directory (how scoring works) and ranks #77 of 104 in Monitoring & observability. It has 165 GitHub stars.

It shipped 9 stable releases in the past year. The latest, v1.2.7, came out on 29 July 2026. New versions land roughly every 2 weeks.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is AGPL-3.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is grafana (90/100, 77 569 stars). It scores higher overall, so compare the two before you pick. See Self-Hosted Metrics (SHM) vs grafana side by side.

Features

  • Cryptographic identity
  • Docker-native deployment
  • DO_NOT_TRACK Support
  • Dynamic dashboard
  • GitHub stars integration
  • Go SDK
  • Health check endpoint
  • Multi-app support
  • Node.js/TypeScript SDK
  • Ops vs Business Separation
  • Public Badges
  • Rate Limiting
  • System Metrics Collection

Self-Hosted Metrics (SHM) README

How to install Self-Hosted Metrics (SHM)

Install Self-Hosted Metrics (SHM) with Docker Compose

Docker and Docker Compose
Environment variables
SHM_DB_DSN, PORT, GITHUB_TOKEN, SHM_RATELIMIT_*
1. Create the configuration

Create a compose.yml file:

name: shm

services:
  db:
    image: postgres:15-alpine
    container_name: shm-db
    restart: unless-stopped
    environment:
      POSTGRES_USER: shm
      POSTGRES_PASSWORD: ${DB_PASSWORD:-change-me-in-production}
      POSTGRES_DB: metrics
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./migrations:/docker-entrypoint-initdb.d
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U shm -d metrics"]
      interval: 10s
      timeout: 5s
      retries: 5

  app:
    image: ghcr.io/kolapsis/shm:latest
    container_name: shm-app
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      SHM_DB_DSN: "postgres://shm:${DB_PASSWORD:-change-me-in-production}@db:5432/metrics?sslmode=disable"
      PORT: "8080"
    ports:
      - "8080:8080"

volumes:
  postgres_data:
2. Download migrations
mkdir -p migrations
curl -sL https://raw.githubusercontent.com/kolapsis/shm/main/migrations/001_init.sql -o migrations/001_init.sql
curl -sL https://raw.githubusercontent.com/kolapsis/shm/main/migrations/002_applications.sql -o migrations/002_applications.sql
3. Start the services
docker compose up -d

Access the dashboard at http://localhost:8080.

Requires PostgreSQL 15+ and Docker Compose

How to configure Self-Hosted Metrics (SHM)

  • DO_NOT_TRACKSet to true or 1 to completely disable telemetry

    Set to true or 1 to completely disable telemetry

    values: true, 1

  • GITHUB_TOKENGitHub Personal Access Token for higher API rate limits

    GitHub Personal Access Token for higher API rate limits

  • PORT8080HTTP server port

    HTTP server port

  • SHM_COLLECT_SYSTEM_METRICStrueSet to false or 0 to disable automatic system metrics collection

    Set to false or 0 to disable automatic system metrics collection

    values: true, false

  • SHM_DB_DSNPostgreSQL connection string

    PostgreSQL connection string

  • SHM_RATELIMIT_ADMIN_BURST10Burst allowance for admin endpoints

    Burst allowance for admin endpoints

  • SHM_RATELIMIT_ADMIN_PERIOD1mTime window for admin endpoints

    Time window for admin endpoints

  • SHM_RATELIMIT_ADMIN_REQUESTS30Max requests per period for /api/v1/admin/*

    Max requests per period for /api/v1/admin/*

  • SHM_RATELIMIT_BRUTEFORCE_BAN15mDuration of IP ban after brute-force detection

    Duration of IP ban after brute-force detection

  • SHM_RATELIMIT_BRUTEFORCE_THRESHOLD5Failed auth attempts before IP ban

    Failed auth attempts before IP ban

  • SHM_RATELIMIT_CLEANUP_INTERVAL10mInterval for cleaning up expired limiters

    Interval for cleaning up expired limiters

  • SHM_RATELIMIT_ENABLEDtrueEnable/disable rate limiting

    Enable/disable rate limiting

  • SHM_RATELIMIT_REGISTER_BURST2Burst allowance for register endpoints

    Burst allowance for register endpoints

  • SHM_RATELIMIT_REGISTER_PERIOD1mTime window for register endpoints

    Time window for register endpoints

  • SHM_RATELIMIT_REGISTER_REQUESTS5Max requests per period for /v1/register and /v1/activate

    Max requests per period for /v1/register and /v1/activate

  • SHM_RATELIMIT_SNAPSHOT_BURST2Burst allowance for snapshot endpoint

    Burst allowance for snapshot endpoint

  • SHM_RATELIMIT_SNAPSHOT_PERIOD1mTime window for snapshot endpoint

    Time window for snapshot endpoint

  • SHM_RATELIMIT_SNAPSHOT_REQUESTS1Max requests per period for /v1/snapshot (per instance)

    Max requests per period for /v1/snapshot (per instance)

Self-Hosted Metrics (SHM) releases & version history

More in Monitoring & observability

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…