🚀 Deploy FREE Nostr Blossom Relay to Zeabur

One-Click Deployment Checklist & Configuration Guide

📡 What is Swarm?

Swarm is a private Nostr relay with integrated Blossom media server for teams. Control access via your domain's .well-known/nostr.json, configure user access or custom permissions, and sync media between relays via an embedded bouquet client. Works with any Nostr client. Includes a link to the Curator client to help quickly check relay content and post notes. Default is badger db and filesystem for media, but you can easily switch to a postgreSQL database and S3 storage for media.

One-shot AI Deploy

First, Sign up to the AI Dev ops platform here: Deployed on Zeabur

Deploy this repository https://github.com/HiveTalk/swarm and please use the zeabur-dashboard branch. 

Name it MyTestRelay. Automatically assign a zeabur domain to the MyTestRelay service. 

Set the following environment variables.

RELAY_NAME="MyTestRelay"
RELAY_PUBKEY="3878......"

Paste into Zebur.com's AI for deploy

  1. Wait until Deployed. Might take a while...Once the zeabur domain name is set, make sure the **BLOSSOM_URL** environment variable is set to the zeabur domain name provisioned.
  2. blossom

  3. If you want to keep using the default settings please mount these volumes, so that the data is not wiped out every time you redeploy.
  4. Volumes

  5. Verify your relay - Jump to Step 3 below.

💰 Zero Cost Relay

â–ŧ

Running a Nostr relay doesn't have to be expensive. By leveraging the free tiers of several modern cloud platforms, you can host a fully functional Swarm relay for $0/month. This is made possible by the generous free usage limits provided by Zeabur, Neon, and Tigris.

Zeabur (Deployment & Hosting)

Zeabur provides a free tier that is perfect for small relays. It includes enough resources to run the Swarm container and handle initial traffic without any cost.

Zeabur Pricing

View Zeabur Pricing

Neon.com (PostgreSQL Database)

Neon offers a serverless PostgreSQL database with a generous free tier. It includes 0.5 GiB of storage, which is more than enough for a starter relay's event metadata.

Neon Pricing

View Neon.com Pricing

Tigris (S3-Compatible Storage)

For Blossom media storage, Tigris offers an S3-compatible API with a free tier including 5GB of storage and generous transfer limits.

Tigris Pricing

View Tigris Pricing

Note: I am not associated with any of these companies. I simply wanted to share how it's possible to easily deploy a zero-cost relay for starters and show how easy the process can be.

Manual Deployment Guide

đŸŽ¯ Step 1: Initial Deployment

â–ŧ
â„šī¸ Note: The initial deployment uses Badger DB and filesystem for Blossom media storage. This is fine for testing but should be configured for production use.

âš™ī¸ Step 2: Configure Essential Environment Variables

â–ŧ
  • Navigate to your Zeabur Project dashboard
  • Click on your deployed service
  • Go to "Variables" tab
  • Add/update the following required variables:

Required Variables:

RELAY_NAME="Your Relay Name" RELAY_PUBKEY="your_relay_public_key_here" NPUB_DOMAIN="yourdomain.com" # optional if you have it, if not leave blank.
âš ī¸ Important: The NPUB_DOMAIN should match your domain and reference the /.well-known/nostr.json file to indicate which users have access.
  • Click "Save" or "Update" after adding variables
  • Trigger a redeploy from the dashboard
🔧 Don't have a domain with nostr.json yet?

You can set up a NIP-05 service either with the built in one on the relay or set up your own nip05-service repository.


Here's how to Configure nostr.json on the relay

First, set a volume for the relay to save the nostr.json file, in case we redeploy.

Setup Public Domain

You Must setup a domain for your relay to function.

  • Navigate to the "Networking" tab in your service dashboard
  • Verify the port is set to 3334 (HTTP)
  • Under "Public" section, click "Generate Domain" for an automatic domain, or click "Custom Domain" to use your own
  • Wait for the domain to be activated
💡 Domain Setup: Your relay needs a publicly accessible domain to function. Zeabur can generate one automatically (e.g., swarm123.zeabur.app) or you can configure your own custom domain.
Zeabur Networking Tab

đŸ—„ī¸ Optional: Database Configuration

â–ŧ

Best for production use, consider upgrading from the default Badger DB:

Option A: Zeabur PostgreSQL (Recommended for beginners)

  • In your Zeabur project, click "Add Service"
  • Select "PostgreSQL" from the marketplace
  • Wait for PostgreSQL to provision
  • Zeabur will automatically inject database connection variables, if issues chat with Zeabur's AI assistant Also see guide for details here: ENV_CONFIG_GUIDE.md
  • Redeploy your application

Option B: External PostgreSQL (Neon.com)

  • Sign up at neon.tech
  • Create a new database
  • Copy the connection string
  • Update Zeabur environment variables. Also see guide for details here: ENV_CONFIG_GUIDE.md
    DB_ENGINE=postgres DATABASE_URL=postgres://user:pass@host:5432/db?sslmode=disable
  • Redeploy your application

đŸ“Ļ Optional: S3 Storage Configuration

â–ŧ

Replace filesystem storage with S3-compatible storage for Blossom media:

Using Tigris Data

  • Sign up at tigrisdata.com
  • Create a new bucket
  • Generate access credentials, make sure you have write access granted to the bucket
  • Add S3 configuration to Zeabur environment variables: Also see guide for details here: ENV_CONFIG_GUIDE.md
S3_ENDPOINT="your_s3_endpoint" S3_BUCKET="your_bucket_name" S3_ACCESS_KEY="your_access_key" S3_SECRET_KEY="your_secret_key"
  • Also remember to update Blossom configuration:
BLOSSOM_ENABLED=true BLOSSOM_URL=https://swarm123.zeabur.app (use your actual deployed URL)
  • Save variables and redeploy
💡 Pro Tip: Zeabur's AI assistant can guide you through setting up PostgreSQL and S3 storage directly in the dashboard!

✅ Step 3: Verify Deployment

â–ŧ
  • Check deployment logs for any errors
  • Visit your deployed application URL
  • Verify relay name and description appear correctly
  • Test basic functionality
  • Confirm user access via /.well-known/nostr.json
🎉 Success! Your Swarm Nostr relay is now deployed and configured on Zeabur!

🆘 Troubleshooting

â–ŧ
Common Issues:
  • If deployment fails, check the logs in Zeabur dashboard
  • Ensure all required environment variables are set correctly
  • Verify your domain's .well-known/nostr.json file is accessible
  • For database connection issues, verify your DATABASE_URL format
  • For S3 issues, confirm your credentials and endpoint are correct