RabbitMQ is a free and open-source message broker. Supporting multiple message protocols, RabbitMQ is the most widely used message broker on the Internet. It supports protocols such as AMQP, STOMP, MQTT, HTTP, WebSockets, and the RabbitMQ Stream. RabbitMQ is fully compliant with the JMS 1.1 standard and is suitable for various development scenarios, from small to medium to large deployment environments.

As a message broker, RabbitMQ sits between applications and allows them to communicate with each other asynchronously, reliably, and conveniently. It also provides temporary storage between applications and protects against data loss.

In this guide, you’ll learn how to install the RabbitMQ server on an Ubuntu 24.04 server. You’ll also learn how to enable the RabbitMQ plugin, set up a RabbitMQ administrator user, and then access the RabbitMQ management dashboard through your web browser.

Prerequisites

To complete this guide, make sure you have:

  • An Ubuntu 24.04 server
  • A non-root user with administrator privileges

Method 1: Installing RabbitMQ Server via Ubuntu repository

By default, the Ubuntu repository provides a RabbitMQ server package that you can install through APT. If you prefer the easiest and cleanest system (without adding a third-party repository) to install RabbitMQ, you can install RabbitMQ through the Ubuntu repository.

First of all, run the command below to update your Ubuntu package index to the latest version.

sudo apt update

<img alt="update repo" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/1.png66bb56c99dfd1.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="204" loading="lazy" src="data:image/svg xml,” width=”671″>

Now install the ‘rabbitmq-server‘ package with the ‘apt install‘ command below. Enter ‘Y‘ to confirm the installation.

sudo apt install rabbitmq-server

<img alt="install rabbitmq server" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/2.png66bb56c9d8fac.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="297" loading="lazy" src="data:image/svg xml,” width=”750″>

After the installation is complete, check the ‘rabbitmq-server‘ service using the command below. You’ll see the RabbitMQ server is enabled and running.

sudo systemctl is-enabled rabbitmq-server

sudo systemctl status rabbitmq-server

<img alt="check service status" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/3.png66bb56ca13abd.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="204" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, you can also verify the ports that are used by the RabbitMQ server with the following:

ss -tulpn

You can see port ‘5672‘ are used by the beam service like this:

<img alt="check rabbitmq port" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/4.png66bb56ca4e6da.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="119" loading="lazy" src="data:image/svg xml,” width=”750″>

Method 2: Installing RabbitMQ Server via Cloudsmith mirror

If you need to get the latest version and update of the RabbitMQ server, you can use the third-party repository provided by Cloudsmith Mirror to install the RabbitMQ server. In this section, you’ll add the Cloudsmith mirror repository, and then install the RabbitMQ server from it.

Add the Cloudsmith mirror for the RabbitMQ server package by executing the command below. With this, you’ll automatically add the GPG key and repository for RabbitMQ.

curl -1sLf 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/setup.deb.sh' | sudo -E bash

<img alt="add repo" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/10.png66bb56caa6248.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="319" loading="lazy" src="data:image/svg xml,” width=”750″>

After the process is finished, run the following ‘apt install’ command to install the RabbitMQ server.

sudo apt install rabbitmq-server

Input ‘Y‘ to proceed with the installation.

<img alt="install rabbitmq" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/11.png66bb56caed0b3.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="336" loading="lazy" src="data:image/svg xml,” width=”750″>

When the installation is complete, check the ‘rabbitmq-server‘ service with the following. You can sen the RabbitMQ server is automatically enabled and running.

sudo systemctl is-enabled rabbitmq-server

sudo systemctl status rabbitmq-server

As for the RabbitMQ server port, use the ‘ss‘ command below to ensure port ‘5672‘ is in the LISTEN state.

ss -tulpn

Setting up the RabbitMQ server

