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.

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

After downloading, install Erlang from source:

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

Verify Erlang

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

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

Download RabbitMQ

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

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

Start RabbitMQ Server

Start the server in detached mode:

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

Verify RabbitMQ Status

Use rabbitmqctl to check the server status or stop it when needed.

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

Stop RabbitMQ Server

# sbin/rabbitmqctl stop

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.

# 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

After disabling qpidd, RabbitMQ should start without the error.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxtroubleshootingInstallationErlang
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

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.