---
title: "Deploy Evolution API RabbitMQ"
description: "Publish WhatsApp events to RabbitMQ queues for your workers"
category: "Automation"
url: https://railway.com/deploy/deploy-evolution-api-with-rabbitmq
---

# Deploy Evolution API RabbitMQ

Publish WhatsApp events to RabbitMQ queues for your workers

**[Deploy Evolution API RabbitMQ on Railway](https://railway.com/template/deploy-evolution-api-with-rabbitmq)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-evolution-api-with-rabbitmq/manifest.json

- **Creator:** onepush
- **Category:** Automation

## Template content

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

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

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

- **Image:** redis:8.2
- **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"`

### evolution-api

- **Image:** evoapicloud/evolution-api:v2.3.7@sha256:1bd8afc4a6cf48822e6cf02469aeae7bd35a12a6b616eacd1291926307f4d339
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted Evolution API RabbitMQ (Event Streaming for WhatsApp Messaging) on Railway

This template runs Evolution API v2.3.7 with Postgres and Redis, aimed at developers who want WhatsApp events pushed to queues for a worker.

## About Hosting Evolution API RabbitMQ open-source software on Railway (self hosted RabbitMQ event publishing for Evolution API template)

Evolution API is an open-source WhatsApp API gateway, and the data it handles, including instances, messages, contacts and chats, stays in a Postgres database you control.

## Why Deploy Evolution API RabbitMQ, the Twilio alternative on Railway (Railway Free Trial)

Twilio charges a per-message fee on top of Meta's charges and only offers the official Cloud API.

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 RabbitMQ 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.

### Railway vs Other Hosting Providers and VPS for Evolution API RabbitMQ self hosting

Here is how Railway compares with raw VPS providers for this stack.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | Evolution API, Postgres, and Redis deploy from one template with a public domain. | A droplet with root access and fixed pricing. You install Docker and handle TLS and updates. |
| AWS | No VPC, IAM, or security group setup before the first deploy. | Amazon MQ for managed RabbitMQ, but networking and IAM come first. |
| Hetzner | Dashboard deploys and redeploys with no server hardening. | Low raw compute cost. You own uptime, backups, and the RabbitMQ install. |

Pick Railway when you want RabbitMQ on the private network without building that network yourself.

## Common Use Cases for hosted Evolution API RabbitMQ

- **Fan out MESSAGES_UPSERT:** Turn on RABBITMQ_EVENTS_MESSAGES_UPSERT and let a worker store or index each new chat, so the API request path stays fast.
- **Alert on dropped instances:** Enable CONNECTION_UPDATE and have a consumer page someone or attempt a reconnect when an instance goes down.
- **Buffer inbound spikes:** When a downstream service slows, RabbitMQ holds the queue while the worker catches up instead of dropping messages.
- **Share one global queue:** With RABBITMQ_GLOBAL_ENABLED=true, MESSAGES_UPDATE events from every instance land in one queue, so a single worker covers the whole fleet.
- **Trim the event list:** Only enable events your consumer actually reads, since each extra event adds broker load for nothing.

## Dependencies for Evolution API RabbitMQ Docker hosted on Railway

The Railway template ships three services: evolution-api, Postgres, and Redis.

### Deployment Dependencies for Managed Evolution API RabbitMQ Service (WhatsApp API)

The core service is evolution-api, built from the evoapicloud/evolution-api:v2.3.7 image and listening on port 8080 behind a public Railway domain.

### Implementation Details for Evolution API RabbitMQ (Using Evolution API official docker image)

Set RABBITMQ_ENABLED to true explicitly, since it defaults to false. Turn on RABBITMQ_GLOBAL_ENABLED for shared queues per event type.

## How does Evolution API RabbitMQ compare against other ways to receive Evolution API events outside webhooks

### Evolution API RabbitMQ vs WhatsApp Cloud API webhooks (Official Meta Webhooks)

- **Delivery model:** RabbitMQ queues let your worker consume events at its own pace, while Cloud API webhooks push each event to one HTTP URL you must keep up with.
- **Setup burden:** Cloud API needs Meta business verification and approved templates, while Evolution API needs a QR scan and a broker you run yourself.
- **Where Meta wins:** Cloud API is the official path, so you avoid the ban risk of unofficial WhatsApp Web connections.

### Evolution API RabbitMQ vs Twilio (Managed Messaging API)

- **Hosting:** Twilio is fully managed, while Evolution API RabbitMQ runs in your own Railway project with its own Postgres, Redis, and broker.
- **Cost shape:** Twilio charges a per-message fee on top of Meta's fees, while Evolution API is free and you pay only for hosting.
- **Where Twilio wins:** You get a managed event pipeline with no broker to size or monitor.

### Evolution API RabbitMQ vs WPPConnect (WhatsApp Web Server)

- **Event routing:** Global mode shares one queue per event type across instances, which takes more work to build on WPPConnect alone.
- **Scaling:** Workers scale independently and consume asynchronously without polling the API.
- **Where WPPConnect wins:** It is a leaner stack if you only need the WhatsApp Web layer and no broker.

### Evolution API RabbitMQ vs Baileys (Unofficial WhatsApp Web Library)

- **Layer:** Baileys is a TypeScript library that talks to WhatsApp Web directly, while Evolution API uses Baileys underneath and adds the HTTP API and RabbitMQ publishing.
- **Integration effort:** With Baileys alone you write your own event plumbing, while Evolution API lets you toggle events with RABBITMQ_EVENTS_* variables.
- **Where Baileys wins:** You get the lowest-level control and no extra service to deploy.

## How to use Evolution API RabbitMQ (the OSS WhatsApp API gateway)?

Once the deploy is green, wire up the broker first, since the template does not ship one.

1. Add a RabbitMQ broker to your Railway project yourself, since the template ships only evolution-api, Postgres and Redis.
2. On the evolution-api service, set RABBITMQ_ENABLED=true, because it defaults to false.
3. Set RABBITMQ_URI to amqp://user:password@host:5672/vhost, using your broker's credentials.
4. Set RABBITMQ_EXCHANGE_NAME, for example evolution_exchange.
5. For shared queues, set RABBITMQ_GLOBAL_ENABLED=true and enable only the events you consume.
6. For per-instance mode instead, send the request below with your AUTHENTICATION_API_KEY in the apikey header.
7. Remove any event you do not consume from the events array, since extra events add broker load.

```env
RABBITMQ_ENABLED=true
RABBITMQ_URI=amqp://user:password@host:5672/vhost
RABBITMQ_EXCHANGE_NAME=evolution_exchange
RABBITMQ_GLOBAL_ENABLED=true
RABBITMQ_EVENTS_MESSAGES_UPSERT=true
```

```bash
curl -X POST https://your-domain/rabbitmq/set/your-instance \
  -H "apikey: YOUR_AUTHENTICATION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": true, "events": ["MESSAGES_UPSERT", "CONNECTION_UPDATE"]}'
```

## How to self host Evolution API RabbitMQ on other VPS Services (Evolution API self hosting guide)

Running this on your own VPS means you run the broker yourself. Here is the path on a plain Linux box with Docker.

### Clone the Repository

Pull the source from the official repo.

```bash
git clone https://github.com/EvolutionAPI/evolution-api.git
cd evolution-api
```

### Install Dependencies

You need Docker and Docker Compose, plus a RabbitMQ broker the app can reach by address, not localhost.

```bash
docker run -d --name rabbitmq -p 5672:5672 rabbitmq:3-management
```

### Configure Environment Variables

Set the RabbitMQ toggles in .env. RABBITMQ_ENABLED defaults to false, so set it explicitly and enable only the events your worker reads.

```env
AUTHENTICATION_API_KEY=your-32-char-global-key
SERVER_URL=https://your-domain
RABBITMQ_ENABLED=true
RABBITMQ_URI=amqp://user:password@your-domain:5672/default
RABBITMQ_EXCHANGE_NAME=evolution_exchange
RABBITMQ_GLOBAL_ENABLED=true
RABBITMQ_EVENTS_MESSAGES_UPSERT=true
```

### Start the Evolution API RabbitMQ Application

Bring the stack up in the background, then confirm the root URL returns the welcome JSON with the version.

```bash
docker compose up -d
curl https://your-domain/
```

Railway handles the broker wiring, private networking and restarts for you.

## Official Pricing of Evolution API RabbitMQ (Evolution API pricing)

Evolution API itself is free and open source, so there is no license fee to pay.

## Evolution API RabbitMQ cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting means you pay for the server, database, cache, and broker, and you own the event pipeline.

### Monthly cost of self hosting Evolution API RabbitMQ on Railway

On Railway, expect roughly 5-15 USD per month for the API service plus Postgres and Redis at light use. Railway's 5 USD trial covers a first test.

### System Requirements for Hosting Evolution API RabbitMQ on a VPS

Run evolution-api, Postgres, Redis, and RabbitMQ on one host with enough memory for all four. Open port 8080 or front it with a reverse proxy.

## Frequently Asked Questions (FAQs)

### Do I need RabbitMQ if I already use webhooks?

No. Webhooks and RabbitMQ are separate delivery paths and can run side by side. RabbitMQ suits a worker that consumes events at its own pace.

### Why are no events arriving after I set RABBITMQ_ENABLED?

RABBITMQ_ENABLED defaults to false, so confirm it is set to true on the evolution-api service.

### What is the difference between global and per-instance mode?

Global mode (RABBITMQ_GLOBAL_ENABLED=true) sends every instance's events into shared queues by event type.

### Why do per-instance event names differ from the RABBITMQ_EVENTS_ variables?

The per-instance JSON body takes bare names like MESSAGES_UPSERT, while env toggles carry the RABBITMQ_EVENTS_ prefix.

### How do I point RABBITMQ_URI at a broker on Railway's private network?

Add RabbitMQ as its own service in the same project and use its private hostname, for example amqp://user:password@your-rabbitmq-service:5672/vhost.

### Which events should I enable to keep broker load low?

Enable only the events your worker reads, such as RABBITMQ_EVENTS_MESSAGES_UPSERT and RABBITMQ_EVENTS_CONNECTION_UPDATE.


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/deploy-evolution-api-with-rabbitmq
