Self-hosted WhatsApp API on Railway with Evolution API
Short answer: deploy Evolution API, an open-source REST API for WhatsApp. You connect a phone number by scanning a QR code, then your app sends messages with an HTTP call and receives incoming messages and status changes as webhooks. The template runs Evolution API 2.3.7 with Postgres, Redis, the built-in Manager UI and a generated API key. The default connection is unofficial and WhatsApp can ban numbers that use it.
Deploy Evolution API on RailwayWhen this fits
Evolution API suits cases where your own backend talks to people who contacted you first:
- order updates, appointment reminders and support replies,
- a shared support inbox in Chatwoot,
- bots in n8n, Typebot, Dify or OpenAI that react to incoming messages,
- events (messages, status, connection) delivered as webhooks to your app.
It is not a tool for bulk or unsolicited messaging. See the limits below.
Evolution API templates people deploy on Railway
| Template | Creator | Deployments | Services |
|---|---|---|---|
| Evolution API | RBR Digital | 6,394 | 3 |
| WhatsApp API — Self-Host Evolution API, No Meta Approval [Updated Nov'26] | SilverBanana | 720 | 3 |
| WAHA | myworkspace | 704 | 1 |
| Evolution API | Open Source Messaging Automation Platform | bond007's Projects | 380 | 3 |
| OpenClaw | Pragmatic Growth | 358 | 1 |
| Evolution API | codestorm | 273 | 3 |
| Evolution APi Whatsapp using n8n | omarmustafa-ops's Projects | 203 | 3 |
| Evolution API | codestorm | 130 | 2 |
Railway marketplace data as of 2026-11-19. Full ranking: Best WhatsApp API templates on Railway.
Names on the marketplace rarely say which version is pinned, whether the API key is generated, or whether Postgres and Redis are included. Open each template page and check its services before you deploy.
Deploy it, step by step
These steps use Tracklayer’s Evolution API v2.3.7 template.
- Deploy the template. It creates the Evolution API service, Postgres 18 and Redis 8.2. All three have volumes, and they talk over Railway’s private network.
- Wait for the deploy to finish. On boot the service waits for Postgres and Redis, applies database migrations, then starts.
- Find your login. Open the Evolution API service, then Variables, and copy
AUTHENTICATION_API_KEY. It is generated at deploy and is 48 characters long. Every endpoint requires it; requests without the key get a 401. - Open the Manager. Go to
https://your-domain/manager, enterhttps://your-domainas the server URL, paste the key and create an instance. One instance is one phone number. - Scan the QR code. In WhatsApp, open Linked devices and scan it.
- Send a test message. Call
POST /message/sendText/mainwith the headerapikey: <key>and a body such as{"number":"<country code + number>","text":"Hello"}. Heremainis your instance name.
You can skip the Manager and create the instance through the API with POST /instance/create. GET /healthz is the health check.
Persistence
Instances, credentials, messages and contacts live in Postgres. Redis keeps its cache and WhatsApp session keys with append-only persistence. The Evolution API service also has a volume at /evolution/instances. Redeploys keep this data.
Cost
Railway bills usage, so cost follows memory and uptime. The template’s README gives measurements, not estimates: Evolution API about 0.12 GB idle and 0.28 GB while an instance generates QR codes, Postgres 0.06 to 0.12 GB, Redis 0.03 GB. The README says it ran on Railway’s Free plan (0.5 GB per service) in testing and on Trial (1 GB). Each connected number adds memory.
Ban risk and WhatsApp rules
Read this before you connect a number you care about.
- The default
WHATSAPP-BAILEYSconnection uses Baileys, an unofficial implementation of the WhatsApp Web protocol. Meta and WhatsApp do not provide or endorse it, and WhatsApp can restrict or ban numbers that use it, especially new numbers or numbers that send many messages. - You must follow WhatsApp’s Terms of Service and Business Messaging Policy. Do not send spam, bulk or unsolicited messages. Railway’s Fair Use Policy also forbids abusive bots and Railway may remove such deployments.
- Test with a number you can afford to lose.
- For business-critical or high-volume messaging, create a
WHATSAPP-BUSINESSinstance instead. It uses Meta’s official Cloud API with your Meta app token, phone number ID and business ID. Point the Meta webhook tohttps://your-domain/webhook/meta, using the value ofWA_BUSINESS_TOKEN_WEBHOOKas the verify token.
Licence and affiliation
Evolution API is Apache-2.0 with additional conditions: keep the Manager’s logo and copyright unchanged, and show administrators a notice if you build it into a product. Otherwise a commercial licence from Evolution Foundation may be required. “Evolution API” is a trademark of Evolution Foundation. The template is a community template and is not affiliated with Evolution Foundation, Meta or WhatsApp. The template keeps the Manager unmodified and prints the usage notice in the service log at every start.
Scaling and upgrades
- Replicas: run one. Two would open the same WhatsApp sessions twice. Because the service has a volume, Railway stops the old deployment before starting the new one, which avoids that during redeploys.
- Upgrades: change the
EVOLUTION_IMAGEdigest andEVOLUTION_VERSIONinservices/evolution-api/Dockerfileof your fork. The build checks the file it patches and fails instead of producing a half-patched image. Migrations run on every start.
Other options
For other self-hosted WhatsApp APIs, see the full ranking of WhatsApp API templates on Railway. If you plan to trigger bots from incoming messages, n8n templates are a common companion. For how this site works, see About.
FAQ
Can WhatsApp ban a number I connect to Evolution API?
Yes. The default connection (WHATSAPP-BAILEYS) uses Baileys, an unofficial implementation of the WhatsApp Web protocol that Meta and WhatsApp do not provide or endorse. WhatsApp can restrict or ban numbers that use it, especially new numbers or numbers that send many messages. Use a number you can afford to lose for testing, and use the official Cloud API integration for business-critical or high-volume messaging.
Can I use Evolution API commercially?
Evolution API is licensed under Apache-2.0 with two additional conditions: you may not remove or change the logo and copyright in its Manager UI, and if you build it into a product you must show your administrators a clear notice that Evolution API is used. Otherwise a commercial licence from Evolution Foundation may be required. Read the licence for your case, and ask a lawyer if you are unsure.
How do I log in and connect my first number?
Copy AUTHENTICATION_API_KEY from the Evolution API service's Variables tab, open /manager on your domain, enter your domain as the server URL plus the key, create an instance and scan the QR code under Linked devices in WhatsApp. You can do the same with POST /instance/create.
How much does it cost to run on Railway?
Railway bills usage. The template's README reports measurements: Evolution API about 0.12 GB of memory idle and 0.28 GB while an instance generates QR codes, Postgres 0.06 to 0.12 GB and Redis 0.03 GB. Each connected number adds memory, so plan more for many instances.
Can I run two replicas for more capacity?
No. Two replicas would open the same WhatsApp sessions twice. Run one replica.