After the RabbitMQ server is installed, you can change the default bind IP address and node name through the RabbitMQ config file ‘/etc/rabbitmq/rabbitmq-env.conf‘. This is optional, especially if you want to build a RabbitMQ cluster that will be running on a local/private IP address. Also, do not run RabbitMQ directly on a public IP address.

Edit the RabbitMQ configuration ‘/etc/rabbitmq/rabbitmq-env.conf’ file with the ‘nano‘ editor.

sudo nano /etc/rabbitmq/rabbitmq-env.conf

Change the ‘NODENAME‘ with your server hostname, the ‘NODE_IP_ADDRESS‘ with the internal IP address of your Ubuntu server, and/or you can leave the ‘NODE_PORT‘ as default. In this example, we’ll run RabbitMQ on the local IP address ‘192.168.5.65‘.

NODENAME=noble64

NODE_IP_ADDRESS=192.168.5.65

NODE_PORT=5672

Save the file and exit the editor.

Now run the ‘systemctl‘ command below to restart the RabbitMQ server and apply your changes.

sudo systemctl restart rabbitmq-server

Lastly, run the ‘ss‘ command below to ensure that the RabbitMQ server is running on your internal IP address.

ss -tulpn | grep 5672

The following shows that the RabbitMQ server is running on IP address ‘192.168.5.65‘.

<img alt="rabbitmq port" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/5.png66bb56cb1c54a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="266" loading="lazy" src="data:image/svg xml,” width=”750″>

Setting up RabbitMQ administrator

In this section, you’ll learn how to enable the ‘rabbitmq_management‘ plugin through the ‘rabbitmq-plugins‘. This will provide you with an administrator interface that allows you to monitor and configure RabbitMQ through a web browser. After that, you’ll also create an administrator user for your RabbitMQ server installation via the ‘rabbitmqctl’ command line.

First, execute the ‘rabbitmq-plugins‘ command below to enable the ‘rabbitmq_management‘ plugin. This will enable other plugins such as ‘rabbitmq_management_agent‘, and ‘rabbitmq_web_dispatch‘.

sudo rabbitmq-plugins enable rabbitmq_management

<img alt="enable management plugin" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/6.png66bb56cb459d9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="354" loading="lazy" src="data:image/svg xml,” width=”663″>

Now run the command below to create a new user ‘admin‘ with the password ‘adminpass‘. Then, make the ‘admin‘ user an administrator and allow permissions to all available vhosts in the RabbitMQ server.

rabbitmqctl add_user admin adminpass

rabbitmqctl set_user_tags admin administrator

rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

<img alt="setup administrator" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/7.png66bb56cb65e0e.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="218" loading="lazy" src="data:image/svg xml,” width=”750″>

Next, run the ‘systemctl‘ command below to restart the RabbitMQ server and apply your changes. Once executed, the RabbitMQ management will be running on port ‘15672‘.

sudo systemctl restart rabbitmq-server

Check the open ports on your system with the following command. You will see port ‘15672‘ is in the LISTEN state.

ss -tulpn

Access RabbitMQ management

Visit your Ubuntu server IP address, such as http://192.168.5.65:15672/. If everything goes well, you’ll get the RabbitMQ login page.

Enter the user ‘admin‘ and password ‘adminpass‘, then click Login to confirm. Change those credentials if you have a different username and password.

<img alt="login" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/8.png66bb56cb82e8a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="199" loading="lazy" src="data:image/svg xml,” width=”518″>

If successful, you’ll get the following RabbitMQ management dashboard.

<img alt="dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/08/echo/9.png66bb56cba9e53.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="335" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! You’ve completed the installation of the RabbitMQ server on Ubuntu 24.04. You’ve learned two methods for installing RabbitMQ, through the Ubuntu repository and using Cloudsmith mirror. After that, you’ve also changed the RabbitMQ bind address and node name, enabled the ‘rabbitmq_management’ plugins, and created an administrator user using the ‘rabbitmqctl’ utility.

You can install RabbitMQ on other servers and create the cluster from here.