---
title: "Example — postgres-cluster"
---

# Example — postgres-cluster

Full PostgreSQL cluster + HeliosProxy compose, suitable for local development.

**Source on GitHub**: [`HeliosDB-Proxy/examples/postgres-cluster`](https://github.com/HeliosDatabase/HeliosDB-Proxy/tree/main/examples/postgres-cluster)

## What it provisions

- One PG primary + two streaming-replication standbys (Docker Compose)
- HeliosProxy in front, configured with the `postgres-topology` provider for backend discovery
- Health checks polling `pg_is_in_recovery()` on a 5-second cadence
- Optional admin web UI on `:9090`

## Run

```bash
git clone https://github.com/HeliosDatabase/HeliosDB-Proxy.git
cd HeliosDB-Proxy/examples/postgres-cluster
docker compose up -d
```

Connect via `psql postgresql://demo:demo@localhost:5432/postgres`. Open `http://localhost:9090/` for the admin console.

## What to look at

- `docker-compose.yml` — backend topology and proxy configuration
- `proxy.toml` — pool modes, lag-aware routing, query analytics
- `init/` — primary bootstrap SQL + standby provisioning script
