Railway

Deploy Evolution API — WhatsApp REST API

WhatsApp REST API — no Meta approval, no per-message fees.

Deploy Evolution API — WhatsApp REST API

/var/lib/postgresql/data

Just deployed

/data

Just deployed

Deploy and Host Evolution API on Railway

Evolution API is an open-source WhatsApp REST API built on Baileys and Whatsmeow. It gives developers programmatic control of WhatsApp accounts through a RESTful interface without requiring Meta's Business API approval. Send messages, manage groups, stream events to your queue, and connect AI agents — all through a self-hosted backend you fully control.


What This Template Deploys

ServicePurpose
Evolution APIWhatsApp REST API server — instance management, messaging, webhooks, and Manager UI on port 8080
PostgreSQL 18Persistent database for instances, messages, contacts, and session state
Redis 8.2.1Cache layer for session management — required for multi-instance deployments

All three services are pre-wired over Railway's private network. Credentials are injected automatically via reference variables — no manual configuration required.


About Hosting Evolution API

Running Evolution API in production requires PostgreSQL for session state, Redis for caching, and a persistent volume at /evolution/instances for WhatsApp authentication data. Without a managed host, you are configuring Docker Compose, inter-service networking, SSL, volume mounts, and database backups by hand.

Railway handles all of it. Session metadata persists in PostgreSQL, so instances reconnect after restarts without re-scanning the QR code.

Typical cost: ~$5–10/month on Railway's Hobby plan for all three services, with no per-message billing. Twilio's WhatsApp API charges $0.005–$0.085 per message — at 10,000 messages/month that is $50–$850 in messaging fees alone. Meta's own Cloud API bills per 24-hour conversation window, which stacks up fast on marketing and utility templates. A self-hosted deployment has a flat infrastructure cost regardless of volume.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway and wait for all three services to build (~3–5 minutes)
  2. Mount a Railway volume at /evolution/instances in the Evolution API service settings
  3. Set SERVER_URL to your Railway public domain and AUTHENTICATION_API_KEY to a strong secret
  4. Open [your-domain]/manager to access the Manager dashboard
  5. Create an instance, scan the QR code with WhatsApp, and start sending messages via REST

No SSH. No Docker Compose. No SSL certificates to manage.


Common Use Cases

  • WhatsApp automation without Meta Business API approval — connect any WhatsApp account via QR code with no verified business account, Business Manager, or API application
  • AI-powered customer support — route conversations into Chatwoot as a unified inbox, or build flows with Typebot, Dify, Flowise, or Evo AI; connect Claude or GPT for AI-driven conversation handling
  • n8n workflow automation — use the n8n-nodes-evolution-api community node to trigger workflows from inbound messages and send replies from any automation step
  • Event streaming into your existing stack — publish WhatsApp events to RabbitMQ, Amazon SQS, NATS, Kafka, Pusher, or a WebSocket channel, configurable per instance
  • Multi-account WhatsApp management — run multiple instances from a single deployment; suited to agencies managing client accounts or SaaS products with per-user WhatsApp
  • Media-heavy messaging — offload images, audio, and documents to S3 or MinIO instead of the local volume, with optional audio transcription via OpenAI
  • E-commerce transactional messaging — order confirmations, delivery alerts, and payment notifications at scale with no per-message billing

Configuration

VariableRequiredDescription
SERVER_URLRequiredYour Railway public URL — needed for QR code generation and webhook delivery
AUTHENTICATION_API_KEYRequiredMaster API key for all requests — generate a strong random string
DATABASE_PROVIDERPre-setpostgresql — connects to the Railway PostgreSQL service
DATABASE_URLAuto-injectedPostgreSQL connection string via Railway reference variable
CACHE_REDIS_URIAuto-injectedRedis URI via Railway reference variable
WEBHOOK_GLOBAL_URLOptionalReceives all WhatsApp events across all instances
WEBHOOK_GLOBAL_ENABLEDOptionalSet to true to enable global webhook delivery
S3_ENABLEDOptionalSet to true to store media in S3 or MinIO instead of the local volume
LOG_LEVELOptionalERROR in production, DEBUG for troubleshooting
DEL_INSTANCEOptionalSet to false to keep all instances alive indefinitely
LANGUAGEOptionalAPI response language — en, pt-BR, or es

