Skip to content
Fullstack Launchpad

Run RabbitMQ in Docker and Tour the Management UI

Start RabbitMQ 4.4 with one docker run, read the Management UI, publish and get a Darkroom job by hand, and see why guest works in Docker.

Lesson 2By Published 8 min readRabbitMQ: The Complete Guide
A hand-drawn orange shipping container with a rabbit's two ears poking out of the top

In the previous lesson you decided that Darkroom's photo resizing should go through a queue. Before any code, you need a broker you can see. In this lesson you start RabbitMQ 4.4 with one command, open its Management UI, push one resize job into a queue by hand, and take it back out. Along the way you will see why the guest user logs in from your browser even though RabbitMQ says it should not.

Why start with a broker you can see

When a job goes missing later, you need to know where jobs wait, how many, and whether anyone reads them. The Management UI shows that in a browser, and its docs say it can send and receive messages, "useful in development environments and for troubleshooting". Today you play producer and consumer yourself.

What one docker run gives you

The download page shows the official one-liner with the rabbitmq:4-management image. This course pins the patch release, rabbitmq:4.4.1-management, so your output matches the lesson. The -management tag is the image variant with the management plugin already enabled (image docs).

Browser to 127.0.0.1:15672 and Node.js app to 127.0.0.1:5672, both published into one container running node rabbit@darkroom-rabbit

Two ports matter for this course, and a third stays inside the container (networking guide):

PortWhat uses itWho in Darkroom uses it
5672AMQP 0-9-1 and AMQP 1.0 clientsthe upload API and workers (next lesson)
15672HTTP API, management UI and rabbitmqadminyou, in the browser and with curl
25672inter-node and CLI tools communicationrabbitmqctl inside the container; not published

Start RabbitMQ with one command

sh
docker run -d --name rabbitmq --hostname darkroom-rabbit \
  -p 127.0.0.1:5672:5672 -p 127.0.0.1:15672:15672 \
  rabbitmq:4.4.1-management

What the flags do:

  • -d runs the container in the background; --name rabbitmq lets you refer to it by name (docker run reference).
  • --hostname darkroom-rabbit fixes the node name. RabbitMQ stores data by node name, which defaults to the hostname, so the image docs say to set it explicitly.
  • -p 127.0.0.1:... publishes each port on your machine's loopback address only. Without the 127.0.0.1: part, Docker publishes on every host address, and its own docs call that "insecure by default". The section on guest below shows why that matters here.

Wait for the startup line in the logs. On the test machine it took about 4 seconds:

sh
docker logs rabbitmq 2>&1 | grep "Server startup complete"
text
2026-11-29 16:01:08.683894+00:00 [info] <0.924.0> Server startup complete; 4 plugins started.

Then ask the node itself. rabbitmq-diagnostics ships inside the image. check_running fails with a non-zero exit code if RabbitMQ is not running, and listeners lists the ports the node is bound to:

sh
docker exec rabbitmq rabbitmq-diagnostics check_running
docker exec rabbitmq rabbitmq-diagnostics listeners
text
Checking if RabbitMQ is running on node rabbit@darkroom-rabbit ...
RabbitMQ on node rabbit@darkroom-rabbit is fully booted and running
Asking node rabbit@darkroom-rabbit to report its protocol listeners ...
Interface: [::], port: 15692, protocol: http/prometheus, purpose: Prometheus exporter API over HTTP
Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0

The node name rabbit@darkroom-rabbit comes from your --hostname. Port 15692 is the Prometheus endpoint, used in a later lesson on monitoring.

Read the Overview page

Open http://localhost:15672/ and log in with guest / guest. The top bar has six tabs: Overview, Connections, Channels, Exchanges, Queues and Streams and Admin.

Overview is the whole broker on one page:

  • Totals has a Queued messages chart with three lines, Ready, Unacked and Total, and a Message rates chart below it.
  • Global counts shows buttons for Connections, Channels, Exchanges, Queues and Consumers. On a fresh broker you see 0 everywhere except Exchanges: 8. Those are the built-in exchanges; the AMQP model lesson explains them.
  • Nodes has one row, rabbit@darkroom-rabbit, with file descriptors, Erlang processes, memory, disk space and uptime.

