Installing RabbitMQ on Ubuntu 18.04 LTS

Install latest RabbitMQ and Erlang packages

To keep it short and simple, we'll just see how to install RabbitMQ latest version on Ubuntu 18.04 LTS. RabbitMQ depends on Erlang. Without going into more complexities we'll use the latest distribution of Erlang maintained by the RabbitMQ team on Bintray Distribution Center.

Let's begin by updating and upgrading our system. Run the following command to get the latest versions of the packages installed on our system


sudo apt-get update && apt-get upgrade

In order to install Erlang from Bintry which is maintained by the RabbitMQ team, we'll have to add and tell the apt-key to trust the key used to sign RabbitMQ releases.


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

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

Now that we have added the signing key, we need to specify the version of Erlang which should be installed. This can be done by adding the following line to /etc/apt/sources.list.d/bintray.erlang.list file. You'll have to create the file. The file will look like below for Ubuntu 18.04 LTS i.e. bionic version of Ubuntu. The last parameter erlang specifies the latest version. You can specify the version of Erlang as erlang-19.x, erlang-20.x, etc.

Next, install Erlang with apt-get


sudo apt-get install erlang

Erlang installed!! Now we have to specify the version of RabbitMQ to be installed. We can do it as we did for the Erlang by using an editor and specifying in the file /etc/apt/sources.list.d/bintray.rabbitmq.list or use the below command.


echo "deb https://dl.bintray.com/rabbitmq/debian bionic main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list

We are now ready to install RabbitMQ. Just run the below command


sudo apt-get update && sudo apt-get install rabbitmq-server

It's done!! Check the status of the RabbitMQ using rabbitmqctl - a command line tool for managing a RabbitMQ broker. If RabbitMQ is running, you'll get long outupt printed on the screen with various details about the server and the nodes.

If it's not running i.e. inactive, you will see an Error: Unable to perform operation... on the terminal.

In order to start the rabbit-server hit the below command


sudo service rabbitmq-server start

That's all. Comment below if you need any help in the installation.