Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sandwichfarm/nostr-watch/llms.txt

Use this file to discover all available pages before exploring further.

@nostrwatch/docker-stacks provides a collection of Docker Compose configurations for deploying nostr-watch services. Each stack directory is self-contained with a docker-compose.yaml, sample .env and config.yaml files, and all necessary service definitions. Stacks range from simple clearnet relay monitoring to multi-network setups that route traffic through Tor and I2P via hedproxy. Every stack needs exactly two things configured: a .env file for secrets and a config.yaml for application behavior.

Prerequisites

  • Docker Engine >=24
  • Docker Compose v2 (the docker compose subcommand — not the legacy standalone docker-compose binary)

Available stacks

Stack directoryServicesDescription
relaymon-clearnet/RelayMonStandard clearnet relay monitoring
relaymon-vpn/RelayMon, GluetunRelay monitoring routed through a VPN
relaymon-multinet/RelayMon, Tor, I2PMulti-network monitoring (clearnet + Tor + I2P)
trawler-relaymon-clearnet/Trawler, RelayMonRelay crawler and monitor on clearnet
trawler-relaymon-multinet/Trawler, RelayMon, Tor, I2PRelay crawler and monitor with multi-network routing

Quick start

1

Choose a stack

Navigate to the stack directory that fits your deployment. For a minimal setup, start with relaymon-clearnet.
cd apps/docker-stacks/relaymon-clearnet
2

Copy sample files

cp .env.example .env
cp config.yaml.example config.yaml
3

Edit .env

At minimum, set RELAYMON_NSEC to your nsec private key. Do not commit this file.
# .env
RELAYMON_NSEC=nsec1...
4

Edit config.yaml

Set your monitor slug, owner pubkey, publisher relays, and seed sources. Each stack directory includes a fully commented config.yaml.example template.
5

Start the stack

docker compose up -d
6

View logs

docker compose logs -f

Environment variables reference

Environment variables are set in the .env file. Never commit .env files — only commit .env.example templates.

RelayMon

VariableRequiredDescription
RELAYMON_NSECYesSigning key (nsec1... or hex) for publishing NIP-66 check results
RELAYMON_KUMA_PUSH_URLNoFull Uptime Kuma push URL
RELAYMON_KUMA_BASE_URLNoUptime Kuma base URL (used with RELAYMON_KUMA_TOKEN)
RELAYMON_KUMA_TOKENNoUptime Kuma push token
RELAYMON_HEALTH_AUTH_TOKENNoToken for authenticating health endpoint requests
All RelayMon variables support _FILE suffix variants for Docker/Kubernetes secrets. For example: RELAYMON_NSEC_FILE=/run/secrets/nsec.

Trawler

VariableRequiredDescription
DEAMON_PUBKEYNoDaemon public key for publishing relay lists
DEAMON_PRIVKEYNoDaemon private key for signing
REDIS_HOSTNoRedis host (default: localhost)
REDIS_PORTNoRedis port (default: 6379)
REDIS_DBNoRedis database number (default: 0)
REDIS_PASSWORDNoRedis password

Compose-managed variables

These are set directly in docker-compose.yaml and generally do not need to be changed:
VariableDefaultDescription
RELAYMON_MODEvariesclearnet or multinet — determines proxy setup
RELAYMON_CONFIG_PATH/opt/config.yamlPath to config file inside the container
RELAYMON_DB_PATH/opt/data/relays.dbPath to RelayMon’s SQLite database inside the container
RELAYMON_SKIP_PID_CHECKtrueSkip PID file check (required in containers)
TRAWLER_CONFIG_PATH/opt/trawler-config.yamlTrawler config path inside the container
TRAWLER_DB_PATH/opt/data/trawler.dbTrawler database path inside the container

Application config (config.yaml)

Controls application behavior — monitor identity, seed sources, check types, and intervals. Each stack directory includes a config.yaml.example with all available options commented. Key sections:
SectionDescription
monitorMonitor identity: slug, name, owner pubkey, and announcement relays
publisherRelays that receive check result events (Kind 1066, Kind 20166)
relaymon.networksNetworks to monitor: clearnet, tor, i2pd
relaymon.seedHow the relay list is populated: events, config, db
relaymon.checksWhich checks to run (open, read, info, dns) with intervals and timeouts
relaymon.retryBackoff strategy for failed relay connections
For the full relaymon config reference, see Run relaymon.

Multi-network stacks

The multinet stacks route relay connections through multiple overlay networks using hedproxy, which runs inside the RelayMon container and selects the correct proxy based on the relay URL domain:
NetworkRouting
ClearnetDirect connections — no proxy
Tor.onion relay URLs routed through the tor-proxy container (SOCKS5 on port 9050)
I2P.i2p relay URLs routed through the i2pd container
The proxy configuration files in config/ (danted.conf, proxychains.conf, torrc) are pre-configured and generally do not need modification.
The multinet stacks include Tor and I2P containers, but firewall and network configuration on the host may be required depending on your environment.

Data persistence

All stacks mount ./data:/opt/data for persistent storage. The data/ directory is created automatically on first run.
  • RelayMon-only stacks: a single relays.db database
  • Trawler + RelayMon stacks: separate trawler.db and relaymon.db on the same volume to avoid SQLite locking conflicts — RelayMon reads trawler’s database as a read-only seed source
Images are pulled from Docker Hub (nostrwatch/relaymon, nostrwatch/trawler) on first run. An internet connection is required during the initial docker compose up.

Stopping and cleanup

docker compose down

Gluetun (VPN stack)

The relaymon-vpn stack routes RelayMon traffic through a VPN via Gluetun. A .env.gluetun.example file is provided in the relaymon-vpn stack directory with provider-specific variable templates. See the Gluetun wiki for full provider documentation.

Build docs developers (and LLMs) love