The UI reads all of this from the HTTP API under /api/ (reference), which you can also call yourself:

sh
curl -s -u guest:guest http://localhost:15672/api/overview \
  | jq '{rabbitmq_version, node, default_queue_type, queue_totals, object_totals}'
text
{
  "rabbitmq_version": "4.4.1",
  "node": "rabbit@darkroom-rabbit",
  "default_queue_type": "classic",
  "queue_totals": {},
  "object_totals": {
    "exchanges": 8,
    "queues": 0,
    "channels": 0,
    "consumers": 0,
    "connections": 0
  }
}

Create a queue and publish one resize job

Go to Queues and Streams and open Add a new queue. Leave Type at "Default for virtual host" (on this broker that means classic, as the overview said), keep Durability at "Durable", and type the name darkroom.tour.resize. Click Add queue. The new row shows Ready 0, Unacked 0, Total 0.

Click the queue name and open Publish message. The form says the message "will be published to the default exchange with routing key darkroom.tour.resize, routing it to this queue". Fill it in:

FieldValue
Delivery mode2 - Persistent
Propertiescontent_type = application/json
Payload{"photoId":"p-1042","sizes":[320,1280]}

Click Publish message. The UI replies "Message published." The queue row now reads Ready 1, Total 1: one resize job waits, nobody reads it, and the upload API could have answered the user already.

Get the message back and watch Ack Mode

Open Get messages on the same queue page. The form starts with a warning: "getting messages from a queue is a destructive action." The field that decides what happens is Ack Mode. Its first, default option is Nack message requeue true.

A published job waits as Ready 1; Get with Nack message requeue true puts it back and the next Get shows redelivered true, Get with Automatic ack deletes it

Click Get Message(s) with the default mode. You see the payload, the routing key, the properties and Redelivered: ○ (false). The queue still says Ready 1: the message went back. Click again: the same job comes back with Redelivered set, because it was handed out before.

Now switch Ack Mode to Automatic ack and get it once more. The payload shows, and the queue drops to Ready 0, because this mode deletes the message.

The four options map to four ackmode values in the HTTP API:

Ack Mode in the UIackmodeWhat happens to the message
Nack message requeue true (default)ack_requeue_truereturned to the queue
Automatic ackack_requeue_falseacknowledged and deleted
Reject requeue truereject_requeue_truereturned to the queue
Reject requeue falsereject_requeue_falserejected and deleted

Real workers see the same redelivered flag; a later lesson on acknowledgements builds on it. The docs mark this endpoint "for development and troubleshooting only, not for production", so workers use AMQP (next lesson).

The same steps from the command line

Every click above is one HTTP call. Here is the experiment again with curl, plus rabbitmqctl list_queues, which reports messages_ready ("ready to be delivered to clients") and messages_unacknowledged ("delivered to clients but not yet acknowledged"):

sh
curl -s -u guest:guest -H 'content-type: application/json' -X PUT \
  http://localhost:15672/api/queues/%2F/darkroom.tour.resize \
  -d '{"durable":true,"auto_delete":false,"arguments":{}}'

curl -s -u guest:guest -H 'content-type: application/json' -X POST \
  http://localhost:15672/api/exchanges/%2F/amq.default/publish -d '{
  "routing_key": "darkroom.tour.resize",
  "properties": {"delivery_mode": 2, "content_type": "application/json"},
  "payload": "{\"photoId\":\"p-1042\",\"sizes\":[320,1280]}",
  "payload_encoding": "string"
}'

docker exec rabbitmq rabbitmqctl list_queues name messages_ready messages_unacknowledged consumers
text
{"routed":true}
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name	messages_ready	messages_unacknowledged	consumers
darkroom.tour.resize	1	0	0

