Steps to Install RabbitMQ on Ubuntu 20.04

RabbitMQ is a free & open-source message-broker software. It provides a platform to send and receive messages & supports multiple messaging protocols. It is also known as queue manager.

There are some steps to install RabbitMQ on ubuntu:

Step 1: Update the System.

apt-get update

Step 2: Add repo & import the key.

echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

  • Here is the command output.

Step 3: Update the packages.

apt-get update

Step 4: Install RabbitMQ server.

apt-get install rabbitmq-server

Step 5: Start & Enable the RabbitMQ server.

systemctl start rabbitmq-server
systemctl enable rabbitmq-server

Step 6: Check the RabbitMQ server status.

systemctl status rabbitmq-server

  • Here is the command output.

Step 7: Create User in RabbitMQ server.

rabbitmqctl add_user admin password

  • Provide the tags to created user.

rabbitmqctl set_user_tags admin administrator

  • Provide the permission.

rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

  • Here is the command output.

Step 8: Enable the RabbitMQ Web Management Console.

rabbitmq-plugins enable rabbitmq_management

  • Here is the command output.

Step 9: Open the port number in UFW firewall.

ufw allow 15672/tcp

Step 10: Delete the RabbitMQ User.

rabbitmqctl delete_user user_name

  • To Change the RabbitMQ User Password.

rabbitmqctl change_password user_name password_here

  • To create a new Virtualhost.

rabbitmqctl add_vhost /new_vhost_name

  • To list the available Virtualhosts.

rabbitmqctl list_vhosts

  • To delete a virtualhost.

rabbitmqctl delete_vhost /vhost_name`

  • To provide Grant user permissions for vhost.

rabbitmqctl set_permissions -p /vhost_name user_name ".*" ".*" ".*"

  • To list vhost permissions.

rabbitmqctl list_permissions -p /vhost_name

  • List user permissions.

rabbitmqctl list_user_permissions user_name

  • To delete user permissions.

rabbitmqctl clear_permissions -p /vhost_name user_name

Step 11: Access the RabbitMQ Web -Interface.

http://server-ip:15672

  • Here is the output.
  • Provide the username: admin ,& Password: password
  • Click on Login.

  • Now,RabbitMQ Server is Ready.

Leave a Reply