how to install rabbitmq on ubuntu
install rabbitmq

Hi Guys, Welcome to Proto Coders Point. In this article let’s learn how to install RabbitMQ on ubuntu server.

What is RabbitMQ

RabbitMQ is a message queuing protocol, In simple words it is a software that works as message broker.

Eg: Can we use while build microservices envirnoment.

Install rabbitmq ubuntu

Below are step by step commands to install rabbitmq on ubuntu 20.04.

Step 1: Install curl, gnupg, apt-transport-https

sudo apt-get install curl gnupg apt-transport-https -y
install curl gnupg apt-transport-https

Step 2: Download RabbitMQ signing key

curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null

Step 3: Download cloudsmith Erlang repo

curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null

Step 4: Download RabbitMQ repository

curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg > /dev/null

Step 5: Add apt repositories rabbitmq.list

sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF

tee in ubuntu is a command line interpreter used to input and output data in a file.

The about command will create a file by name rabbitmq.list, In this list will add below lines of cmd’s

## Provides modern Erlang/OTP releases
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/deb/ubuntu bionic main

## Provides RabbitMQ
##
deb [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
deb-src [signed-by=/usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg] https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu bionic main
EOF

Example

add apt repositories in rabbitmq.list

Step 6: ubuntu apt-get update

sudo apt-get update -y

Step 7: Install ErLang on ubuntu

sudo apt-get install -y erlang-base \
                        erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
                        erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
                        erlang-runtime-tools erlang-snmp erlang-ssl \
                        erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl

Step 8: Finally Install RabbitMQ

sudo apt-get install rabbitmq-server -y --fix-missing

Step 9: RabbitMQ check status

After successful installing rabbitMQ on ubuntu by following above step, To check is rabbitMQ is working or no use below command to check rabbitmq status.

systemctl status rabbitmq-server
check rabbitmq server status