Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

haven

> DevOps
Open source

High Availability Vault for Events on Nostr

192 stars0 likes0 views
WebsiteGitHub

About

High Availability Vault for Events on Nostr

HAVEN

[!IMPORTANT] HAVEN is considered feature complete and, going forward, Barry Deen's repository will only receive bug fixes. See the announcement here

HAVEN (High Availability Vault for Events on Nostr) is the most sovereign personal relay for the Nostr protocol, for storing and backing up sensitive notes like eCash, private chats, and drafts. It is a relay that is not so dumb, with features like web of trust, whitelisting, blacklisting, JSONL backup / restore (including periodic backups to the cloud), blastr note to others relays, and importing your old notes from other relays. It even includes its own blossom media server!

Four Relays in One + Blossom Media Server

Private Relay: This relay is only accessible by the owner of the relay and whitelisted npubs. It is used for drafts, ecash, and other private notes that nobody else can read or write to. It is protected by Auth.

Chat Relay: This relay is used to contact the owner of the relay and whitelisted npubs by DM. Only people in the web of trust can interact with this relay, protected by Auth. It only accepts encrypted DMs and group chat kinds.

Inbox Relay: This relay is where the owner of the relay and whitelisted npubs reads from. Send your zaps, reactions, and replies to this relay when you're tagging the owner or one of the whitelisted npubs. You can also pull notes from this relay if you want notes where the owner or whitelisted npub are tagged. This relay automatically pulls notes from other relays. Only notes where the owner or whitelisted npubs are tagged will be accepted to this relay.

Outbox Relay: This relay is where the owner's and whitelisted npubs notes all live and are publicly accessible. You can import all your old notes to this relay. All notes sent to this relay are blasted to other relays. Only the owner and whitelisted npubs can send to this relay, but anyone can read.

Blossom Media Server: This relay also includes a media server for hosting images and videos. You can upload images and videos to this relay and get a link to share them. Only the relay owner and whitelisted npubs can upload to this relay, but anyone can view the images and videos.

Not So Dumb Relay Features

Web of Trust: Protected from DM and Inbox spam by using a Web of Trust (WoT). See the Web of Trust Documentation for more details.

Access Control: Whitelist and blacklist npubs, ban them from a nostr list you publish, and delete any event from your relay. See the Access Control Documentation for more details.

Relay Management: Run the relay from a web page signed in with a nostr browser extension, or over the NIP-86 API: ban pubkeys, drop events, block addresses and rename each relay. The same page also browses the notes each relay is storing — filter, search, inspect and delete them — and graphs the relay on a dashboard: traffic, connections, accepted against rejected, the kind mix, top authors and storage, with 24-hour, 7-day and 30-day history that survives a restart. See the Relay Management Documentation for more details.

Inbox Relay: Notes are pulled from other relays and stored in the inbox relay.

Blastr: Notes sent to the outbox are also blasted to other relays.

Import Old Notes: Import your old notes and notes you're tagged in from other relays.

Backup/Recover: It is your data, manually export or import data JSONL at any time. Set periodic backups to the cloud for easy recovery. See Backup Documentation for more details.

Installation

Option 1: Download Pre-built Binaries (Recommended)

The easiest way to get started with Haven is to download pre-built binaries from our GitHub releases page:

Download Haven Releases

Installation Steps:

  1. Download the appropriate binary for your system from the releases page
  2. Verify the download (optional): See our Verification Documentation for instructions on how to verify the authenticity of the binaries using GPG signatures and checksums.
  3. Create a haven directory and extract the downloaded file:
    bash
    mkdir haven
    # For Linux/macOS:
    tar -xzf haven_[Platform]_[Architecture].tar.gz -C haven
    # For Windows: extract the .zip file to this directory

Option 2: Build from Source

If you prefer to build Haven from source or need to customize the build, please see the BuildDocumentation.

Option 3:

Check out some of the external community-built tools for managing Haven relays:

  1. Haven Docker: A lightweight Docker Compose setup with a TUI for configuration and management
  2. HAVEN For Mac: A user-friendly macOS application for managing your Haven relay with a native GUI and a ton of extra features
  3. Haven Start9 Wrapper: A Tor-only Start9 wrapper for Haven with its own Dashboard and Web UI
  4. HAVEN Kit: Set up a HAVEN Nostr relay with just a few clicks and no manual .env editing. Includes a web-based configuration UI for Docker, Podman, and Umbrel installs (via community app store), while the StartOS package is configured natively through StartOS Actions.

If you have built a Haven relay management tool that you would like to share, please open a PR to add it to this list!

