An Android phone with at least 1GB of free storage. This guide works on any Android phone from the last 5+ years. No root required!
Install Termux
Termux is a terminal emulator for Android. It lets you run Linux commands on your phone - like having a mini computer in your pocket!
How to install:
- Open the F-Droid app store on your phone
- Don't have F-Droid? Download it from f-droid.org
- Search for "Termux" in F-Droid
- Tap "Install"
The Google Play Store version of Termux is outdated and won't work. Always use the F-Droid version.
Open Termux
Tap the Termux app to open it. You'll see a black screen with white text - this is your terminal!
You'll see a prompt that looks like this:
$
This $ symbol means Termux is ready for your commands.
Update Termux Packages
Before installing anything, let's make sure Termux is up to date. Type this command and press Enter:
pkg update && pkg upgrade
When asked "Do you want to continue? [Y/n]", type y and press Enter.
This updates the list of available software and upgrades any outdated packages. Think of it like updating apps on your phone.
⏱️ This might take 1-2 minutes depending on your internet connection.
Install Node.js
Node.js is the software that runs fonstr. Install it with this command:
pkg install nodejs-lts
Press y when asked to confirm.
⏱️ This will take 2-3 minutes to download and install.
✅ How to know it worked: After installation, type node --version and you should see something like v20.11.0
Run Your Nostr Relay!
Now for the fun part! Run your relay with just one command:
npx fonstr
The first time you run this, it will:
- Download fonstr (takes about 70 seconds)
- Set up everything automatically
- Start your Nostr relay!
✅ Success! When you see "Server listening at http://0.0.0.0:4444", your relay is running!
Your Nostr relay is now live at:
- Relay URL:
ws://localhost:4444/relay - Web interface:
http://localhost:4444
Connect to Your Relay
You can now use your relay with any Nostr client! Here's how:
On the same phone:
- Open your favorite Nostr app (Amethyst, Damus, etc.)
- Go to Settings → Relays
- Add relay:
ws://localhost:4444/relay
From other devices on your WiFi:
- Find your phone's IP address (Settings → About Phone → Status → IP Address)
- Use:
ws://YOUR-PHONE-IP:4444/relay - Example:
ws://192.168.1.100:4444/relay
Stopping and Restarting
To stop your relay:
Press Ctrl + C in Termux (or use the special keys in Termux's keyboard)
To start it again:
Just run the same command:
npx fonstr
💡 The second time is instant - no downloading needed!
Running in the Background
Want to keep your relay running while using other apps?
Option 1: Use Termux's session feature
Swipe from the left edge of Termux to see sessions. You can create a new session and switch between them.
Option 2: Run in background
nohup npx fonstr &
This runs fonstr in the background. To stop it, you'll need to use pkill -f fonstr
Running a relay will use battery. Consider plugging in your phone or running the relay only when needed.