%2F is the URL-encoded name of the default virtual host, /, and "routed":true means at least one queue took the message. Two things we observed in our run rather than read in the docs: GET /api/exchanges/%2F/amq.default returned the exchange named "", so amq.default is the API path's name for the default exchange; and although the HTTP API reference lists the publish endpoint as PUT, RabbitMQ 4.4.1 answered PUT with 405 Method Not Allowed (allow: POST, OPTIONS), so the command uses POST. Getting the message twice with the default mode shows the flag flip:

sh
curl -s -u guest:guest -H 'content-type: application/json' -X POST \
  http://localhost:15672/api/queues/%2F/darkroom.tour.resize/get \
  -d '{"count":1,"ackmode":"ack_requeue_true","encoding":"auto"}' \
  | jq '.[] | {payload, redelivered, message_count}'
text
{
  "payload": "{\"photoId\":\"p-1042\",\"sizes\":[320,1280]}",
  "redelivered": false,
  "message_count": 0
}
{
  "payload": "{\"photoId\":\"p-1042\",\"sizes\":[320,1280]}",
  "redelivered": true,
  "message_count": 0
}

The second block comes from running the command again. In our run, message_count was the number of messages left in the queue behind this one.

Why does guest work from your browser?

The access control guide says a fresh node has one user, guest with password guest, and elsewhere on the same page that "by default, the guest user is prohibited from connecting from remote hosts". The configuration reference shows the setting behind it: loopback_users.guest = true. Your login worked because the Docker image changes that setting:

sh
docker exec rabbitmq grep -n loopback /etc/rabbitmq/conf.d/10-defaults.conf
text
6:## https://www.rabbitmq.com/access-control.html#loopback-users
8:loopback_users.guest = false

A request from your browser reaches the container through Docker's port mapping, so the broker does not see it as its own localhost. In a test container with RabbitMQ's default put back (loopback_users.guest = true in an extra conf.d file), the request from the host was refused, while the same login from inside the container worked. This is the reply to curl -u guest:guest .../api/whoami, sent from the host through that container's published port:

text
{"error":"not_authorised","reason":"User can only log in via localhost"}
HTTP 401

RabbitMQ's default refuses guest through a Docker port; the image sets loopback_users.guest = false, so you publish ports on 127.0.0.1

So with the image as shipped, guest/guest works from any address that can reach port 15672 or 5672. The docs say allowing remote connections for this user "is very strongly recommended against". That is why the command above publishes on 127.0.0.1: the only machine that can reach the broker is yours.

If other machines must reach the broker, drop guest. For a dev or CI box, the configuration reference documents RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS ("only meant to be used in development and CI environments"). With -e RABBITMQ_DEFAULT_USER=darkroom -e RABBITMQ_DEFAULT_PASS=<your password> on a fresh container, the node creates that user instead of guest. In the test run, rabbitmqctl list_users showed only darkroom [administrator], and guest got HTTP 401. A later lesson covers users and permissions.

Clean up

Delete the tour queue, in the UI (Delete Queue at the bottom of the queue page) or with:

sh
curl -s -u guest:guest -X DELETE http://localhost:15672/api/queues/%2F/darkroom.tour.resize

Keep the broker for the next lesson. docker stop rabbitmq stops it and docker start rabbitmq brings it back. docker rm -f -v rabbitmq removes it for good: -v also removes the container's anonymous volume, which the image creates for /var/lib/rabbitmq, its data directory.

Summary

  • One docker run with rabbitmq:4.4.1-management gives you AMQP on 5672 and the UI and HTTP API on 15672. Set --hostname so the node name stays the same.
  • Get messages defaults to Nack message requeue true: the message goes back and comes out next time with redelivered: true. Automatic ack deletes it.
  • RabbitMQ only lets guest in from localhost, but the Docker image turns that off. Publish the ports on 127.0.0.1, and use your own user for anything shared.

Next: Your First Producer and Consumer in Node.js sends the same resize job from code over AMQP.

Sources

Looked up on 2026-11-29 against RabbitMQ 4.4 (image rabbitmq:4.4.1-management, RabbitMQ 4.4.1 on Erlang 29.1.3). No amqplib code in this lesson.