Nostr & Decentralized Social

Nostr RelayRun Your Own Nostr Server

Free open-source Nostr relay written in Go. Compare storage options, follow the setup steps and decide whether to run your own relay.

Free Open source Windows: Likely v0.0.267 Updated 18 Oct 2026
7 min read Last update 18 Oct 2026 github.com/mattn/nostr-relay

Nostr Relay is an open-source server for people who want to run their own relay on the Nostr network, the protocol where posts and messages pass between independent servers and apps. It is written in Go and built on the relayer framework, so it suits developers, community operators and self-hosters who want control over where their data lives. The project is free and released under the MIT license.

Nostr Relay accepts events from clients, stores them and serves them back to anyone who asks. You can choose SQLite for a simple single-machine setup, or PostgreSQL and MySQL when you already manage a database server. The sections below cover what the program does, how to set it up, and when a client program is a better fit.

02

What Is a Nostr Relay?

Nostr is a protocol in which users publish signed events, such as short posts, profile updates and direct messages. Those events travel through relays, which are servers that receive, store and forward them. A user typically connects to several relays at once, so no single server controls their identity or their audience.

A relay is therefore a piece of shared infrastructure. It does not need to be large to be useful. A small server with a few thousand events can serve a family group, a club or a project team just as well as a busy public relay does.

03

Who Should Run Their Own Relay?

Running a relay makes sense for a few kinds of people. A community that wants its own space on Nostr can host a relay so its members publish to a server they trust. A developer building a Nostr app may run a local relay to test publishing and subscriptions without depending on public servers.

Privacy-minded individuals sometimes run a relay for their own archive, keeping a copy of the events they care about. Small organizations may prefer a relay they control, especially when internal communication needs a predictable home. Each of these cases involves ongoing responsibility for uptime, storage and security.

04

How a Relay Handles Events in Practice

When a client publishes an event, the relay checks that the event is well formed and signed, then stores it. When a client subscribes with a filter, the relay searches its storage and sends matching events back. This loop is the core job, and most operational questions come down to how efficiently it runs.

Storage grows steadily, so plan for disk space and decide how long to keep old events. Many operators start small, watch their database size for a few weeks, and then adjust. Testing with a few clients before opening the relay to the public gives you a clearer picture of real traffic.

05

Key features

Several storage backends

Nostr Relay can keep events in SQLite, PostgreSQL, MySQL or OpenSearch. That choice shapes how the relay grows and which tools you need to maintain. SQLite keeps everything in one file that is easy to move and inspect. Server databases fit larger communities that already have database administration in place.

Optional SQLite backups with Litestream

If you run on SQLite, the relay can pair with Litestream to back up its database. Backups matter more than many operators expect, because a relay that loses stored events cannot recover them from clients. Decide whether to enable this before you go live.

Built on the relayer framework

The relay is based on relayer, a Go framework for building Nostr relays. Its code is organized around that foundation, so developers who want to change behavior can start from a known structure rather than writing protocol handling from scratch.

Free and MIT-licensed

The program costs nothing and ships under the MIT license, which permits private and commercial use with few restrictions. The source code is on GitHub, so you can read it, adapt it or fork it. Review the license text yourself before redistributing modified copies.
06

Supported coins

Nostr Relay is built for the Nostr network, which the project's documentation names as the network it serves. The relay stores and forwards Nostr events, not cryptocurrency or wallet balances. Anything you publish through it is a Nostr event, not a financial transaction.

07

How to install Nostr Relay on Windows

  1. 1

    Download the release

    Download only from the official website or the project's GitHub Releases page. Choose the newest tagged version, which was v0.0.267 at the time of writing, and confirm the current version on the releases page before you start.

  2. 2

    Verify the file

    Compare the SHA-256 checksum of the downloaded file with the value published on the release page. If the project provides a signature, check it as well. If the values do not match, do not run the file.

  3. 3

    Look for a Windows build or use Docker

    The project lists Windows support as likely rather than confirmed, and it lists Docker as a platform. Check the release assets for a Windows archive first. If none is available, run the relay in Docker, which the project supports, instead of assuming a native build exists.

  4. Prepare the database and start the relay

    Place the program in a folder you control, then create the database before the first start. Point the relay's configuration at that database. The required tables must exist before the relay runs, so create them as part of setup.

