Skip to content
GitHubRSS

Quick Start

This guide gets you from zero to a running BigBrotr instance using Docker Compose. You will have all six services, PostgreSQL with PgBouncer, and Prometheus monitoring operational within minutes.

  • Docker Engine 24+ and Docker Compose v2
  • 4 GB RAM minimum (8 GB recommended)
  • 20 GB disk space for initial data collection
Terminal window
git clone https://github.com/BigBrotr/bigbrotr.git
cd bigbrotr/deployments/bigbrotr

Copy the example environment file and review the defaults:

Terminal window
cp .env.example .env

The key environment variables:

VariableDefaultDescription
POSTGRES_USERadminPostgreSQL superuser
POSTGRES_PASSWORDSet a strong password
POSTGRES_DBbigbrotrDatabase name
WRITER_USERwriterWriter services (all six services)
READER_USERreaderRead-only services (API, DVM, monitoring)
Terminal window
docker compose up -d

This starts:

  • PostgreSQL — database with schema initialization
  • PgBouncer — connection pooling in transaction mode
  • Prometheus — metrics collection and alerting

Services run individually. Start with the one-shot Seeder to bootstrap the relay list:

Terminal window
# Bootstrap relay discovery (one-shot, exits when done)
python -m bigbrotr seeder --once
# Start continuous relay discovery
python -m bigbrotr finder
# Validate discovered relay candidates
python -m bigbrotr validator
# Health monitoring with NIP-11 and NIP-66
python -m bigbrotr monitor
# Materialized view refresh
python -m bigbrotr refresher
# Event collection
python -m bigbrotr synchronizer

Check that services are writing data:

Terminal window
# Connect to the database
docker compose exec postgres psql -U admin -d bigbrotr
# Count discovered relays
SELECT count(*) FROM relay;
# Check service states
SELECT service_name, state_type, state_key, state_value, updated_at
FROM service_state ORDER BY updated_at DESC;
# View materialized view stats
SELECT * FROM relay_stats LIMIT 5;

Prometheus is available at http://localhost:9090. Each service can expose Prometheus metrics when enabled in its configuration:

# In any service config
metrics:
enabled: true
port: 8000 # default port
host: 127.0.0.1
path: /metrics

Metrics are disabled by default. When enabled, each service exposes a /metrics endpoint on the configured port (default 8000). Assign different ports if running multiple services on the same host.