nostrd is a daemon for hosting and operating Nostr services. Its first service is a
persistent Nostr relay backed by LMDB.
cargo install nostrdCheck all commands with:
nostrd --helpRun the relay with the built-in defaults:
nostrd relayUse a TOML configuration file:
nostrd --config /path/to/nostrd.toml relaySee nostrd.example.toml for all currently supported
options. Relative database paths are resolved from the configuration file directory.
The configuration is selected in this order:
--configNOSTRD_CONFIG/etc/nostrd/nostrd.toml./nostrd.toml- built-in defaults
Inspect or reindex the LMDB database while the relay is stopped:
nostrd --config nostrd.toml database stats
nostrd --config nostrd.toml database reindex/upgrades WebSocket connections and returns the NIP-11 document when requested withAccept: application/nostr+json./healthzreports process readiness.
Terminate TLS in a reverse proxy such as nginx or Caddy. The packaged configuration
binds to 127.0.0.1 for this reason.
docker compose up -dThe image runs as an unprivileged user and stores LMDB data in /data. Customize
packaging/docker/nostrd.toml before deploying it.
Build the package with:
cargo build --locked --release
cargo deb --no-buildThe package installs /etc/nostrd/nostrd.toml and nostrd.service. Enable the
service after setting its public URL and relay identity:
sudo systemctl enable --now nostrdFor an offline backup, stop the service and archive /var/lib/nostrd. Database
maintenance commands should also be run while the relay is stopped.
Nostr Dev Kit is free and open-source. This means we do not earn any revenue by selling it. Instead, we rely on your financial support. If you actively use any of the libs/software/services, then please donate.
This project is distributed under the MIT software license — see the LICENSE file for details