Skip to content

Instantly share code, notes, and snippets.

@jemc
Last active September 18, 2021 06:07
Show Gist options
  • 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
@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