In this tutorial, we will show you how to install RabbitMQ on your Ubuntu 20.04 LTS. For those of you who didn’t know, 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.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of RabbitMQ on Ubuntu 20.04 Focal Fossa. You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, and any other Debian-based distribution like Linux Mint or elementary OS.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install RabbitMQ on Ubuntu 20.04 LTS Focal Fossa
Step 1. 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
Step 2. Installing 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
Step 3. Installing RabbitMQ on Ubuntu 20.04.
First, you need to import RabbitMQ:
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:
sudo systemctl enable rabbitmq-server sudo systemctl start rabbitmq-server
Step 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
Step 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
Step 6. Accessing 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. Then login with the username and assigned password:
rabbitmqctl add_user admin StrongPassword rabbitmqctl set_user_tags admin administrator
Congratulations! You have successfully installed RabbitMQ. Thanks for using this tutorial for installing RabbitMQ on Ubuntu 20.04 LTS (Focal Fossa) system. For additional help or useful information, we recommend you check the official RabbitMQ website.