{"id":13558,"date":"2022-01-06T12:51:44","date_gmt":"2022-01-06T12:51:44","guid":{"rendered":"https:\/\/linuxways.net\/?p=13558"},"modified":"2022-01-06T12:51:44","modified_gmt":"2022-01-06T12:51:44","slug":"message-broker-rabbitmq-installing-in-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/message-broker-rabbitmq-installing-in-ubuntu-20-04\/","title":{"rendered":"Message Broker &#8211; RabbitMQ installing in Ubuntu 20.04"},"content":{"rendered":"<p>RabbitMQ is free to install as it is an open-source message broker software. It implements the Advanced Message Queuing Protocol(AMQP). It uses plugins such as Streaming Text Oriented Messaging Protocol, Message Queuing Telemetry Transport.<\/p>\n<p>In this tutorial, we are going to explain the installation process and configuration of RabbitMQ on Ubuntu 20.04 LTS server.<\/p>\n<h3>Installation of RabbitMQ on Ubuntu 20.04 LTS<\/h3>\n<p>First, let&#8217;s update the system and install the required packages with the command as shown below.<\/p>\n<pre>$ sudo apt-get update<\/pre>\n<pre>$ sudo apt-get install wget apt-transport-https -y<\/pre>\n<p>Next, run the command as shown below to install the RabbitMQ repository signing key.<\/p>\n<pre>$ wget -O- https:\/\/www.rabbitmq.com\/rabbitmq-release-signing-key.asc | sudo apt-key add -<\/pre>\n<p>Also update erlang GPG key.<\/p>\n<pre>$ wget -O- https:\/\/packages.erlang-solutions.com\/ubuntu\/erlang_solutions.asc | sudo apt-key add -<\/pre>\n<p>Next, add the repository of the RabbitMQ with erlang as shown below.<\/p>\n<pre>$ echo \"deb https:\/\/packages.erlang-solutions.com\/ubuntu focal contrib\" | sudo tee \/etc\/apt\/sources.list.d\/rabbitmq.list<\/pre>\n<p>Next, update the packages with the command as shown below.<\/p>\n<pre>$ sudo apt-get update<\/pre>\n<p>Finally, install the RabbitMQ server with the command as shown below.<\/p>\n<pre>$ sudo apt-get install rabbitmq-server -y<\/pre>\n<p>Next, start and enable the RabbitMQ server with the command as shown below.<\/p>\n<pre>$ sudo systemctl start rabbitmq-server<\/pre>\n<pre>$ sudo systemctl enable rabbitmq-server<\/pre>\n<p>Let\u2019s check the status of the RabbitMQ server with the command as shown below.<\/p>\n<pre>$ sudo systemctl status rabbitmq-server<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"295\" class=\"wp-image-13559\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-51.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-51.png 703w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-51-300x126.png 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/p>\n<p>In our case, RabbitMQ service is active and running as shown on above picture.<\/p>\n<h3>Command for the RabbitMQ User Management<\/h3>\n<p>To create a new user, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl add_user admin Password<\/pre>\n<p>Here, we are creating a user \u201cadmin\u201d with password \u201cPassword\u201d<\/p>\n<p>To provide the tags to the user, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl set_user_tags admin administrator<\/pre>\n<p>To give permission for the newly created users, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl set_permissions -p \/ admin \".*\" \".*\" \".*\"<\/pre>\n<p>To change the password of the user, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl change_password user new_password<\/pre>\n<p>To delete the user, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl delete_user user<\/pre>\n<p>To create a new virtual host for improved security, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl add_vhost \/new_vhost<\/pre>\n<p>To provide your preferred vhost as grant user permission, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl set_permissions -p \/vhost user \".*\" \".*\" \".*\"<\/pre>\n<p>To list the permission of the vhosts, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl list_permissions -p \/vhost<\/pre>\n<p>To list the virtualhosts available on your server.<\/p>\n<pre>$ sudo rabbitmqctl list_vhosts<\/pre>\n<p>To delete the virtualhosts available on your server.<\/p>\n<pre>$ sudo rabbitmqctl delete_vhost \/vhost-name<\/pre>\n<p>To list the user permission, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl list_user_permissions user<\/pre>\n<p>To delete the user permissions, run the command as shown below.<\/p>\n<pre>$ sudo rabbitmqctl clear_permissions -p \/vhost user<\/pre>\n<h3>Enabling the RabbitMQ Web Management Dashboard<\/h3>\n<p>If you want to interact with the web interface of the RabbitMQ Dashboard, then simply enable the RabbitMQ management with the command as shown below.<\/p>\n<pre>$ sudo rabbitmq-plugins enable rabbitmq_management<\/pre>\n<p>You will see the similar output after the successful execution of the command.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"273\" class=\"wp-image-13560\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-52.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-52.png 707w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-52-300x116.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n<p>To enable the port number in the firewall of UFW, run the command as shown below.<\/p>\n<pre>$ sudo ufw allow 15672\/tcp<\/pre>\n<p>As you have enabled the plugin for the web interface of the RabbitMQ, You are allowed to access the page by simply opening the browser and putting the respective url \u201c <a href=\"http:\/\/your_ip:15672\">http:\/\/your_IP:15672<\/a>\u201d. Check the screenshot as shown below for further details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1014\" height=\"558\" class=\"wp-image-13561\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-53.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-53.png 1014w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-53-300x165.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-53-768x423.png 768w\" sizes=\"auto, (max-width: 1014px) 100vw, 1014px\" \/><\/p>\n<p>Put your username and password to login and view the dashboard of the site. Check the screenshot as shown below for further details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1254\" height=\"708\" class=\"wp-image-13562\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-54.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-54.png 1254w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-54-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-54-1024x578.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-54-768x434.png 768w\" sizes=\"auto, (max-width: 1254px) 100vw, 1254px\" \/><\/p>\n<p>As you see, we have successfully logged into RabbitMQ dashboard with the admin privilege.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article, you have learnt how to install the Message Broker- RabbitMQ in Ubuntu 20.04 LTS Server. We have shown the successful process of the installation of RabbitMQ server and accessing its web dashboard with the above steps. Thank you!<\/p>","protected":false},"excerpt":{"rendered":"<p>RabbitMQ is free to install as it is an open-source message broker software. It implements the Advanced Message Queuing Protocol(AMQP). It uses plugins such as Streaming Text Oriented&hellip;<\/p>","protected":false},"author":1,"featured_media":13688,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[816,100],"class_list":["post-13558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-rabbitmq","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13558"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13558\/revisions"}],"predecessor-version":[{"id":13689,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13558\/revisions\/13689"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13688"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}