Deploy Whatsapp API
One Click Self-Host Evolution API(WhatsApp REST API) on Railway.
Whatsapp Rest API
Latest Evolution API
Just deployed
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host Whatsapp on Railway
Evolution API is an open-source WhatsApp REST API built on Baileys that enables applications to connect personal WhatsApp accounts through HTTP endpoints. It provides APIs for sending messages, receiving webhooks, managing contacts and groups, and automating WhatsApp workflows without requiring Meta's WhatsApp Business API approval process.
About Hosting Whatsapp
Hosting Evolution API on Railway provides a production-ready environment for running your own WhatsApp automation backend. This template deploys Evolution API alongside PostgreSQL for persistent storage and Redis for session management and caching. A Railway Volume stores WhatsApp authentication sessions so connected accounts remain authenticated across redeployments. Railway automatically provisions HTTPS, private networking, and environment variable management, allowing the API to securely communicate with PostgreSQL and Redis. As your messaging workload grows, Railway makes it easy to scale compute resources while continuing to manage infrastructure and networking.
Common Use Cases
- Build WhatsApp chatbots and conversational AI assistants.
- Send automated notifications, alerts, reminders, and broadcast messages.
- Integrate WhatsApp messaging into customer support platforms, CRMs, and business workflows.
Dependencies for Whatsapp Hosting
| Dependency | Purpose |
|---|---|
| PostgreSQL | Stores instances, contacts, chats, messages, and application data. |
| Redis | Handles caching and WhatsApp session management. |
| Railway Volume | Persists WhatsApp authentication data across deployments. |
Deployment Dependencies
| Resource | Link |
|---|---|
| Official Documentation | https://doc.evolution-api.com/ |
| GitHub Repository | https://github.com/EvolutionAPI/evolution-api |
| Baileys | https://github.com/WhiskeySockets/Baileys |
Implementation Details
Docker
This template deploys the following services:
| Service | Image |
|---|---|
| Evolution API | evoapicloud/evolution-api:latest |
| PostgreSQL | ghcr.io/railwayapp-templates/postgres-ssl:17 |
| Redis | redis:8.2.1 |
Railway automatically deploys all services without requiring custom build commands.
Public Networking
| Setting | Value |
|---|---|
| Proxy Type | HTTP Proxy |
| Target Port | 8080 |
Generate a Railway domain from Settings → Networking → Generate Domain to expose the API securely over HTTPS.
Environment Variables
| Variable | Required | Description |
|---|---|---|
DATABASE_PROVIDER | Yes | Database provider (postgresql). |
DATABASE_CONNECTION_URI | Yes | PostgreSQL connection string. |
CACHE_REDIS_ENABLED | Yes | Enables Redis caching. |
CACHE_REDIS_URI | Yes | Redis connection string. |
SERVER_URL | Yes | Public Railway URL for the API. |
AUTHENTICATION_API_KEY | Yes | API key used to authenticate API requests. |
Example:
DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=${{Postgres.DATABASE_URL}}
CACHE_REDIS_ENABLED=true
CACHE_REDIS_URI=${{Redis.REDIS_URL}}
SERVER_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
AUTHENTICATION_API_KEY=${{secret(64)}}
Railway reference variables automatically provide the PostgreSQL and Redis connection details.
Persistent Storage
Evolution API requires persistent storage for WhatsApp authentication sessions.
Add a Railway Volume:
- Open the Evolution API service.
- Navigate to Settings → Volumes.
- Select Add Volume.
- Mount the volume at:
/evolution/instances
Without this volume, connected WhatsApp accounts must be reauthenticated after deployments or container recreation.
Database
This template requires both PostgreSQL and Redis.
- Add the Railway PostgreSQL service.
- Add the Railway Redis service.
- Configure
DATABASE_CONNECTION_URIusing the Railway PostgreSQL reference variable. - Configure
CACHE_REDIS_URIusing the Railway Redis reference variable.
PostgreSQL stores application data, while Redis manages cache and session state.
Build & Start
The application runs directly from the official Evolution API container image.
No custom build or start commands are required.
Accessing the Application
After deployment:
- Generate a Railway public domain.
- Access the Evolution API endpoint.
- Create a new WhatsApp instance using the REST API.
- Scan the generated QR code with your WhatsApp account.
- Begin sending messages, configuring webhooks, and managing conversations through the API.
Why Deploy Whatsapp 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 Whatsapp 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
Latest Evolution API
evoapicloud/evolution-api:v2.3.7Redis
redis:8.2.1