Haven: Difference between revisions
Haven, featuresfull and lightweight Nostr relay + Blossom server in Go |
(No difference)
|
Latest revision as of 19:42, 26 February 2026
Haven it's a Nostr relay with plenty of features, supporting notes, articles (long-form), chat, private messages, and acting as a media server (Blossom). As of February 2026, the project is active and considered feature-complete, meaning it's being maintained for bug fixes but won't be adding new functions. It can therefore be considered stable and a solid starting choice for exploring the Nostr and WoT ecosystem (which serves as anti-spam for Haven).
It will likely be replaced by MOAR (Mother Of All Relays) by the same author, which is currently in the early stages of development.
It doesn't require any special configuration or specific dependencies; you just need a web server (typically Nginx, Apache or Caddy) in front to handle SSL and ACME integration to get non-self-signed certificates. Haven listen to one port only, by default 3355.
Default URLs to be configured in clients are:
- [ws{s,}://]domain.tld (internally for instance localhost:3355) as outbox relay and Blossom server
- domain.tld/private owner-only drafts - requires AUTH
- domain.tld/chat
- domain.tld/inbox
Clients are many, only few with a big features set (Amethyst on mobile, Gossip on desktop), many are publicly available as web apps, no special login, Nostr use just the public key (generally in npub form) to view only, and the private one (in the nsec form in general) to post. For web clients browsers extensions like Flamingo are good companion to sign every post etc without hassle. On mobile a similar role is fulfilled for instance by Amber.
Get started
A common config could be
services.haven = {
enable = true;
# the relays where you want to broadcast your notes
blastrRelays = [
"choose.some.relay"
"and.some.other"
];
# if any, your old relay to imports notes from
importRelays = [
"your.old.relay"
];
settings = {
RELAY_URL = "nostr.yourdomain.tld";
OWNER_NPUB = "npub...";
RELAY_PORT = "9999"; # if you want to change it
RELAY_BIND_ADDRESS = "127.0.0.1";
PRIVATE_RELAY_NAME = "Some arbitrary name";
PRIVATE_RELAY_DESCRIPTION ="With optional description";
# ...
# see https://github.com/bitvora/haven/blob/master/.env.example
# for (nearly) all the options
}; # settings
}; # services.haven
The if you plan to use NGINX as a reverse proxy (obviously suggested):
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."nostr.yourdomain.tld" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:21498";
proxyWebsockets = true;
}; # locations."/"
}; # virtualHosts."nostr.yourdomain.tld"
}; # services.nginx
You might want to add two locations, one for the relay favicon.ico and one for /.well-known/nostr.json to get a verified nostr user badge on clients and proper WoT setup.
The JSON (could be returned directly by NGINX) contains some personal infos like
{
"names": {
"yourName": "YourHexFormatPubKey"
},
"relays": {
"YourHexFormatPubKey": [
"wss://nostr.yourdomain.tld",
"wss://relay.nos.social",
"wss://relay.damus.io"
]
}
}
Obviously to run the service behind NAT you need proper NAT setup on your router, having fw ports opened etc.
You can test your new relay with nak like nak req -k 1 --limit 1 wss://nostr.yourdomain.tld
To convert public/private keys forma you can use key-convertr not packaged so far, but very quick to get up and you need only once probably, it's just cloning the repo, entering a nix-shell -p cargo the cargo build --release and you get the binary in target/release.
To mine keys rana is another simple tool. Being a young ecosystem things change faster and there are a gazillion of tools. If you want to take part in the Nostr economic model, you can also self-host a bitcoin-core node and a Lightning node (e.g., Alby Hub, so you also have a WebUI for channel management) and link your Lightning address to Nostr to be able to send and receive Zaps.
The rest is up to you to explore. Most Nostr client allow search for notes/profiles/keys, few like noogle allow classic keyword search, some applications allow modern chat also with VoIP (see 0xchat and White Noise for instance) but it's impossible to pack all Nostr informations here and keep them up to date. Haven is the haven of your Nostr experience for a classic *nix users start.