Operations 6 min read

How to Install and Configure RabbitMQ on Linux: Step‑by‑Step Guide

This guide explains how to install Erlang, download and compile RabbitMQ 3.0.4, start the server in detached mode, verify its status, and troubleshoot common issues such as port conflicts on CentOS 6, providing complete command‑line instructions and configuration tips.

Raymond Ops
Raymond Ops
Raymond Ops
How to Install and Configure RabbitMQ on Linux: Step‑by‑Step Guide

RabbitMQ is an open‑source message‑queue server that lets you place messages into a queue from one application and retrieve them from the same or another application, supporting multiple programming languages.

Install Erlang

RabbitMQ requires Erlang to run. The stable Erlang version at the time of writing is R16B, which can be downloaded from the Erlang website.

<code>cd /usr/save
wget http://www.erlang.org/download/otp_src_R16B.tar.gz
tar xvfz /usr/save/otp_src_R16B.tar.gz</code>

After downloading, install Erlang from source:

<code>cd otp_src_R16B
LANG=C; export LANG
./configure
make
make install</code>

Verify Erlang

Run

erl

from the command line; you should see the Erlang shell, confirming a successful installation.

<code># erl
Erlang R16B (erts-5.10.1) [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.1 (abort ^G)</code>

Download RabbitMQ

The stable RabbitMQ server version is 3.0.4. For this example, the Generic Unix package is used.

<code>cd /usr/save
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.4/rabbitmq-server-generic-unix-3.0.4.tar.gz
tar xvfz rabbitmq-server-generic-unix-3.0.4.tar.gz
cd rabbitmq_server-3.0.4</code>

Start RabbitMQ Server

Start the server in detached mode:

<code># cd /usr/save/rabbitmq_server-3.0.4
# sbin/rabbitmq-server -detached
Warning: PID file not written; -detached was passed.</code>

Verify RabbitMQ Status

Use

rabbitmqctl

to check the server status or stop it when needed.

<code># sbin/rabbitmqctl status
Status of node 'rabbit@db-dev'...
... (status details omitted for brevity)</code>

Stop RabbitMQ Server

<code># sbin/rabbitmqctl stop</code>

Troubleshooting

Problem: On CentOS 6, installing RabbitMQ may fail with

could_not_start_tcp_listener

due to a port conflict (port 5672).

Solution: The Matahari package installed by default also uses port 5672. Stop the

qpidd

daemon or uninstall the related packages.

<code># chkconfig --list | grep -i qpid
qpidd               0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service qpidd stop
# chkconfig qpidd off</code>

After disabling

qpidd

, RabbitMQ should start without the error.

LinuxMessage QueueRabbitMQTroubleshootingInstallationErlang
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.