Ansible playbook to deploy a strfry nostr relay tailored to indexing kind 10002.
Please do not deploy this unless you expect to be serving a significant number of requests (for example, if you run a popular client). The nostr network only needs a few indexers to be available; any more only add unnecessary load on any mirrors that are configured.
- Python 3.10+
- uv package manager
- Debian/Ubuntu target system
- Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install dependencies:
uv install
- Create a virtual environment:
uv venv
- Fill in your server details in
inventory/hosts.yml
- Customize the deployment in
roles/strfry/defaults/main.yml
- Set your relay's domain name in
roles/nginx/defaults/main.yml
Run the playbook:
uv run ansible-playbook -i inventory/hosts.yml site.yml
This will:
- Install system dependencies
- Create strfry user and directories
- Clone and build strfry from source
- Start a strfry relay that only accepts kind 10002
- Start a strfry router that replicates kind 10002 events to/from selected relays
- Set up a nginx reverse proxy with a SSL certificate for your domain