Railway

Deploy Whatsapp API

One Click Self-Host Evolution API(WhatsApp REST API) on Railway.

Deploy Whatsapp API

Whatsapp Rest API

Just deployed

Just deployed

/data

/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

DependencyPurpose
PostgreSQLStores instances, contacts, chats, messages, and application data.
RedisHandles caching and WhatsApp session management.
Railway VolumePersists WhatsApp authentication data across deployments.

Deployment Dependencies

ResourceLink
Official Documentationhttps://doc.evolution-api.com/
GitHub Repositoryhttps://github.com/EvolutionAPI/evolution-api
Baileyshttps://github.com/WhiskeySockets/Baileys

Implementation Details

Docker

This template deploys the following services:

ServiceImage
Evolution APIevoapicloud/evolution-api:latest
PostgreSQLghcr.io/railwayapp-templates/postgres-ssl:17
Redisredis:8.2.1

Railway automatically deploys all services without requiring custom build commands.

Public Networking

SettingValue
Proxy TypeHTTP Proxy
Target Port8080

Generate a Railway domain from Settings → Networking → Generate Domain to expose the API securely over HTTPS.

Environment Variables

VariableRequiredDescription
DATABASE_PROVIDERYesDatabase provider (postgresql).
DATABASE_CONNECTION_URIYesPostgreSQL connection string.
CACHE_REDIS_ENABLEDYesEnables Redis caching.
CACHE_REDIS_URIYesRedis connection string.
SERVER_URLYesPublic Railway URL for the API.
AUTHENTICATION_API_KEYYesAPI 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:

  1. Open the Evolution API service.
  2. Navigate to Settings → Volumes.
  3. Select Add Volume.
  4. 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_URI using the Railway PostgreSQL reference variable.
  • Configure CACHE_REDIS_URI using 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:

  1. Generate a Railway public domain.
  2. Access the Evolution API endpoint.
  3. Create a new WhatsApp instance using the REST API.
  4. Scan the generated QR code with your WhatsApp account.
  5. 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

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