Quick start

From install to a live relay in minutes: config, validation, start, stop and a health check.

1. Create a configuration

nostrfy init writes a default, fully-commented nostrfy.toml:

sh
nostrfy --config nostrfy.toml init

Open it in a text editor and adjust it — every option is commented.

2. Validate the config

nostrfy check is strongly recommended before starting; if anything is wrong, it reports exactly what is wrong.

sh
nostrfy --config nostrfy.toml check

3. Start the relay

sh
nostrfy --config nostrfy.toml start

Runs as a daemon. Add --foreground to run in the terminal.

Then verify the relay is up with the health endpoint:

sh
curl http://127.0.0.1:8080/health

=> {"status":"ok"}

4. Point a client at it

From the same machine, connect to ws://<host>:8080. The default host is 127.0.0.1, which only accepts local connections. To reach the relay from other machines, set server.host = "0.0.0.0" in the config:

toml
[server]
host = "0.0.0.0"

For wss:// you need a TLS-terminating proxy (nginx or Caddy) in front — see the deployment docs.

5. Stop and restart

sh
nostrfy --config nostrfy.toml stop
nostrfy --config nostrfy.toml restart
kill -HUP $(cat nostrfy.pid)  # reload the config without a restart

restart re-reads the config; SIGHUP reloads most settings without restarting.

Effectively operating it

  • nostrfy stats shows live statistics — also available over HTTP as /relay/stats and /metrics.
  • The log runs to daemon.log_file with automatic rotation.
  • RUST_LOG controls the log level (e.g. RUST_LOG=nostrfy=debug).
External clients can't connect?
The default server.host is 127.0.0.1. Set host = "0.0.0.0" and restart.
Next
Tune every aspect of the relay in the configuration reference.