---
title: "Deploy RabbitMQ | (Just Updated) Message Broker, Memory Alarm Sized to Your Container"
description: "RabbitMQ 4 AMQP broker + UI. Memory alarm sized to your plan, not the host."
category: "Queues"
url: https://railway.com/deploy/rabbitmq-or-just-updated-message-broker-
---

# Deploy RabbitMQ | (Just Updated) Message Broker, Memory Alarm Sized to Your Container

RabbitMQ 4 AMQP broker + UI. Memory alarm sized to your plan, not the host.

**[Deploy RabbitMQ | (Just Updated) Message Broker, Memory Alarm Sized to Your Container on Railway](https://railway.com/template/rabbitmq-or-just-updated-message-broker-)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/rabbitmq-or-just-updated-message-broker-/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Queues

## Template content

### rabbitmq

- **Image:** rabbitmq:4.3.6-management@sha256:cdf40d8cb363d145e377ed88d59696a42386ffe54b30125f10eb128b862eea95
- **Start command:** `/bin/sh -c 'set -e; M=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || echo max); case "$M" in ""|max) L=2GB; SRC="no cgroup memory limit visible, fallback";; *) L=$((M*6/10)); SRC="60% of cgroup memory.max=$M";; esac; printf '\''vm_memory_high_watermark.absolute = %s\nmanagement.tcp.ip = ::\nmanagement_agent.disable_metrics_collector = false\n'\'' "$L" > /etc/rabbitmq/conf.d/90-railway.conf; echo "[railway] memory high watermark $L ($SRC)"; grep -q " rabbitmq$" /etc/hosts || echo "127.0.0.1 rabbitmq" >> /etc/hosts; echo NODENAME=rabbit@rabbitmq > /etc/rabbitmq/rabbitmq-env.conf; exec docker-entrypoint.sh rabbitmq-server'`
- **Public domain:** Yes

## Documentation

# Deploy and Host RabbitMQ on Railway

RabbitMQ is the open-source message broker behind countless job queues, event buses and
microservice backends. It speaks AMQP 0-9-1 and AMQP 1.0, routes messages through exchanges into
durable queues, and ships a web management UI for inspecting queues, connections and throughput.

This template runs RabbitMQ 4.3.6 with the management plugin as a single service: the broker on a
TCP proxy for AMQP clients, the management UI on an HTTPS domain, and the message store on a
Railway volume, from a digest-pinned official image.

## About Hosting RabbitMQ

RabbitMQ runs on Railway only after a few things are handled for you:

- **The memory alarm is sized to your container, not the host.** RabbitMQ reads the machine's
  total RAM to decide when to stop accepting publishes. On Railway that is the host's memory,
  hundreds of gigabytes, so a stock deploy sets its high watermark far above what your plan
  allows: publishers are never throttled and the container is killed for running out of memory
  instead. Here the start command reads the container's own cgroup memory limit on every boot and
  sets the watermark to 60% of it, and logs the value it chose.
- **The management UI shows real numbers.** Message rates, queue depth history and per-connection
  throughput are on. Many setups ship the metrics collector disabled, which leaves the UI's charts
  empty.
- **One service, not two.** The management UI is served by RabbitMQ itself on the public domain,
  with no extra proxy service to pay for and keep alive.
- **Credentials are generated per deploy.** Both the username and the password are random, and
  the default `guest` account is never created, so neither `guest:guest` nor an anonymous request
  can reach the API.
- **Messages survive redeploys.** Durable queues and persistent messages live on the attached
  volume, and the node keeps a stable name, so its data directory is found again on every boot.
- **Command-line tools work.** `rabbitmqctl` and `rabbitmq-diagnostics` reach the node from a
  Railway shell without extra flags.

## Common Use Cases

- Background job queues for web apps (Celery, Sidekiq-style workers, BullMQ alternatives)
- Event-driven microservices exchanging messages through topic and fanout exchanges
- Buffering webhooks and ingest traffic so downstream services consume at their own pace
- Task distribution for AI and data pipelines with acknowledgements and retries

## Dependencies for RabbitMQ Hosting

- One Railway volume for the message store (created by the template)
- A TCP proxy for AMQP clients outside Railway (created by the template)

### Deployment Dependencies

- RabbitMQ documentation: https://www.rabbitmq.com/docs
- Official image: https://hub.docker.com/_/rabbitmq

### Implementation Details

| Variable | Purpose |
| --- | --- |
| `RABBITMQ_DEFAULT_USER` | Admin username, generated per deploy. |
| `RABBITMQ_DEFAULT_PASS` | Admin password, generated per deploy. |
| `RABBITMQ_URL` | Ready-made `amqp://` URL over the TCP proxy, for clients outside Railway. |
| `RABBITMQ_PRIVATE_URL` | Ready-made `amqp://` URL over the private network, for services in the same project. |
| `RABBITMQ_MANAGEMENT_URL` | HTTPS address of the management UI. |

Reference it from another service with `${{rabbitmq.RABBITMQ_PRIVATE_URL}}`.

The watermark line in the deploy log reads, for example:

```
[railway] memory high watermark 4800000000 (60% of cgroup memory.max=8000000000)
```

## Why Deploy RabbitMQ 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 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.


## Similar templates

- [Redpanda](https://railway.com/deploy/redpanda-1) — Redpanda 26.2: Kafka-compatible streaming, single node, with Kafbat UI.
- [smoothmq](https://railway.com/deploy/AJv-64) — A drop-in replacement for AWS SQS
- [Kafka UI](https://railway.com/deploy/kafka-ui) — Kafbat UI — Open-source web UI to monitor and manage Apache Kafka clusters

Open this page in a browser: https://railway.com/deploy/rabbitmq-or-just-updated-message-broker-
