---
title: "Deploy Whatsapp API"
description: "One Click Self-Host Evolution API(WhatsApp REST API) on Railway."
category: "Bots"
url: https://railway.com/deploy/whatsapp
---

# Deploy Whatsapp API

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

**[Deploy Whatsapp API on Railway](https://railway.com/template/whatsapp)**

- **Category:** Bots
- **Total deploys:** 7

## Template content

### Latest Evolution API

- **Image:** evoapicloud/evolution-api:v2.3.7
- **Public domain:** Yes

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# 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/](https://doc.evolution-api.com/)                               |
| GitHub Repository      | [https://github.com/EvolutionAPI/evolution-api](https://github.com/EvolutionAPI/evolution-api) |
| Baileys                | [https://github.com/WhiskeySockets/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:

```env
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:

```text
/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.


## Similar templates

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Aug ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Aug ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/whatsapp
