Atlantic.Net Blog

How to Install and Configure RabbitMQ Server on Rocky Linux 8

Hitesh Jethva
by Atlantic.Net (414 posts) under Dedicated Server Hosting, Tutorials
0 Comments

RabbitMQ is a free and open-source message broker software solution designed for applications that need to support legacy protocols, such as STOMP and MQTT. It is written in Erlang and can be used in implementing AMQP on modern operating systems. RabbitMQ receives messages from publishers and routes them to consumers. It provides your application with a common platform to send and receive messages. Currently, RabbitMQ is used worldwide by both small startups and large organizations.

In this post, we will show you how to install the RabbitMQ server on Rocky Linux 8.

Prerequisites

  • A server running Rocky Linux 8 on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Rocky Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2 – Install Required Repositories

Before starting, you will need to install EPLE, Erlang, and RabbitMQ repositories to your server.

First, install the EPEL repository using the command given below:

dnf install epel-release curl -y

Next, install the Erlang and RabbitMQ repository with the following command:

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | bash
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | bash

Step 3 – Install Erlang

Next, you will also need to install Erlang on your server. Run the following command to install Erlang:

dnf install erlang -y

Once Erlang is installed, run the following command to verify the Erlang:

erl

You will be connected to the Erlang shell, as shown below:

Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit]

Eshell V12.2  (abort with ^G)
1>

Press CTRL+C and type a to exit from the Erlang shell.

Step 4 – Install RabbitMQ on Rocky Linux 8

Now, run the following command to install the RabbitMQ server to your system.

dnf install rabbitmq-server -y

Once the RabbitMQ server is installed, start the enable the RabbitMQ service with the following command:

systemctl start rabbitmq-server
systemctl enable rabbitmq-server

Step 5 – Configure RabbitMQ

By default, RabbitMQ uses a guest user to connect from localhost. It is recommended to create an admin user and set a password to secure RabbitMQ.

To create an admin user, run the following command:

rabbitmqctl add_user admin

Sample output:

Adding user "admin" ...
Password: 

Next, assign administrator permissions to the admin user with the following command:

rabbitmqctl set_user_tags admin administrator

You can now verify the created user using the following command:

rabbitmqctl list_users

You will get the following output:

Listing users ...
user	tags
admin	[administrator]
guest	[administrator]

To add a new vhost, run the following command:

rabbitmqctl add_vhost /new_vhost

To list all vhosts, run the following command:

rabbitmqctl list_vhosts

You will get the following output:

Listing vhosts ...
name
/
/new_vhost

Next, provide admin user permissions on vhosts using the following command:

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

Step 6 – Enable RabbitMQ Web UI

RabbitMQ provides a web interface to manage the RabbitMQ. However, it is disabled by default.

To enable the RabbitMQ web UI, run the following command:

rabbitmq-plugins enable rabbitmq_management

You will get the following output:

Enabling plugins on node [email protected]:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to [email protected]
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.

Next, restart the RabbitMQ service to apply the changes.

systemctl restart rabbitmq-server

You can check the status of RabbitMQ using the following command:

rabbitmqctl status

You will get the following output:

Status of node [email protected] ...
Runtime

OS PID: 19057
OS: Linux
Uptime (seconds): 12
Is under maintenance?: false
RabbitMQ version: 3.9.11
Node name: [email protected]
Erlang configuration: Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit]
Erlang processes: 363 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:

Step 7 – Access RabbitMQ Web UI

At this point, the RabbitMQ web UI is started and listens on port 15672. You can check it using the following command:

ss -antpl | grep 15672

You will get the following output:

LISTEN 0      128          0.0.0.0:15672      0.0.0.0:*    users:(("beam.smp",pid=19057,fd=35))                                                                                                

Now, open your web browser and access the RabbitMQ web UI using the URL http://your-server-ip:15672. You should see the RabbitMQ login page:
RabbitMQ login page
Provide your admin username, password and click on the Login button. You should see the RabbitMQ dashboard on the following page:
RabbitMQ dashboard

Conclusion

In this post, we explained how to install and configure the RabbitMQ server on Rocky Linux 8. We also explained how to enable the RabbitMQ web UI and set an admin password. Hopefully, this guide will help you to install the RabbitMQ server in the production environment. Try it on dedicated hosting from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Top 10 Best Cybersecurity Training Services
How to Install Ansible on Oracle Linux 8
How to Install LEMP Server on Oracle Linux 8
How to Install and Configure Apache Webserver on Oracle Linux 8
How to Install and Configure Nginx Webserver on Oracle Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Dallas, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources