Skip to content

Quick Start

This guide walks you through deploying BigBrotr using Docker Compose. You’ll have a fully functional Nostr archiving system running in minutes.

  • Docker and Docker Compose installed
  • Git for cloning the repository
  • At least 4GB RAM recommended
  • 10GB+ disk space for initial data
Terminal window
git clone https://github.com/bigbrotr/bigbrotr.git
cd bigbrotr

Navigate to the BigBrotr implementation and create your environment file:

Terminal window
cd implementations/bigbrotr
cp .env.example .env

Edit the .env file to set your database password:

Terminal window
# Required: Set a secure password
DB_PASSWORD=your_secure_password_here
# Optional: For NIP-66 write tests
MONITOR_PRIVATE_KEY=your_hex_private_key

Launch all services with Docker Compose:

Terminal window
docker-compose up -d

This starts the following services:

ServiceDescriptionPort
postgresPostgreSQL 16 database5432
pgbouncerConnection pooling6432
torSOCKS5 proxy for .onion relays9050
initializerDatabase bootstrap (one-shot)-
finderRelay discovery-
monitorHealth monitoring-
synchronizerEvent collection-

Watch the initializer complete:

Terminal window
docker-compose logs -f initializer

You should see output indicating successful schema verification and relay seeding:

INFO initializer: schema_verified extensions=2 tables=7 procedures=6 views=1
INFO initializer: relays_seeded count=8865
INFO initializer: initialization_complete

Check all services are running:

Terminal window
docker-compose ps

Connect to PostgreSQL to verify data:

Terminal window
docker-compose exec postgres psql -U admin -d bigbrotr

Check relay count:

SELECT COUNT(*) FROM relays;
-- Expected: ~8865 initially
SELECT network, COUNT(*) FROM relays GROUP BY network;
-- Shows clearnet vs tor distribution

Check latest relay metadata:

SELECT relay_url, nip66_openable, nip66_readable
FROM relay_metadata_latest
WHERE nip66_openable = true
LIMIT 10;

After initialization, the services operate continuously:

  1. Finder discovers new relays every hour from nostr.watch APIs
  2. Monitor checks relay health every hour (NIP-11/NIP-66)
  3. Synchronizer collects events every 15 minutes from readable relays
Terminal window
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f synchronizer
Terminal window
docker-compose down
Terminal window
docker-compose down
rm -rf data/postgres
docker-compose up -d
Terminal window
docker-compose restart monitor

For a lightweight deployment that indexes events without storing tags and content (~60% disk savings):

Terminal window
cd implementations/lilbrotr
cp .env.example .env
nano .env # Set DB_PASSWORD
docker-compose up -d

LilBrotr uses different ports to avoid conflicts:

  • PostgreSQL: 5433
  • PGBouncer: 6433
  • Tor: 9051

See Implementations for detailed comparison.

For development or custom deployments:

Terminal window
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Set environment
export DB_PASSWORD=your_secure_password
# Run services (from implementations/bigbrotr/)
cd implementations/bigbrotr
python -m services initializer
python -m services finder &
python -m services monitor &
python -m services synchronizer &