Volume required: Mount a Railway volume at /evolution/instances. Without it, WhatsApp authentication is lost on every redeploy and users must re-scan the QR code each time.


Dependencies for Evolution API Hosting

  • Railway account — Hobby plan (~$5–10/month) covers all three services
  • A WhatsApp account to scan the QR code and connect the instance
  • Optional: Chatwoot, Typebot, Dify, Flowise, or n8n for automation workflows
  • Optional: S3-compatible storage for media handling at scale
  • Optional: RabbitMQ, SQS, NATS, or Kafka if you want events on a message bus

Deployment Dependencies

Implementation Details

This template pins Evolution API (evoapicloud/evolution-api:v2.3.7) alongside PostgreSQL 18 and Redis 8.2.1 over Railway's private network. Database and Redis ports are never exposed publicly. The pinned build runs Baileys 7.0.0-rc.6 on Node.js 20 with Prisma-managed migrations, so the schema is applied on first boot with no manual setup.

Session metadata persists in PostgreSQL automatically; QR authentication files persist on the /evolution/instances volume. With both in place, instances reconnect after restarts without re-scanning. The Manager dashboard is available at /manager on your Railway domain immediately after deployment.

v2.3.7 requires no license activation. From v2.4.0 onward, Evolution Foundation requires each instance to activate against their licensing server before the API serves traffic — pinning to v2.3.7 keeps your deployment fully functional with no licensing step.


Frequently Asked Questions

Do I need Meta Business API approval? No. Evolution API connects via Baileys using a personal or business WhatsApp account — QR scan only. No Meta Business Manager, business verification, or API application required.

Do I lose WhatsApp sessions on redeploy? No, provided the volume is mounted at /evolution/instances. Session metadata persists in PostgreSQL and authentication files persist on the volume. Together, instances reconnect automatically after restarts.

How much does it cost to run Evolution API on Railway? Roughly $5–10/month on Railway's Hobby plan for all three services, flat regardless of message volume. Twilio charges $0.005–$0.085 per message and Meta's Cloud API bills per 24-hour conversation window.

What changed in Evolution API v2.4.0 and should I upgrade? From v2.4.0, every instance must activate against the Evolution Foundation licensing server before the API accepts traffic. This template pins v2.3.7, which has no activation requirement. v2.4.0 also brings a rebuilt Manager UI, SQS endpoint support, and LID-to-phone-number mapping for hidden-profile accounts. Upgrade only when you are ready to complete license activation — staying on v2.3.7 is fully supported.

Can I run multiple WhatsApp accounts? Yes. Evolution API supports multiple instances from a single deployment, each connected to a separate WhatsApp account via its own QR code.

Which chatbot and automation tools integrate with it? n8n, Chatwoot, Typebot, Dify, Flowise, Evo AI, and OpenAI are natively supported. All are configured per instance through the Manager dashboard or the REST API.

Can I push WhatsApp events to a message queue instead of webhooks? Yes. Events can be published to RabbitMQ, Amazon SQS, NATS, Kafka, Pusher, or a WebSocket channel, and the transport is configurable per instance.

Where are media files stored? By default on the mounted volume. Set S3_ENABLED and the matching credentials to store images, audio, and documents in S3 or MinIO instead, which is the better choice for high-volume deployments.

Is this against WhatsApp's Terms of Service? Unofficial integrations carry risk. Use numbers with established messaging history, avoid bulk unsolicited messages, apply rate limiting, and enable two-factor authentication. For high-volume commercial use, Meta's official Cloud API is the compliant route.


Why Deploy Evolution API 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 Evolution API on Railway, you get a production-ready WhatsApp automation backend — three services pre-wired with private networking, automatic HTTPS, persistent session storage, and no per-message billing. Host your messaging backend, databases, and automation tools together on Railway with full data ownership.


Template Content

More templates in this category

View Template
Telegram JavaScript Bot
A template for Telegram bot in JavaScript using grammY

Agampreet Singh
295
View Template
Cobalt Tools [Updated Jul ’26]
Cobalt Tools [Jul ’26] (Media Downloader, Converter & Automation) Self Host

shinyduo
245
View Template
Telegram Gateway
Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

INAPP
4