Deploy Self Hosted Metrics SHM
Privacy-first, Agnostic Telemetry for Self-Hosted Software
Just deployed
/var/lib/postgresql/data
Just deployed
Deploy and Host Self Hosted Metrics SHM on Railway
Self-Hosted Metrics (SHM) is a privacy-first telemetry server for self-hosted and on-prem software. It collects aggregate usage metrics, active instance counts, versions, and environments without tracking end users. Applications send signed JSON snapshots, and SHM automatically builds dashboards with tables, KPIs, and graphs from the data.
About Hosting Self Hosted Metrics SHM
Hosting SHM on Railway involves deploying the SHM server (a Go service with an embedded UI) alongside a PostgreSQL database. Incoming metric snapshots are stored as JSONB in Postgres and visualized in real time. You configure a database connection string, expose the service port, and optionally add a GitHub token for higher API limits. Initial SQL migrations must be applied once to set up the schema. Railway handles networking, scaling, and environment management.
Common Use Cases
- Track active installs and version adoption of self-hosted products
- Collect high-level business KPIs from customer deployments without PII
- Monitor multiple products or environments from a single metrics server
Dependencies for Self Hosted Metrics SHM Hosting
- PostgreSQL (required)
- GitHub API token (optional, for star count fetching)
Deployment Dependencies
- https://github.com/btouchard/shm
- https://github.com/btouchard/shm/blob/main/docs/DEPLOYMENT.md
- https://self-hosted-metrics.com/
Implementation Details
Required environment variables
SHM_DB_DSN– PostgreSQL connection stringPORT– Service port (defaults to 8080)
Optional
GITHUB_TOKEN– Increase GitHub API rate limitsSHM_RATELIMIT_*– Rate limiting and brute-force protection settings
Database setup
- Run SQL migrations from the
migrations/directory once on the database.
Why Deploy Self Hosted Metrics SHM on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Self Hosted Metrics SHM on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content