How to install RabbitMQ Server on Ubuntu 18.04 LTS

RabbitMQ is the most popular free and open source message-queueing or message-broker software.

RabbitMQ is the most popular free and open source message-queueing or message-broker Software. RabbitMQ originally implemented Advanced Message Queuing Protocol (AMQP). It also supports protocols such as STOMP (Streaming Text Oriented Messaging Protocol), and MQTT (Message Queuing Telemetry Transport).

Generally, message-broker software is used for sending and receiving messages between various kinds of distributed services, systems or applications.

RabbitMQ, which has been written in Erlang programming language, has the following features:

  • Support for multiple protocols – AMQP, MQTT, STOMP, HTTP
  • Support for client interfaces and libraries for all major programming languages
  • Clustering / High Availability
  • A diverse set of tools and plugins
  • Routing messages between exchanges and queues
  • User-friendly web interface to monitor and control message broker
  • Tracing capabilities

In this tutorial, we are going to show you how to setup RabbitMQ on Ubuntu 18.04 (Bionic Beaver).

Installing RabbitMQ on Ubuntu

First, let us update ubuntu repositories:

sudo apt-get update

Add Signing Key using either of the following commands:

wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -

or

sudo apt-key adv --keyserver "hkps.pool.sks-keyservers.net" --recv-keys "0x6B73A36E6026DFCA"

Add Key
Add Key

Create Rabbitmq repository file.

 vim /etc/apt/sources.list.d/bintray.rabbitmq.list

Add following repositories to file.

deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https://dl.bintray.com/rabbitmq/debian bionic main

Save and close the file.

Run Repository Update.

sudo apt-get update

Install RabbitMQ Server.

sudo apt-get install rabbitmq-server

Installation
Installation

Check RabbitMQ Server Status.

sudo systemctl status rabbitmq-server.service

Check Status
Check Status

If RabbitMQ is not running, then start service with this command:

sudo systemctl start rabbitmq-server.service

Enable RabbitMQ service on system boot.

sudo systemctl enable rabbitmq-server

RabbitMQ Ports

4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
5672, 5671: used by AMQP 0-9-1 and 1.0 clients without and with TLS
25672: used for inter-node and CLI tools communication
35672-35682: used by CLI tools (Erlang distribution client ports) for communication with nodes and is allocated from a dynamic range
15672: HTTP API clients, management UI and rabbitmqadmin (only if the management plugin is enabled)
61613, 61614: STOMP clients without and with TLS (only if the STOMP plugin is enabled)
1883, 8883: (MQTT clients without and with TLS, if the MQTT plugin is enabled
15674: STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled)
15675: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled)

Allow RabbitMQ Management UI Through Firewall

RabbitMQ management console runs on port 15672 and it needs to be granted permission via the firewall.

sudo ufw allow 15672

After a successful installation, we can access the web management console and it runs on “15672” port.

But by default, ‘Installation Management Console’ plugin is not enabled. This plugin is needed in order to monitor and manage the RabbitMQ server. It is also used to monitor queues, message rates and manage queues, bindings, and users etc.

Let us see how we can enable the ‘Installation Management Console’ plugin. But before we do that, let us take a look at all the RabbitMQ plugins that are available.

sudo rabbitmq-plugins list

Now enable the RabbitMQ Management plugin

sudo rabbitmq-plugins enable rabbitmq_management

Enable Plugin
Enable Plugin

We can access the Management console using the default guest user. But we need to create and add a new Admin user to access Management console.

Here we create a user with username ‘admin’ and password is also ‘admin’. But I would recommend using a strong password for security.

sudo rabbitmqctl add_user admin admin

Admin User
Admin User

Now we tag our user ‘admin’, which we created in the steps above, as ‘administrator’

sudo  rabbitmqctl set_user_tags admin administrator

Tag User
Tag User

Now we are ready to restart RabbitMQ service

sudo systemctl restart rabbitmq-server.service

Before we access Management UI, let us check the ports on the server

sudo netstat -tunlp

Ports
Ports

Management UI access

The Management Console can be accessed using either of these URLs:

  • http://ServerIp or
  • hostname:15672/

Eg: – http://13.236.85.236:15672 / or http://rabbitmq.fosslinux.com:15672

You will be able to view the console login window.

Management Login
Management Login

Then use the already created admin username and password to access the dashboard.

RabbitMQ Management Console
RabbitMQ Management Console

You have successfully installed and configured RabbitMQ server.

If you have any issues or questions feel free to ask in the comments section below.

Darshana
Hey! I'm Darshana, a Linux / DevOps Engineer and also a contributor to FOSS Linux. I enjoy working on various kind of Linux distributions and cloud technologies. During my free time, I love to swim and hike across nature trails. Linux is my love and I'm here to share all my learnings with all of you! Hope you enjoyed reading my article.

4 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,555FansLike
365FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

The 10 Best Linux Server Distros For Home And Businesses

By the year 2020, it is estimated that there are close to 600 Linux distributions in the market. It includes both servers and Desktop versions; therefore, if you are looking for lightweight Linux distribution for your old PC or a reliable desktop version for employees in your organization, you may be overwhelmed with the number of choices for finding one for your use.

How to list the installed Packages on Ubuntu

It is only natural to start installing more and more software on your Ubuntu PC once you start using it. Similarly, it is also natural to lose track of the different packages that you have installed on your system. Eventually, you may be overwhelmed with the number of packages in your system and with the ones you hardly used.

How to configure the Ubuntu Firewall (UFW)

A properly configured firewall is a crucial part of establishing preliminary system security. Keeping this in mind, here we will go over how to configure the firewall on your Ubuntu PC.

How to install and use Zoom on Ubuntu

If you work from home or hold meetings with other people remotely, then you have probably heard of Zoom. It is one of the popular video conferencing software app available today.

How to Restart Networking on Ubuntu

Sometimes resetting your Ubuntu network is required to apply some network configurations like changing your IP from Automatic DHCP to static one. Restarting the network is not a big deal, but should be done carefully.

How to install Chrome and Chromium Browser on Pop!_OS

By default, Pop!_OS comes with Mozilla Firefox Browser installed to help you browse the internet. It is a reliable web browser covering almost all the features and functionalities you need. However, working with Firefox is noticeably different compared to Google Chrome, especially from the speed point of view. Google Chrome is a tad quicker than Firefox.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

What’s New in Ubuntu 20.04 LTS “Focal Fossa”

Ubuntu 20.04 LTS is out now! This is the successor to Ubuntu 18.04, which was released in April 2018 and still has three years of official support left. Code-named Focal Fossa, the new edition has all the bells and whistles included in it, making it one of the best Ubuntu releases yet. Let's find out more.

Top 20 must-have apps for your Ubuntu PC

OK, this one is going to be a long one, so grab a cup of coffee and scroll through the best apps that we think are must-have for your Ubuntu PC. We have hand-picked each one of these considering the most common categories that suit an average Linux user.

6 Best Linux Distros for Laptops

Whether buying a Linux pre-installed laptop or selecting a Linux distro for your existing laptop, there are many things to consider. Let's take you through some of the best Linux distros that are optimized for Laptops in this 2019 edition of the article. Read on.

[Guide] apt vs apt-get commands, and which one to use?

Most Linux users, both veterans, and newbies, often get confused about what the difference between the Linux commands apt, and apt-get are and when they should use one or the other.