Twilio charges around $0.05–0.06 per SMS round-trip. Doesn't sound like much until you're building an MVP that sends reminders, confirmations, and notifications — suddenly you're looking at $50/month for a thousand messages. For an app that's not making money yet, that's a dumb tax. Here's what I did instead: grabbed a cheap Android phone, installed an open-source app called SMS Gateway for Android, and turned it into a full SMS gateway with a REST API. My SMS costs dropped to whatever my mobile plan charges — which on plenty of prepaid plans is zero. Unlimited texts. This post walks through exactly how to wire it into a Next.js app, from first install to receiving webhooks. The whole thing took an afternoon. What You're Building By the end of this you'll have: An Android phone acting as your SMS gateway A webhook endpoint receiving inbound SMS in real-time Outbound SMS sent via a simple REST API call A provider abstraction so you can swap between SMS Gateway, Twilio, or console logging Prerequisites An Android phone (5.0+) with a SIM card A Next.js app (I'm using 15 with App Router, but any backend works) Node.js 18+ ngrok for testing with cloud mode Install SMS Gateway on Android Install SMS Gateway for Android from the Google Play Store or grab the APK from GitHub Releases Open the app and grant SMS permissions when prompted You'll see the main screen with toggles for Local Server and Cloud Server: The app supports two modes — local and cloud. Both work well, and I'll cover each. Local Server Mode Local mode runs an HTTP server directly on the phone. Your backend talks to it over your local network. No cloud dependency, no third-party servers — the simplest setup. Configure It Local server configuration Toggle "Local Server" on Go to Settings > Local Server to configure: Port: 1024–65535 (default 8080) Username: minimum 3 characters Password: minimum 8 characters Tap "Offline" — it changes to "Online" Note the local IP address displayed (e.g. 192.168.1.50) Your p...
First seen: 2026-04-03 08:09
Last seen: 2026-04-03 08:09