Installation
Requirements, building from source, installing a pre-built binary, and notes for FreeBSD.
Requirements
- A recent stable Rust toolchain (only needed to build the relay).
- A Linux machine.
- 2 GB of RAM or more is recommended — see the low-spec note below for a 0.25 vCPU / 512 MB VPS.
Low-spec VPS (0.25 vCPU / 512 MB)
nostrfy is verified to run stably even when the database exceeds RAM. The LMDB map is a sparse 1 TiB virtual reservation — physical disk grows only with the data written — and process memory stays flat: a relay with a 252 MB database held 7.9 MB of private RSS (the rest is reclaimable file cache the kernel evicts under pressure).
For a tiny VPS, one setting makes the biggest difference:
[database]
search_index = false # halves the database size and saves CPU/IO| Setting | Effect | Measured |
|---|---|---|
search_index = false | Disables the NIP-50 word index — search still works (whole-word matching) but is slower | 41.8 MB → 20.5 MB per 10,000 events |
| Defaults | Already tuned for low memory | No change needed for 512 MB |
Building from source
git clone https://github.com/iqbqioza/nostrfy.git
cd nostrfy
cargo build --releaseWhen the build finishes, the binary is at target/release/nostrfy.
Installing a pre-built binary
The release workflow attaches pre-built binaries for Linux x86_64, Linux aarch64 and FreeBSD x86_64. The same install.sh works on both OSes — it detects the platform, downloads the matching
binary and verifies its checksum:
curl -fsSL https://raw.githubusercontent.com/iqbqioza/nostrfy/main/install.sh | shFreeBSD
nostrfy builds and runs on FreeBSD 13.x and 14.x (amd64). Install Rust and build with:
pkg install -y rust
cargo build --releasePlatform notes:
- The process-alive check used by
start/stop/restartreads the process name via thekern.proc.pid.<pid>.commsysctl on FreeBSD (it uses/proc/<pid>/common Linux), so a stale pid file whose pid was reused by another program is detected on both platforms. nostrfy startdaemonizes like on Linux; the standard double-fork daemon works with the defaultrcintegration (service nostrfy start).- Blossom's
min_free_bytescheck usesstatvfs, which both systems provide; no other platform-specific code is used (the relay itself is plain async Rust on top of tokio).
Running on port 80
Regular users cannot bind port 80. Either run with sudo, or use a higher port such as 8080.
nostrfy --config nostrfy.toml startExample: run on port 8080 (works for regular users; change port in the config first).