×


Install RabbitMQ on Ubuntu 20.04 LTS - A step by step guide ?

RabbitMQ is open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server 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.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Open-source Software Installation queries.

In this context, we shall look into how to install RabbitMQ on your Ubuntu 20.04 LTS.


Steps to Install  and configure RabbitMQ on Ubuntu 20.04 LTS Focal Fossa ?

1. Perform system update

First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal:

$ sudo apt update
$ sudo apt upgrade


2. Install Erlang

Now we add the repository to your Ubuntu system by running the following commands:

$ echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/rabbitmq.list

Next, update your system package list and install Erlang:

$ sudo apt update
$ sudo apt install erlang


3. Install RabbitMQ on the system

Start by importing RabbitMQ keys:

$ sudo apt install apt-transport-https -y
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

Then, add the RabbitMQ repository to Ubuntu:

echo "deb https://dl.bintray.com/rabbitmq-erlang/debian focal erlang-22.x" | sudo tee /etc/apt/sources.list.d/rabbitmq.list

Now we just need to run an update and install the rabbitmq-server from our newly added package:

$ sudo apt update
$ sudo apt install rabbitmq-server

Once successfully installed, RabbitMQ starts and is enabled on boot. You can check this by using the below commands:

$ sudo systemctl enable rabbitmq-server
$ sudo systemctl start rabbitmq-server


4. Access RabbitMQ management console

For easy management, you can even enable the RabbitMQ Management Dashboard. To install the plugin, use the following command:

$ sudo rabbitmq-plugins enable rabbitmq_management


5. Configure Firewall

If you have an active UFW firewall, open both ports 5672 and 15672:

$ sudo ufw allow proto tcp from any to any port 5672,15672


How to access RabbitMQ Web Interface ?

RabbitMQ will be available on HTTP port 15672 by default. 

Open your favorite browser and navigate to http://your-domain.com:15672 or http://server-ip-address:15672 and complete the required steps to finish the installation.

By default, the guest user exists and can connect only from localhost. You can log in with this user locally with the password "guest".

To log into the network, create an admin user with the below commands:

$ rabbitmqctl add_user admin StrongPassword
$ rabbitmqctl set_user_tags admin administrator

Then login with the created username and assigned password.


How to uninstall RabbitMQ from your Ubuntu linux system ?

You can remove RabbitMQ from the system by running the below command:

$ sudo apt-get remove rabbitmq-server


[Need assistance in installing any Software on your Linux system ? We can help you. ]


Conclusion

This article covers the complete process of installing RabbitMQ on Ubuntu 20.04 LTS (Focal Fossa) system. In fact, RabbitMQ is one of the most popular open-source Message Broker Program which uses Advanced Message Queuing Protocol (AMQP) and Streaming Text Oriented Messaging Protocol, Message Queuing Telemetry Transport, and other protocols via Plugins.

For additional help or useful information, we recommend you to check the official RabbitMQ website.