08

System requirements

  • Docker, listed by the project as a supported platform
09

How to use Nostr Relay

Once the database is ready, the relay is a server you start and then point clients at. The steps below describe the typical flow for a self-hosted relay, following the setup order the project describes.

  1. Start the relay with your database configuration.
  2. Confirm that the required tables exist in the database before you accept traffic.
  3. If outside clients need to connect, make the relay reachable by opening its port on your router or firewall.
  4. Add your relay's address to a Nostr client such as Gossip or Amethyst.
  5. Publish a test note from the client, then check that it appears when you query the relay.
  6. If you use SQLite, enable Litestream and confirm that backups are being written.
  7. Keep a record of your configuration so you can rebuild the server if it fails.
10

Pros & cons

Pros
  • Free and MIT-licensed, with source code available on GitHub
  • Choice of SQLite, PostgreSQL, MySQL or OpenSearch storage
  • Optional SQLite backups through Litestream
  • Built on the relayer framework, giving developers a clear starting point
Cons
  • Windows support is listed as likely, so you may need Docker or a manual build
  • Database tables must be prepared by hand before the first run
  • Running a public relay means ongoing work on uptime, storage and security
11

Is Nostr Relay safe?

Download only from the official website or the project's GitHub repository, and use the Releases page for compiled files. Compare the SHA-256 checksum or verify the signature before you run anything. A relay does not manage cryptocurrency funds, but it stores data and accepts network connections, so it still deserves care. Keep database passwords out of shared files, avoid exposing the database port directly to the internet, and apply updates when they arrive. Because the project's code is actively maintained, check the latest version on the official website before you deploy.

  • Official source only. Download from github.com/mattn/nostr-relay. Ignore ads and lookalike domains.
  • Check the SHA-256. Compare the installer hash with the value the developer publishes before running it.
  • Never share your seed phrase. No developer, support agent or website — including CryptApps — will ever ask for it.
12

Alternatives

Most programs in this catalog are Nostr clients. Amethyst, Gossip and Vega are apps where you read and post, while Nostr Relay is server software that stores events for those clients. Nostr Commander RS and NAK are command-line tools. NAK is useful for publishing or querying test events against a relay you run, and Nostr Commander RS focuses on posting from a terminal. Nostr VPN and Blockcore Notes solve different problems, networking and a web-based app. If you want to read and post, choose a client. If you want to host infrastructure, this is the relevant starting point.

13

Specifications

Price
Free
Type
Open source
License
MIT
Latest version
v0.0.267
Last update
18 Oct 2026
Windows support
Likely (builds for Windows; check releases)
Source code
github.com/mattn/nostr-relay
14

Frequently asked questions

Nostr Relay is server software that stores and serves events for the Nostr network. People run it to host a relay for a community, to keep a personal archive, or to test Nostr apps during development. Clients connect to it the same way they connect to any other relay.

Yes. The program is free and released under the MIT license, and its source code is on GitHub. Hosting costs such as a server, storage and bandwidth depend on your provider and are separate from the software itself.

Windows support is listed as likely rather than confirmed. Check the releases page for a Windows build first. If none is available, run the relay with Docker, which the project lists as a supported platform and which works on Windows.

It supports SQLite, PostgreSQL, MySQL and OpenSearch. SQLite is the simplest choice for a single server, while PostgreSQL and MySQL suit setups where a database server already exists. The database and its tables must be ready before the relay starts.

Open source code can be inspected by anyone, which is a real advantage. Whether your deployment is safe depends on how you install it, how you secure the database, and how quickly you apply updates. Start with the checksum and verification steps in the installation section.

Yes, when you use SQLite. The relay can optionally use Litestream to back up its SQLite database. Enable it during setup and confirm that backups are being written before you rely on them.

No. Nostr Relay is the server side that stores and forwards events. To read and post, you need a client such as Gossip, Amethyst or Vega, and you point that client at your relay.

15

Verdict

Nostr Relay suits developers, community operators and self-hosters who want their own Nostr relay with a choice of databases. It is free, MIT-licensed and written in Go, and it supports optional SQLite backups. It is less suited to people who only want to read and post, since a client is the better tool for that. Plan for database setup and ongoing server maintenance before you commit.

Download now