Self-host PgHero
v4.1.0Postgres performance dashboard with query and space stats
docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname -p 8080:8080 ankane/pghero- Stars
- 8 948
- Port
- 8080 (PgHero web dashboard (container publishes 8080:8080))
- Requires
- PostgreSQL
ankane/pgheroWhat is PgHero?
PgHero is a performance dashboard for Postgres, aimed at developers and operators who want database insight without a hosted monitoring product. The web UI reports query statistics, long running and slow queries, connections, table and index space usage, suggested indexes, unused indexes, and lets you inspect plans with EXPLAIN and a visualize page or terminate long running queries and connections. It runs either as the ankane/pghero Docker container pointed at a DATABASE_URL, or as a Rails engine mounted in an existing application. Historical query and space stats are opt-in: you create pghero_* tables and schedule the bundled rake tasks, after which a time range slider appears on the Queries tab. System level metrics such as CPU usage and IOPS come from managed database providers, currently Amazon RDS and Google Cloud SQL. Multiple monitored databases and thresholds are configured through pghero.yml, access is protected with basic auth credentials or left to a reverse proxy, and the container exposes a /health endpoint. Version 4.0 requires Postgres 14 or newer and was released in August 2026.
PgHero alternatives
Percona Monitoring and Management (PMM)Self-hosted open-source database observability platform with query analytics, dashboards, advisors, alerting, and backup for major databases.ComparePercona Monitoring and Management (PMM) with PgHero
PgDogSelf-hosted, open-source PostgreSQL proxy written in Rust: transaction-mode connection pooling, read/write load balancing with health checks, and automatic sharding.ComparePgDog with PgHero
PostHogOpen-source product toolkit - analytics, session replay, feature flags, error tracking - with a one-line self-hosted hobby deploy using Docker Compose.ComparePostHog with PgHero
open-sparrowOpenSparrow is a self-hosted, open-source PHP platform generating CRUD apps, dashboards, calendars from JSON schema on PostgreSQL. Includes RAG, workflows, Kanban, 2FA.Compareopen-sparrow with PgHero
chmonitorchmonitor is a self-hosted, open-source operational advisor for ClickHouse that reads system tables for real-time monitoring and AI-driven schema recommendations.Comparechmonitor with PgHero
PersesSelf-hosted, open-source dashboards for observability signals: Prometheus, Tempo, Loki and Pyroscope in one tool, with RBAC, OIDC login and Dashboard-as-Code SDKs.ComparePerses with PgHero
dockprobeSelf-hosted Docker monitoring dashboard with real-time metrics, anomaly detection, and Telegram alerts in a single container.Comparedockprobe with PgHero
KuberoOpen-source, self-hosted PaaS for Kubernetes: deploy containers or source with 160+ app templates, CI/CD pipelines and GitOps review apps, run by a UI plus operator.CompareKubero with PgHero
Should you self-host PgHero?
PgHero scores 67/100 on selfhost.directory (how scoring works) and ranks #1 of 2 in Performance monitoring. It has 8 948 GitHub stars, +16 in the last 30 days.
There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.
Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in Ruby.
Its closest alternative on selfhost.directory is Bencher (54/100, 928 stars). PgHero scores higher overall. See PgHero vs Bencher side by side.
Features
- Basic Authentication
- Configurable alert thresholds
- EXPLAIN and plan visualization
- Health check endpoint
- Historical query statsOpt-in: requires creating the stats tables and scheduling rake tasks.
- Historical space stats
- Index suggestions
- Kill long running queries and connections
- Multiple database monitoring
- Query performance stats
- System stats for managed databasesRDS requires the aws-sdk-cloudwatch gem / CloudWatch IAM permission; Cloud SQL requires the Monitoring API.
- Unused index detection
PgHero README
More in Performance monitoring
pyroscopeOpen-source, self-hosted continuous profiling platform: ingest CPU/memory profiles via SDKs, Alloy or eBPF, store in object storage and query flame graphs in Grafana.
BencherOpen-source continuous benchmarking suite: a CLI, API server, and web console that track benchmark results and catch performance regressions; self-hosted with Docker.
LocustOpen-source, self-hosted load-testing tool: scenarios are plain Python, driven from a web UI on port 8089, headless for CI, or across distributed master/worker nodes.
pcpPerformance Co-Pilot (PCP) is an open-source, self-hosted framework for system-level performance monitoring across distributed systems.

0 comments