
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.
rabbitmq
Just deployed
/var/lib/rabbitmq
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
guestaccount is never created, so neitherguest:guestnor 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.
rabbitmqctlandrabbitmq-diagnosticsreach 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.
Template Content
rabbitmq
rabbitmq:4.3.6-management