[!NOTE] The Haven team does not officially support the tools listed above. They are community-built and maintained by third parties. Please refer to the respective repositories for installation instructions, documentation, and support. If you encounter any issues with these tools, please open an issue in their respective repositories.

Setup Instructions

Follow these steps to get the Haven Relay running on your local machine (after installing via binary download or building from source):

1. Copy .env.example to .env

You'll need to create an .env file based on the example provided.

bash
cp .env.example .env

2. Set your environment variables

Open the .env file and set the necessary environment variables.

3. Create the relays JSON files

Copy the example relays JSON files for your seed and blastr relays:

bash
cp relays_import.example.json relays_import.json
bash
cp relays_blastr.example.json relays_blastr.json

Customise the list of relays above as needed for your setup. The JSON should contain an array of relay URLs, which default to wss:// if you don't explicitly specify the protocol.

[!TIP] It is hard to keep an up-to-date list of working Nostr relays. Keep an eye on Haven's logs to see if any of the relays you're using are no longer working and replace them accordingly. There is no guarantee that the example relays will be up and running at all times (or at all), and it is up to the user to keep their relay list up to date.

4. Configure Access Control (optional)

Haven allows you to whitelist specific npubs to grant them full relay access or blacklist them to prevent any interaction with your relay.

See the Access Control Documentation for more details on how to set up whitelists and blacklists.

5. Run on System Startup

Linux – Create a Systemd Service

Click here to view the installation routine for Systemd

To have the relay run as a service, create a systemd unit file. Make sure to limit the memory usage to less than your system's total memory to prevent the relay from crashing the system. Replace the values for ExecStart and WorkingDirectory with the actual paths where you installed Haven and stored the .env file.

  1. Create the file:

    bash
    sudo nano /etc/systemd/system/haven.service
  2. Add the following contents:

    ini
    [Unit]
    Description=Haven Relay
    After=network.target
    
    [Service]
    ExecStart=/home/ubuntu/haven/haven #Edit path to point to where you installed Haven
    WorkingDirectory=/home/ubuntu/haven #Edit path to point to where you installed Haven
    MemoryMax=1000M  # Example, Limit memory usage to 1000 MB | Edit this to fit your machine
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
  3. Reload systemd to recognize the new service:

    bash
    sudo systemctl daemon-reload
  4. Start the service:

    bash
    sudo systemctl start haven
  5. (Optional) Enable the service to start on boot:

    bash
    sudo systemctl enable haven

macOS - Create a login item App

Click here to view the installation routine for macOS

To have the relay run on boot, create a script that will open the terminal and run the haven binary, the terminal will remain open and the relay running with it. Be sure the download /haven directory is located in the macOS home folder ~/

  1. Create the App: Open Script Editor

  2. Add the following contents:

    ini
    tell application "Terminal"
      activate
      do script "cd \"$HOME/haven\"; ./haven; exec $SHELL"
    end tell
  3. Save in the Applications folder

  4. Open System - Settings - General - Login Items Hit the plus, add run_haven from the Applications folder

  5. Reboot – On initial restart and terminal auto-open, choose “allow”

  6. Reboot again to test the login item

6. Set up a Reverse Proxy (optional)

To have a domain name (example: relay.domain.com) point to your machine, you will need to set up a reverse proxy.

Nginx

Click here to view the installation routine for Nginx

  1. Install nginx on your relay:

    bash
    sudo apt-get update 
    sudo apt-get install nginx
  2. Remove default config: sudo rm -rf /etc/nginx/sites-available/default

  3. Create new default config: sudo nano /etc/nginx/sites-available/default

  4. Add a new reverse proxy config by adding the following configuration to your nginx configuration file:

nginx
server {
    listen 80;
    server_name yourdomain.com;
    client_max_body_size 100m;

    location / {
        proxy_pass http://localhost:3355;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

[!IMPORTANT] X-Forwarded-For is set to $remote_addr, not the more common $proxy_add_x_forwarded_for. The latter appends the real client address to whatever the client sent, which lets a client prepend a forged one — Haven reads the leftmost entry, so the forgery would win. This matters for the rate limiters and for IP blocking.

Replace yourdomain.com with your actual domain name.

Note: client_max_body_size is set to 100m to allow for larger media files to be uploaded to Blossom. 0 can be used to allow for unlimited file sizes. If you are using Cloudflare proxy, be mindful of upload limits.

After adding the configuration, restart nginx:

bash
sudo systemctl restart nginx

Apache

Click here to view the installation routine for Apache

  1. Install Apache on your server
  2. Set up a vi

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goblossomblossom-servergonostr

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理