Install rabbitmqadmin on linux

I spent several hours to figure out this, use rabbitmqadmin on linux environment, Finally below steps solve my issue.

On my ubuntu server, python3 was installed, I checked it using below command,

python3 -V

Step 1: download the python script to your linux server

wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.8/bin/rabbitmqadmin

Step2: change the permission

chmod 777 rabbitmqadmin

Step3: change the header of the script as below(first line)

#!/usr/bin/env python3

Thant's all, Now you can run below commands,

To list down queues,

./rabbitmqadmin -f tsv -q list queues

To Delete ques,

./rabbitmqadmin delete queue name=name_of_queue

To add binding between exchange and queue

./rabbitmqadmin declare binding source="exchangename" destination_type="queue" destination="queuename" routing_key="routingkey"

I want to post my commands for installing rabbitmqadmin, it is combination of other answers, but with a little improvements for using best practice:

sudo rabbitmq-plugins enable rabbitmq_management
wget 'https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/v3.7.15/bin/rabbitmqadmin'
chmod +x rabbitmqadmin
sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python3|' rabbitmqadmin
mv rabbitmqadmin .local/bin/
rabbitmqadmin -q list queues

I suppose that you already create .local/bin/ dir and add it to PATH (on Ubuntu bash add this dir to PATH if it exists).


RabbitMQ decided to omit one vital piece of information.

Make the script executable with chmod +x otherwise it will fail to work.