RabbitMQ on dedicated servers

RabbitMQ moves work between services with routing, acknowledgements and replication. On its own hardware a broker keeps steady latency even when queues back up.

What is RabbitMQ good at?

Routing messages between applications with delivery guarantees. Exchanges route by key, topic pattern or headers; consumers acknowledge each message so nothing is lost when a worker crashes; dead-letter exchanges catch messages that fail repeatedly. Background jobs, order pipelines, notification fan-out and microservice commands are its home ground. It speaks AMQP 0-9-1 natively and AMQP 1.0, MQTT and STOMP through built-in support or plugins.

How do I install a current version?

From the RabbitMQ team's own package repositories, which ship current Erlang and RabbitMQ builds for Debian, Ubuntu and the EL family; distribution packages are often a major version behind. After install, enable the management plugin for the web interface and the HTTP API.

systemctl enable --now rabbitmq-server
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user orders_svc "$(openssl rand -base64 30)"
rabbitmqctl set_permissions -p / orders_svc "^orders\." "^orders\." "^orders\."
rabbitmqctl delete_user guest

Quorum queue, stream or classic queue?

TypeReplicationBest for
Quorum queueRaft across nodesWork that must not be lost: orders, payments, jobs
StreamReplicated append-only logLarge fan-out, replay, very high throughput
Classic queueNone in version 4Temporary, non-critical or per-client queues

Classic mirrored queues were removed in RabbitMQ 4.0, so new clusters use quorum queues for replicated data. Declare them with the x-queue-type argument set to quorum, or set a default queue type per virtual host.

Which ports does a node use?

Expose only 5671 to remote applications, and keep 25672 and 4369 on a WireGuard interface between your nodes.

What are memory and disk alarms?

Safety limits that stop publishers before the broker runs out of resources. When memory use crosses vm_memory_high_watermark or free disk falls below disk_free_limit, the node blocks publishing connections until consumers catch up. Size the machine so alarms never trigger in normal operation: memory for message bodies held in queues, plus about a gigabyte of baseline per node, and disk for quorum queue logs and streams.

# /etc/rabbitmq/rabbitmq.conf
vm_memory_high_watermark.relative = 0.6
disk_free_limit.absolute = 20GB
default_queue_type = quorum
listeners.ssl.default = 5671

How do I form a cluster?

Three nodes with the same Erlang cookie in /var/lib/rabbitmq/.erlang.cookie, resolvable host names, and inter-node ports reachable over a private tunnel. On the second and third nodes:

rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@mq-gra-1
rabbitmqctl start_app
rabbitmq-diagnostics cluster_status

Quorum queues and streams then replicate across all three, and the cluster keeps working with one node down. Place the nodes in one data centre, since Raft replication waits for a majority on every write; for a second site, use the shovel or federation plugins to copy messages asynchronously.

Which machine fits?

Most brokers are limited by disk latency for persistent messages and by cores for many connections. NVMe drives on every model suit quorum queue logs.

LoadMachine
Thousands of messages a second, one nodeESSENTIAL-2
Three-node cluster for production3 x ESSENTIAL-S
Heavy streams and many connectionsBUSINESS-3 2024

ESSENTIAL-S brings 8 cores and 64 GB DDR5 at $46.20 a month per node. Watch queue depth, unacknowledged counts and publish rates with the built-in Prometheus plugin, and alert before an alarm would fire. Our Apache Kafka clusters and NATS JetStream servers pages cover other messaging choices.

Machines for RabbitMQ

Lowest monthly price of each model across its data centres; the model page shows the price in every location.

ModelProcessorCoresMemoryDrivesPortPer month
ESSENTIAL-2Intel Xeon-E 2388G832 GB2x 512 GB SSD NVMe1 Gbps unmetered$43.20
ESSENTIAL-SAMD Ryzen 7 9700X864 GB2x 512 GB SSD NVMe1 Gbps unmetered$46.20
ESSENTIAL-MAMD Ryzen 9 9900X1264 GB2x 512 GB SSD NVMe1 Gbps unmetered$70.80
ESSENTIAL-4AMD EPYC 73131664 GB2x 960 GB SSD NVMe1 Gbps unmetered$106.20
BUSINESS-2 2024AMD EPYC 4344P864 GB2x 960 GB SSD NVMe3 Gbps unmetered$109.80
BUSINESS-3 2024AMD EPYC 4464P1264 GB2x 960 GB SSD NVMe3 Gbps unmetered$141.60

Run three nodes in one data centre for replicated quorum queues.

See all servers and prices

Related pages

Apache Kafka clusters

Run Apache Kafka in KRaft mode on bare metal: controllers and brokers, log directories on many drives, replication settings, page cache and retention sizing.

Read more

NATS JetStream servers

Run NATS with JetStream on bare metal: one small binary, client, route and monitoring ports, streams and consumers, R3 replication and leaf nodes.

Read more

Database servers

NVMe machines with large memory for PostgreSQL, MySQL, MariaDB and MongoDB, from a single primary to replicated pairs.

Read more

Company VPN gateways

Small, efficient machines for WireGuard and IPsec gateways that connect staff, offices and servers privately.

Read more

Questions and answers

Which RabbitMQ queue type should I use for important messages?

Quorum queues. They replicate with Raft across cluster nodes; classic mirrored queues were removed in RabbitMQ 4.0.

Which ports does RabbitMQ use?

5672 for AMQP and 5671 for AMQP over TLS, 15672 for management, 25672 between nodes and 4369 for the Erlang port mapper.

What is a RabbitMQ memory alarm?

When memory use crosses vm_memory_high_watermark, the node blocks publishers until consumers drain the backlog.

How many nodes should a RabbitMQ cluster have?

Three is the usual minimum, so quorum queues keep a majority and continue working with one node down.

Can a RabbitMQ cluster span two data centres?

It is better to keep each cluster in one data centre and copy messages between sites with the shovel or federation plugins.