
Deploy SMSGate Production Template
[Updated Nov 2026] SMSGate - Turn your phone into a private SMS gateway
Just deployed
MySQL
Just deployed
/var/lib/mysql
SMSGate Dashboard
Just deployed
SMSGate Worker
Just deployed
Deploy and Host SMSGate on Railway
SMSGate (SMS Gateway for Android™) "turns your smartphone into an SMS gateway for sending and receiving messages via API." Your apps call a REST API, the phone sends the SMS from its own SIM card, and delivery reports and incoming messages come back as webhooks. This template is your own private SMSGate server with a web dashboard.
About Hosting SMSGate
Hosting SMSGate means running the server that sits between your apps and your phones. The API server takes requests from your apps and from the Android app, a background worker cleans up old messages, devices and tokens, and MySQL stores everything. The web dashboard lets you send messages, follow delivery and manage phones, webhooks and API tokens from the browser. The phone needs an HTTPS address to reach the server; Railway gives you one. Only phones that know the private token generated at deploy time can register, and message content stays on your server. To wake the phone, the server sends a push through the public SMSGate relay; with SSE Only in the app no push is used at all.
Features
From the SMSGate app README:
📱 Core Functionality:
- 📝 No personal information required: Creating an account needs no email or personal details. In cloud mode the device is registered only after you sign up or sign in; in local mode you don't need an account at all!
- 📨 Send and Receive SMS via API: Use our API to send messages directly from your applications or services.
- 🤖 Support for Android 5.0 and above: Compatible with Android 5.0 and later versions. See Android 15 Note
- 👤 Explicit device registration: The device never registers itself in the background — in cloud mode you always sign up or sign in first.
- 🗑️ Unregister device: Remove the cloud registration from the device at any time, and sign up or sign in again whenever you need the cloud server.
💬 Message Handling:
- 📜 Multipart messages: Send long messages with auto-partitioning.
- 📊 Message status tracking: Monitor the status of sent messages in real-time.
- 📥 Incoming messages viewer: View all received SMS, Data SMS, and MMS messages directly in the app with organized tabs and statistics.
- 🔔 Real-time incoming message notifications: Receive instant SMS and MMS notifications via webhooks.
- 📖 Read received messages: Access previously received messages via the same webhooks used for real-time notifications.
- 📎 MMS download notifications: Receive webhook notifications when MMS messages are fully downloaded, including message body and attachments.
- 📤 Send MMS messages via API: Send multimedia messages (images, audio, video, files) as Base64-encoded attachments, with an optional subject and text body.
- 🖼️ Received MMS attachments: Attachments of received MMS messages are stored on the device and can be fetched through the inbox API. Attachments larger than the configurable inline size limit (Settings → Inbox, 1 MiB by default) are kept on the device and omitted from webhook payloads and cloud uploads.
- 📦 Batch webhook events: Receive batched webhook deliveries when multiple messages arrive at once, reducing the number of requests.
- 🛑 Cancel pending messages: Cancel queued messages before they are sent.
- 🔍 Message filtering: Filter the messages list by state (pending, sent, delivered, failed) and type (SMS, MMS, Data SMS) to find messages quickly.
- ⏳ Send rate limiting: Restrict the number of messages sent per period (e.g., per 30 minutes) to avoid operator throttling.
- ⏰ Message scheduling: Schedule messages for future delivery using the optional
scheduleAtfield (it must be a future timestamp).
🔒 Security and Privacy:
- 🔐 End-to-end encryption: Encrypts message content and recipients' phone numbers before sending them to the API and decrypts them on the device.
- 🏢 Private server support: Use a backend server in your own infrastructure for enhanced security.
🔧 Advanced Features:
- 💳 Multiple SIM card support: Supports devices with multiple SIM cards.
- 📱📱 Multiple device support: Connect multiple devices to the same account with Cloud or Private server. Messages sent via the server are distributed across all connected devices.
- 💾 Data SMS support: Send and receive binary data payloads via SMS for IoT commands, encrypted messages, and other specialized use cases.
- 🕐 Working hours scheduling: Restrict message delivery to configurable time windows, automatically pausing the queue outside of them.
- 🔄 Reliable background capture: SMS, data SMS, and MMS receivers are declared in the manifest and enabled while the gateway runs, so incoming messages are still delivered if the system kills the app process.
🔌 Integration:
- 🪝 Webhooks: Set up webhooks to be triggered on specified events.
- 📊 Webhook queue diagnostics: Inspect the webhook delivery queue in-app to see pending deliveries, retries, and their status.
Common Use Cases
- 🔐 Authentication & Verification: Secure user accounts and transactions with SMS-based two-factor authentication, minimizing the risk of unauthorized access.
- 📩 Transactional Messages: Send confirmation messages for user actions, enhancing the reliability and perception of your brand.
- ⏰ SMS Reminders: Prompt users about upcoming events or appointments to ensure engagement and reduce missed opportunities.
- 🔔 SMS Notifications: Deliver immediate notifications to users for important updates, offers, and service enhancements.
- 📊 User Feedback: Solicit and collect user feedback through SMS, providing valuable insights for improving your services.
Note: It is not recommended to use this for batch sending due to potential mobile operator restrictions.
Dependencies for SMSGate Hosting
- An Android phone (Android 5.0 or newer) with a SIM card, running the SMSGate app (Google Play, F-Droid or GitHub releases)
- MySQL 8, included in this template with a persistent volume
Deployment Dependencies
- Android app: https://github.com/capcom6/android-sms-gateway
- Server: https://github.com/android-sms-gateway/server
- Web dashboard: https://github.com/android-sms-gateway/web-dashboard
- Documentation: https://docs.sms-gate.app/
- Private server guide: https://docs.sms-gate.app/getting-started/private-server/
Implementation Details
| Service | What it does |
|---|---|
| SMSGate | API server, public HTTPS domain, healthcheck on /health/ready, database migrations on every start |
| SMSGate Worker | Same image started as /app/app worker, runs the cleanup jobs. No public domain |
| SMSGate Dashboard | Web dashboard, public HTTPS domain. Talks to SMSGate over Railway's private network |
| MySQL | MySQL 8 with a volume, reached over Railway's private network |
The phone registration token, the JWT signing secret and the MySQL password are generated on deploy. No default credentials are shipped.
Connect your phone
- Open the SMSGate service. Copy its public domain, and copy
GATEWAY__PRIVATE_TOKENfrom its Variables tab. - In the app, open Settings → Cloud Server and set API URL to
https://YOUR-SMSGATE-DOMAIN/api/mobile/v1and Private Token to the token. - On the Home tab, turn on Cloud server, tap Start Service and confirm Sign Up. The app then shows a username and password.
Use the dashboard
Open the SMSGate Dashboard domain and sign in with the username and password from the app. Each login only sees its own phones and messages.
Send an SMS from code
curl -X POST -u "USERNAME:PASSWORD" \
-H "Content-Type: application/json" \
-d '{"textMessage":{"text":"Hello from Railway"},"phoneNumbers":["+15551234567"]}' \
https://YOUR-SMSGATE-DOMAIN/api/3rdparty/v1/messages
Check delivery with GET /api/3rdparty/v1/messages/{id}, or register webhooks (sms:sent, sms:delivered, sms:failed, sms:received) with POST /api/3rdparty/v1/webhooks. The phone sends webhook requests itself, so their target must be reachable from the phone.
Good to know
- Automatic image updates are on for the three SMSGate services (patch releases, 02:00 to 06:00 UTC). Keep SMSGate and SMSGate Worker on the same version.
- Run one replica of each service. For more, add Redis and set
CACHE__URLandPUBSUB__URLon SMSGate and SMSGate Worker. TASKS__MESSAGES_CLEANUP__MAX_AGEon the worker sets how long message history is kept (30 days by default).- If you add a custom domain to SMSGate, set
HTTP__API__HOSTto it and update the API URL in the app. Changing the server in the app resets its login.
Why Deploy SMSGate on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying SMSGate on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
MySQL
mysql:8SMSGate Dashboard
ghcr.io/android-sms-gateway/web-dashboard:v0.6.3SMSGate Worker
ghcr.io/android-sms-gateway/server:v1.52.7