How To Run A Private Nostr Relay

Run a private nostr relay

Share this article

Nostr, which stands for “Notes and Other Stuff Transmitted by Relays“, is a social media protocol that doesn’t rely on a central server, nor is it a peer-to-peer architecture. It relies on distributed servers known as relays which allow users to exchange signed messages with one another.

Using these networks of relays, which are servers, anyone can install and run; content is distributed and duplicated across these relays. Decentralising content and ensure that your content is censorship resistant. As long as one relay remains active and hosts your content, there is still a way people can use Nostr clients to source the content and display it on their preferred device.

Relays come in a variety of types and can be run on different infrastructures, but by far, the most censorship-resistant of them all is the private relay.

What is a private relay?

A private relay is a personal server and storage that only you can grant access to, you select the users who can commit notes to this relay, and you control what data is stored on this relay. You can remove content, revoke (blacklist) users from your relay or only use it for your personal content.

The relay will only save notes from a specified private key and ignore all others but let anyone request the notes have been saved on this relay to allow it to be rendered and read by different clients. The software will accept settings from a file or environmental variables and be connected to a PostgreSQL database.

Private relays are great for:

  • Those who want to archive their complete Nostr account
  • Those who do not wish to use paid relays
  • Those who want a controlled backup copy of their Nostr account
  • Those who post content that might have themselves de-platformed by specific relays

How to set up your private relay

Umbrel, the popular home server software that many bitcoiners use to run their bitcoin node or Lightning node at home, has recently added support for Nostr relays. Once installed and connected to your preferred client, you will be able to post content using the Nostr protocol and store the data on your own server and hard drive.

Clients would be able to fetch the data when needed and display it in feeds.

While running a private relay, you can still broadcast the same content to public relays or paid relays you are connected to. There is no limit to the mix of relays you can use, while the amount of relays you want to connect to is also a personal preference.

Umbrel launches their nostr relay app.

If you want to start running a private relay and you already have an Umbrel node running, then follow these steps.

  1. Login to your Umbrel node.
  2. Head over to apps and install Nostr relay.
  3. Boot up the Nostr relay app.
  4. Copy your relay URL
  5. Open your preferred Nostr client on desktop or mobile.
  6. Add the URL to your preferred client under the relay section and save.
  7. Post from your preferred client and check if notes are starting to broadcast to your relay.

How to access your relay remotely?

If you’re only using Nostr while connected to your home network, you will always be able to broadcast to your private relay. Still, when you’re out of the range of your home WiFi or using a different connection to the one shared by your node, you will be disconnected from your private relay.

That is not to say you cannot read and write on Nostr. If you have other public or paid relays connected to your client, your posts will still be pulled or written to those relays instead, while your private relay cannot be reached. So moving away from your home network shouldn’t impact your Nostr experience, so feel free to Nostr from anywhere.

If you are not happy with the idea of being disconnected from your precious private relay or you want to give users access to your private relay but they don’t have local access by being connected to your WiFi, and you need to grant them remote access.

You can do that by leveraging another Umbrel app.

Go back to your Umbrel app store and install Tailscale. This app will allow you to create a VPN connection, and through that connection, you can access your private remotely.

Tailscale does offer a free account so that you can connect several of your devices without much extra expense. Still, if you’re planning to allow several people on your network, you will need to upgrade your account to a paid subscription to accommodate these additional connections.

Tailscale and Umbrel

  1. Sign up to Tailscale and create an account or purchase a subscription if needed.
  2. Open up your Umbrel node, and head to the app store.
  3. Install Tailscale on your Umbrel node, following the Linux instructions, and on a connected device like your phone.
  4. Enable Tailscale’s MagicDNS and use ws://umbrel:4848 as your Relay URL.

Note: If you need additional help with MagicDNS, you can find a tutorial below

How to use MagicDNS with Tailscale
  1. Once set up, you can go about using various Umbrel apps remotely, replacing umbrel.local in your connection strings with the Tailscale IP for your node (e.g. 100.123.300.4).
  2. Open a browser and test if you can access the Nostr relay app with your Tailscale IP, if it checks out on your device, then add the relay URL to your preferred client.
  3. Make sure you have tailscale setup correctly and make sure your relay is ws:// and not wss:// – some clients default to inputting wss://
  4. As an example, your relay URL should look something like this – ws://100.123.300.4:4848
  5. Once you’ve connected your relay, perform a test post and check if the posts are beginning to feed through to your private relay.

Not your relay, not your notes

How you embrace decentralisation remains firmly on a spectrum, and you decide your level of involvement. If you’re simply trying out Nostr for the first time, then public and paid relays should cover most of your bases.

Alternatively, if you’re planning on using this as your primary social media tool, or you’re looking to post content that might not get much support from those who manage relays, or you want complete control over the content you and your family create, then a private relay is the better option.

Nostr, like bitcoin, can only be used to express your beliefs if you’re the custodian of your data. Unless you’re storing your notes in a place that you control, you’re always trusting others to handle those notes for you.

As bitcoin maxis like to say, “Not your keys, not your coins”, or as Nostr maxis would say, “not your relay, not your notes”.

Are you on Nostr?

If you are a Nostr user and want to hang out and chat with us or follow our content on your preferred Nostr front end, feel free to add us using our PubKey below.

7ecd3fe6353ec4c53672793e81445c2a319ccf0a298a91d77adcfa386b52f30d

The Bitcoin Manual’s Nostr Pubkey

Please give us your notes.

If you have used Nostr, which client do you prefer and why? Are there any clients that you think deserve mention? Let us know in the comments down below.

Disclaimer: This article should not be taken as, and is not intended to provide any investment advice. It is for educational and entertainment purposes only. As of the time posting, the writers may or may not have holdings in some of the coins or tokens they cover. Please conduct your own thorough research before investing in any cryptocurrency, as all investments contain risk. All opinions expressed in these articles are my own and are in no way a reflection of the opinions of The Bitcoin Manual

Leave a Reply

Related articles

You may also be interested in

Alby Sunsets Custodial Wallet

Alby To Sunset Custodial Wallet

Dear Alby Users, We always knew this day would come when the training wheels would have to come off, and that day is set in

Cookie policy
We use our own and third party cookies to allow us to understand how the site is used and to support our marketing campaigns.