Install RabbitMQ Server on CentOS 8 - CentLinux


Saturday, 26 December 2020

Install RabbitMQ Server on CentOS 8


RabbitMQ is an open-source message-broker software built around AMQP protocol. In this guide, you will see how to install RabbitMQ server on CentOS 8.


Table of Contents:


    What is RabbitMQ?:

    RabbitMQ is an open-source message-broker software (sometimes called message-oriented middleware) that originally implemented the Advanced Message Queuing Protocol (AMQP) and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol (STOMP), MQ Telemetry Transport (MQTT), and other protocols.

    The RabbitMQ server program is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Client libraries to interface with the broker are available for all major programming languages including Java, Erlang and .NET Framework. (Source: Wikipedia)

    The RabbitMQ source code is available on RabbitMQ GitHub Repository and it is distributed under Mozilla Public License.


    Environment Specification:

    We are using a minimal CentOS 8 virtual machine with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - CentOS 8.3
    • Hostname –
    • IP Address - /24


    RabbitMQ Features:

    Some of the main features of RabbitMQ are:

    • Reliability
    • Flexible Routing
    • Clustering
    • Federation Model
    • Highly Available Queues
    • Multi-protocol
    • Management UI
    • Tracing
    • Plugin System
    • Large Community
    • Commercial Support

    You may find the complete RabbitMQ features on their official website.


    Update Your Linux Server:

    Use a ssh client to connect with server as Linux root user.

    Update software packages in your Linux server to the latest stable releases by using dnf command.

    You may read our previous article, if you want to completely upgrade CentOS 7 to CentOS 8 operating system.

    [root@rabbitmq-01 ~]# dnf update -y ... Installed: centos-linux-release-8.3-1.2011.el8.noarch centos-linux-repos-8-2.el8.noarch crypto-policies-scripts-20200713-1.git51d1222.el8.noarch kernel-4.18.0-240.1.1.el8_3.x86_64 kernel-core-4.18.0-240.1.1.el8_3.x86_64 kernel-modules-4.18.0-240.1.1.el8_3.x86_64 libmodulemd-2.9.4-2.el8.x86_64 memstrack-0.1.11-1.el8.x86_64 Removed: kernel-4.18.0-193.14.2.el8_2.x86_64 kernel-core-4.18.0-193.14.2.el8_2.x86_64 kernel-modules-4.18.0-193.14.2.el8_2.x86_64 Complete!

    Check the Linux operating system and Kernel version of the virtual machine in use here.

    [root@rabbitmq-01 ~]# cat /etc/redhat-release CentOS Linux release 8.3.2011 [root@rabbitmq-01 ~]# uname -r 4.18.0-240.1.1.el8_3.x86_64


    Install EPEL Yum Repository on Linux Server:

    Some of the required software packages by RabbitMQ server are available in EPEL (Extra Packages for Enterprise Linux) yum repository.

    Therefore, you are required to enable/install EPEL yum repository on your Linux server before installing RabbitMQ.

    [root@rabbitmq-01 ~]# dnf install -y epel-release Last metadata expiration check: 0:01:41 ago on Wed 23 Dec 2020 10:43:32 PM PKT. Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: epel-release noarch 8-8.el8 extras 23 k Transaction Summary ================================================================================ Install 1 Package Total download size: 23 k Installed size: 32 k Downloading Packages: epel-release-8-8.el8.noarch.rpm 32 kB/s | 23 kB 00:00 -------------------------------------------------------------------------------- Total 12 kB/s | 23 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : epel-release-8-8.el8.noarch 1/1 Running scriptlet: epel-release-8-8.el8.noarch 1/1 Verifying : epel-release-8-8.el8.noarch 1/1 Installed: epel-release-8-8.el8.noarch Complete!


    Install RabbitMQ Official Yum Repository on Linux Server:

    To install a latest version of RabbitMQ server, you can either compile the source code for your preferred Linux distro, or you can add the RabbitMQ official yum repository to install RabbitMQ software from pre-compiled RPM packages.

    RabbitMQ software provides a bash script for automated installation of their official yum repository.

    Execute the following command to install RabbitMQ yum repository on your Linux server.

    [root@rabbitmq-01 ~]# curl -s | sudo bash Detected operating system as centos/8. Checking for curl... Detected curl... Downloading repository file: done. Installing yum-utils... rabbitmq_rabbitmq-server-source 129 B/s | 819 B 00:06 rabbitmq_rabbitmq-server-source 1.1 kB/s | 3.9 kB 00:03 Importing GPG key 0x4D206F89: Userid : " ( <>" Fingerprint: 8C69 5B02 19AF DEB0 4A05 8ED8 F4E7 8920 4D20 6F89 From : rabbitmq_rabbitmq-server-source 32 B/s | 296 B 00:09 Package yum-utils-4.0.17-5.el8.noarch is already installed. Dependencies resolved. Nothing to do. Complete! Generating yum cache for rabbitmq_rabbitmq-server... Importing GPG key 0x4D206F89: Userid : " ( <>" Fingerprint: 8C69 5B02 19AF DEB0 4A05 8ED8 F4E7 8920 4D20 6F89 From : Generating yum cache for rabbitmq_rabbitmq-server-source... The repository is setup! You can now install packages.

    Build cache for newly install yum repositories.

    [root@rabbitmq-01 ~]# dnf makecache CentOS Linux 8 - AppStream 3.5 kB/s | 4.3 kB 00:01 CentOS Linux 8 - BaseOS 4.3 kB/s | 3.9 kB 00:00 CentOS Linux 8 - Extras 1.5 kB/s | 1.5 kB 00:00 Extra Packages for Enterprise Linux Modular 8 - 27 kB/s | 104 kB 00:03 Extra Packages for Enterprise Linux 8 - x86_64 88 kB/s | 8.7 MB 01:40 rabbitmq_rabbitmq-server 99 B/s | 833 B 00:08 rabbitmq_rabbitmq-server-source 152 B/s | 819 B 00:05 Metadata cache created.


    Install RabbitMQ Server on CentOS 8:

    Now, you can easily install RabbitMQ server by using a dnf command. All the dependencies will be resolved automatically because you have already setup the EPEL yum repository on your Linux server.

    [root@rabbitmq-01 ~]# dnf install -y rabbitmq-server ... Installed: SDL-1.2.15-38.el8.x86_64 abattis-cantarell-fonts-0.0.25-4.el8.noarch adobe-mappings-cmap-20171205-3.el8.noarch adobe-mappings-cmap-deprecated-20171205-3.el8.noarch adobe-mappings-pdf-20180407-1.el8.noarch adwaita-cursor-theme-3.28.0-2.el8.noarch adwaita-icon-theme-3.28.0-2.el8.noarch at-spi2-atk-2.26.2-1.el8.x86_64 at-spi2-core-2.28.0-1.el8.x86_64 atk-2.28.1-1.el8.x86_64 avahi-libs-0.7-19.el8.x86_64 cairo-1.15.12-3.el8.x86_64 cairo-gobject-1.15.12-3.el8.x86_64 colord-libs-1.4.2-1.el8.x86_64 copy-jdk-configs-3.7-4.el8.noarch cups-libs-1:2.2.6-38.el8.x86_64 dconf-0.28.0-3.el8.x86_64 dejavu-fonts-common-2.35-6.el8.noarch dejavu-sans-mono-fonts-2.35-6.el8.noarch emacs-filesystem-1:26.1-5.el8.noarch erlang-22.0.7-1.el8.x86_64 erlang-asn1-22.0.7-1.el8.x86_64 erlang-common_test-22.0.7-1.el8.x86_64 erlang-compiler-22.0.7-1.el8.x86_64 erlang-crypto-22.0.7-1.el8.x86_64 erlang-debugger-22.0.7-1.el8.x86_64 erlang-dialyzer-22.0.7-1.el8.x86_64 erlang-diameter-22.0.7-1.el8.x86_64 erlang-edoc-22.0.7-1.el8.x86_64 erlang-eldap-22.0.7-1.el8.x86_64 erlang-erl_docgen-22.0.7-1.el8.x86_64 erlang-erl_interface-22.0.7-1.el8.x86_64 erlang-erts-22.0.7-1.el8.x86_64 erlang-et-22.0.7-1.el8.x86_64 erlang-eunit-22.0.7-1.el8.x86_64 erlang-ftp-22.0.7-1.el8.x86_64 erlang-hipe-22.0.7-1.el8.x86_64 erlang-inets-22.0.7-1.el8.x86_64 erlang-jinterface-22.0.7-1.el8.x86_64 erlang-kernel-22.0.7-1.el8.x86_64 erlang-megaco-22.0.7-1.el8.x86_64 erlang-mnesia-22.0.7-1.el8.x86_64 erlang-observer-22.0.7-1.el8.x86_64 erlang-odbc-22.0.7-1.el8.x86_64 erlang-os_mon-22.0.7-1.el8.x86_64 erlang-parsetools-22.0.7-1.el8.x86_64 erlang-public_key-22.0.7-1.el8.x86_64 erlang-reltool-22.0.7-1.el8.x86_64 erlang-runtime_tools-22.0.7-1.el8.x86_64 erlang-sasl-22.0.7-1.el8.x86_64 erlang-snmp-22.0.7-1.el8.x86_64 erlang-ssh-22.0.7-1.el8.x86_64 erlang-ssl-22.0.7-1.el8.x86_64 erlang-stdlib-22.0.7-1.el8.x86_64 erlang-syntax_tools-22.0.7-1.el8.x86_64 erlang-tftp-22.0.7-1.el8.x86_64 erlang-tools-22.0.7-1.el8.x86_64 erlang-wx-22.0.7-1.el8.x86_64 erlang-xmerl-22.0.7-1.el8.x86_64 fontconfig-2.13.1-3.el8.x86_64 fontpackages-filesystem-1.44-22.el8.noarch fribidi-1.0.4-8.el8.x86_64 gd-2.2.5-7.el8.x86_64 gdk-pixbuf2-2.36.12-5.el8.x86_64 gdk-pixbuf2-modules-2.36.12-5.el8.x86_64 glib-networking-2.56.1-1.1.el8.x86_64 google-droid-sans-fonts-20120715-13.el8.noarch graphite2-1.3.10-10.el8.x86_64 graphviz-2.40.1-40.el8.x86_64 gsettings-desktop-schemas-3.32.0-5.el8.x86_64 gtk-update-icon-cache-3.22.30-6.el8.x86_64 gtk2-2.24.32-4.el8.x86_64 gtk3-3.22.30-6.el8.x86_64 harfbuzz-1.7.5-3.el8.x86_64 hicolor-icon-theme-0.17-2.el8.noarch jasper-libs-2.0.14-4.el8.x86_64 java-1.8.0-openjdk-headless-1: javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch jbig2dec-libs-0.14-4.el8_2.x86_64 jbigkit-libs-2.1-14.el8.x86_64 json-glib-1.4.4-1.el8.x86_64 lcms2-2.9-2.el8.x86_64 libICE-1.0.9-15.el8.x86_64 libSM-1.2.3-1.el8.x86_64 libX11-1.6.8-3.el8.x86_64 libX11-common-1.6.8-3.el8.noarch libX11-xcb-1.6.8-3.el8.x86_64 libXau-1.0.9-3.el8.x86_64 libXaw-1.0.13-10.el8.x86_64 libXcomposite-0.4.4-14.el8.x86_64 libXcursor-1.1.15-3.el8.x86_64 libXdamage-1.1.4-14.el8.x86_64 libXext-1.3.4-1.el8.x86_64 libXfixes-5.0.3-7.el8.x86_64 libXft-2.3.3-1.el8.x86_64 libXi-1.7.10-1.el8.x86_64 libXinerama-1.1.4-1.el8.x86_64 libXmu-1.1.3-1.el8.x86_64 libXpm-3.5.12-8.el8.x86_64 libXrandr-1.5.2-1.el8.x86_64 libXrender-0.9.10-7.el8.x86_64 libXt-1.1.5-12.el8.x86_64 libXtst-1.2.3-7.el8.x86_64 libXxf86misc-1.0.4-1.el8.x86_64 libXxf86vm-1.1.4-9.el8.x86_64 libdatrie-0.2.9-7.el8.x86_64 libepoxy-1.5.3-1.el8.x86_64 libfontenc-1.1.3-8.el8.x86_64 libglvnd-1:1.2.0-6.el8.x86_64 libglvnd-glx-1:1.2.0-6.el8.x86_64 libgs-9.25-7.el8.x86_64 libgusb-0.3.0-1.el8.x86_64 libidn-1.34-5.el8.x86_64 libijs-0.35-5.el8.x86_64 libjpeg-turbo-1.5.3-10.el8.x86_64 libmcpp-2.7.2-20.el8.x86_64 libmodman-2.0.1-17.el8.x86_64 libpaper-1.1.24-22.el8.x86_64 libproxy-0.4.15-5.2.el8.x86_64 librsvg2-2.42.7-4.el8.x86_64 libsoup-2.62.3-2.el8.x86_64 libthai-0.1.27-2.el8.x86_64 libtiff-4.0.9-18.el8.x86_64 libwayland-client-1.17.0-1.el8.x86_64 libwayland-cursor-1.17.0-1.el8.x86_64 libwayland-egl-1.17.0-1.el8.x86_64 libwebp-1.0.0-1.el8.x86_64 libxcb-1.13.1-1.el8.x86_64 libxshmfence-1.3-2.el8.x86_64 lksctp-tools-1.0.18-3.el8.x86_64 lua-5.3.4-11.el8.x86_64 mcpp-2.7.2-20.el8.x86_64 mesa-libGL-20.1.4-1.el8.x86_64 mesa-libGLU-9.0.0-15.el8.x86_64 mesa-libglapi-20.1.4-1.el8.x86_64 openjpeg2-2.3.1-6.el8.x86_64 pango-1.42.4-6.el8.x86_64 pixman-0.38.4-1.el8.x86_64 rabbitmq-server-3.8.9-1.el8.noarch rest-0.8.1-2.el8.x86_64 socat- tzdata-java-2020d-1.el8.noarch unixODBC-2.3.7-1.el8.x86_64 urw-base35-bookman-fonts-20170801-10.el8.noarch urw-base35-c059-fonts-20170801-10.el8.noarch urw-base35-d050000l-fonts-20170801-10.el8.noarch urw-base35-fonts-20170801-10.el8.noarch urw-base35-fonts-common-20170801-10.el8.noarch urw-base35-gothic-fonts-20170801-10.el8.noarch urw-base35-nimbus-mono-ps-fonts-20170801-10.el8.noarch urw-base35-nimbus-roman-fonts-20170801-10.el8.noarch urw-base35-nimbus-sans-fonts-20170801-10.el8.noarch urw-base35-p052-fonts-20170801-10.el8.noarch urw-base35-standard-symbols-ps-fonts-20170801-10.el8.noarch urw-base35-z003-fonts-20170801-10.el8.noarch wxBase3-3.0.4-11.el8.x86_64 wxGTK3-3.0.4-11.el8.x86_64 wxGTK3-gl-3.0.4-11.el8.x86_64 wxGTK3-i18n-3.0.4-11.el8.noarch xorg-x11-font-utils-1:7.5-40.el8.x86_64 xorg-x11-fonts-ISO8859-1-100dpi-7.5-19.el8.noarch xorg-x11-server-utils-7.7-27.el8.x86_64 Complete!

    Enable and start RabbitMQ service as follows.

    [root@rabbitmq-01 ~]# systemctl enable --now rabbitmq-server.service Created symlink /etc/systemd/system/ â /usr/lib/systemd/system/rabbitmq-server.service.

    Verify the status of RabbitMQ service.

    [root@rabbitmq-01 ~]# systemctl status rabbitmq-server.service â rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; ve> Active: active (running) since Wed 2020-12-23 23:05:39 PKT; 3min 31s ago Main PID: 2949 (beam.smp) Status: "Initialized" Tasks: 85 (limit: 5811) Memory: 98.2M CGroup: /system.slice/rabbitmq-server.service ââ2949 /usr/lib64/erlang/erts-10.4.4/bin/beam.smp -W w -K true -A 64> ââ3046 erl_child_setup 32768 ââ3066 /usr/lib64/erlang/erts-10.4.4/bin/epmd -daemon ââ3083 inet_gethost 4 ââ3084 inet_gethost 4 Dec 23 23:05:24 rabbitmq-server[2949]: ########## > Dec 23 23:05:24 rabbitmq-server[2949]: Doc guides: > Dec 23 23:05:24 rabbitmq-server[2949]: Support: > Dec 23 23:05:24 rabbitmq-server[2949]: Tutorials: > Dec 23 23:05:24 rabbitmq-server[2949]: Monitoring: > Dec 23 23:05:24 rabbitmq-server[2949]: Logs: /var/l> Dec 23 23:05:24 rabbitmq-server[2949]: /var/l> Dec 23 23:05:24 rabbitmq-server[2949]: Config file(> Dec 23 23:05:38 rabbitmq-server[2949]: Starting bro>


    Install RabbitMQ Managment UI on CentOS 8:

    Although RabbitMQ software contains sufficient CLI (command line) tools for administration of RabbitMQ server.

    But you can optionally install the RabbitMQ management UI to perform GUI based administration.

    Execute following command to install RabbitMQ Management UI on your Linux server.

    [root@rabbitmq-01 ~]# rabbitmq-plugins enable rabbitmq_management Enabling plugins on node rabbit@rabbitmq-01: rabbitmq_management The following plugins have been configured: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch Applying plugin configuration to rabbit@rabbitmq-01... The following plugins have been enabled: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch started 3 plugins.

    Verify that the RabbitMQ Management UI service is running on default port 15672.

    [root@rabbitmq-01 ~]# ss -tulpn | grep 15672 tcp LISTEN 0 128* users:(("beam.smp",pid=2949,fd=98))

    To allow incoming traffic to RabbitMQ Management UI, you are required to allow the default service port 15672/tcp in Linux firewall.

    Further, RabbitMQ uses port 5672/tcp for AMQP protocol based queues. Therefore, you should also enable it in the Linux Firewall.

    Execute the following command to allow required ports in Linux firewall.

    [root@rabbitmq-01 ~]# firewall-cmd --permanent --add-port={5672,15672}/tcp success [root@rabbitmq-01 ~]# firewall-cmd --reload success


    Create Admin User for RabbitMQ Management UI:

    RabbitMQ software shipped with a default user guest with password guest. This guest user has administrative privileges but it can only be login to RabbitMQ server from localhost.

    Therefore, we need to create another admin user to access RabbitMQ Management UI remotely.

    First, check the already available users on RabbitMQ server.

    [root@rabbitmq-01 ~]# rabbitmqctl list_users Listing users ... user tags guest [administrator]

    Now, execute following command at Linux command line to create a new user for administration of RabbitMQ server.

    [root@rabbitmq-01 ~]# rabbitmqctl add_user admin Str0ngP@ssw0rd Adding user "admin" ... [root@rabbitmq-01 ~]# rabbitmqctl set_user_tags admin administrator Setting tags for user "admin" to [administrator] ...

    Open URL in a web browser.


    Login as admin user that you have created in previous steps.


    After successful login, you may reach at the dashboard of RabbitMQ Management UI. You can perform complete administration of your RabbitMQ server from here.

    We strongly recommend that you should buy and read RabbitMQ in Depth by Manning Publications to grow your knowledge in this area and to use the RabbitMQ server for your applications.



    In this guide, you have successfully installed RabbitMQ server on CentOS 8.