Skip to content

Instantly share code, notes, and snippets.

@jemc
Last active September 18, 2021 06:07
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jemc/4b89d6bbf3c7a07bee83 to your computer and use it in GitHub Desktop.
Save jemc/4b89d6bbf3c7a07bee83 to your computer and use it in GitHub Desktop.
Controlling Docker RabbitMQ via rabbitmqctl

Example invocation of a RabbitMQ docker container (use -d instead of -t -i to run in the background):

sudo docker run -t -i --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

Example of controlling the rabbitmq-server inside the container using rabbitmqctl (also inside the container).

sudo docker exec rabbitmq su rabbitmq -- /usr/lib/rabbitmq/bin/rabbitmqctl status
@ypereirareis
Copy link

Hi !
Thx for sharing this 😃

I built a docker based project allowing to run a highly available RabbitMQ cluster with HAProxy.

You can find it there: https://github.com/ypereirareis/docker-rabbitmq-ha-cluster
It could give you more information on Management Plugin.

Bye !

@QuanTran91
Copy link

I'm getting the error : Can't open /usr/lib/rabbitmq/bin/rabbitmqctl

@joshes
Copy link

joshes commented Oct 17, 2019

Perhaps newer versions changed paths. Using rabbitmq:3-management you can do the following:

docker run -t -i --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
docker exec rabbitmq rabbitmqctl status

@QuanTran91
Copy link

Thanks @joshes, it worked now.

@shreyshreyansh
Copy link

Thanks @joshes

@surafell
Copy link

Thanks @joshes, it worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment