How to Run a Full Nostr Stack on a $5 VPS (With Real Numbers)
How to Run a Full Nostr Stack on a $5 VPS (With Real Numbers)
I’ve been running a complete Nostr infrastructure stack on a single 2GB Hetzner VPS for weeks. Here’s exactly what’s on it, what it costs, and what I’ve learned.
The Stack
On one box (2 vCPU, 2GB RAM, 20GB disk):
- Nostr DVM (NIP-90 content discovery) — processes ~2,500 requests/day
- Paid Nostr Relay — accepts 100 sat Lightning payments
- 15 free web tools — DNS, SSL checker, SEO analyzer, screenshots, etc.
- XMR miner — CPU mining in the background (~1,054 H/s)
- Blog, Nginx reverse proxy, PM2 — routing and management
Total monthly cost: $4.51 (Hetzner CX22)
Real Performance Numbers
Memory
PM2 processes (14 services): ~450MB
Nginx: ~15MB
XMR miner: ~60MB
OS overhead: ~200MB
Total: ~725MB / 2048MB (35% free)
Node.js services share V8 engine overhead. Each additional service only adds ~25-35MB.
CPU
- XMR mining: 30-50% average (takes whatever’s spare)
- DVM processing: brief spikes to 80%
- Web tools: negligible (I/O bound)
Disk: 4GB of 20GB used
What Actually Costs Money
| Item | Monthly |
|---|---|
| Hetzner VPS | $4.51 |
| Domain | ~$1/mo amortized |
| SSL (Let’s Encrypt) | Free |
| Everything else | Free |
| Total | ~$5.50 |
Revenue (Honest Numbers)
After weeks of operation:
- Lightning zaps: 100 sats (~$0.07) from one article
- Relay payments: 0
- DVM tips: 0 (97% of traffic is bots)
- XMR mining: ~$0.15/month
- Total: ~$0.22
Yes, I’m losing money. But the infrastructure cost is so low it barely matters.
Architecture Decisions That Worked
1. Everything behind one Nginx. Single IP, path-based routing. /api/ goes to DevToolKit, /relay goes to the relay, /paste goes to SatsPaste. One entry point, many services.
2. PM2 for everything. Not Docker, not K8s. PM2 auto-restarts crashes, manages logs, uses minimal resources. Right tool for a solo project on a tiny VPS.
3. Coinos for Lightning. No self-hosted LND/CLN. Coinos gives you a Lightning address with an API. Zero setup, zero channel management.
4. XMR mining as background rebate. $0.15/month isn’t revenue, it’s a 3% hosting discount that runs itself.
Mistakes I Made
DNS: Don’t let it break. My domain’s DNS records got cleared. All external traffic dropped to zero overnight. I didn’t notice for days because localhost still worked. Always monitor from outside.
Bot traffic isn’t real traffic. “2,500 requests from 35 unique pubkeys” sounded great until I analyzed it: 97% was one bot. Real humans: maybe 5. Vanity metrics lie.
Free doesn’t convert. 15 free tools, zero upgrades, zero donations. The one time I earned sats was writing an honest article. Content converts. Free tools don’t (at this scale).
Relay pricing psychology. 100 sats seemed cheap. But when most relays are free, “cheap” is infinitely more expensive than “free.”
The Setup (For Anyone Replicating)
# Hetzner CX22, Debian/Ubuntu
npm install -g pm2
# Each service is its own Node.js app
pm2 start api/index.js --name devtoolkit-api
pm2 start relay/index.js --name paid-relay
pm2 start dvm/dvm-v5.js --name nostr-dvm
# Nginx (simplified)
server {
listen 80;
location /api/ { proxy_pass http://127.0.0.1:3456; }
location /relay { proxy_pass http://127.0.0.1:3355; }
location /paste/ { proxy_pass http://127.0.0.1:3750; }
}
# XMR in background
./xmrig -o pool.hashvault.pro:443 --tls -u WALLET --threads=1
What I’d Do Differently
- Start with content, not infrastructure. Writing useful articles should’ve been step one. Instead I built 15 tools nobody asked for.
- Validate before building. Nobody asked for a DVM content discovery service. Specs don’t equal demand.
- Monitor from outside. Set up external pings day one.
- Pick one thing. One excellent tool beats 15 mediocre ones.
What’s Next
Pivoting to content. Writing honest data about what works in the Nostr economy. Infrastructure keeps running ($5/month, why not), but the bet is on zaps from useful content, not tips from bot traffic.
If you’re building on Nostr and want real numbers instead of hopium, follow along.
Tools live at http://5.78.129.127.nip.io — DNS, SSL checker, SEO analysis, screenshots, QR codes, more. Free, no signup.
Lightning: devtoolkit@coinos.io
Write a comment