RabbitMQ’s Docker Hub page provides us with Docker Images including the Management plugin using Alpine Linux (a Linux version is optimized for a very small size). You can use tags with names ending with management-alpine to install RabbitMQ using Docker Compose.
My example is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 |
version: '3.9' services: rabbitmq: image: rabbitmq:3-management-alpine container_name: 'rabbitmq' ports: - 5672:5672 - 15672:15672 volumes: - ~/Documents/data/rabbitmq/data/:/var/lib/rabbitmq - ~/Documents/data/rabbitmq/log/:/var/log/rabbitmq |
Here, I am installing the latest version of RabbitMQ 3.9.15. We need to expose 2 port 5672 and 15672 of the RabbitMQ server and RabbitMQ Management UI for external use. The 2 folders inside the RabbitMQ container are also mounted to the external folders so that we can easily work with RabbitMQ.
The result when running the command “docker compose up” in the directory containing the docker-compose.yaml file with the above content is as follows:
So we have started a RabbitMQ server with the management UI. Now you can access RabbitMQ Management UI using the address http://localhost:15672/:
Login with username and password as guest, you will see the following results: