≡ Menu

How to Install RabbitMQ Server and Erlang on Linux

RabbitMQ is an open source message queue server that you can use to build your messaging applications. In simple terms, you can put a message to the queue from one application, and retrieve the message from the queue from the same application, or from a different application. You can use wide varieties of programming languages to connect to RabbitMQ, create and retrieve the messages.

Install Erlang

For RabbitMQ to work, you need to have Erlang installed on your system.

The current stable version of Erlang is R16B, which can be downloaded from 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 Erlang, install Erlang R16B version from source as shown below.

cd otp_src_R16B
LANG=C; export LANG
make install

Verify Erlang

Now, when you type erl from the command line, you should get the Erlang Shell as shown below. This indicates that you’ve installed Erlang successfully.

# erl
Erlang R16B (erts-5.10.1) [source] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.1  (abort with ^G)
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution

Download RabbitMQ

The current stable version of RabbitMQ server is 3.0.4. When you go to RabbitMQ website, you’ll see the following versions are available for download for Linux platform: 1) Debian / Ubuntu 2) Fedora / RHEL 3) Generic Unix 4) Solaris

In this example, I’ve chosen RabbitMQ for Generic Unix.

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 RabbitMQ server by passing -detached option as shown below.

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

If you are getting could_not_start_tcp_listener error message, while starting the RabbitMQ server, see the troubleshooting section below for solution on how to fix this issue.

Verify RabbitMQ Status

Use the rabbitmqctl command to verify the status of the RabbitMQ server and to stop it if required.

# sbin/rabbitmqctl status
Status of node 'rabbit@db-dev' ...
                        {mnesia,"MNESIA  CXC 138 12","4.8"},
                        {os_mon,"CPO  CXC 138 46","2.2.11"},
                        {sasl,"SASL  CXC 138 11","2.3.1"},
                        {stdlib,"ERTS  CXC 138 10","1.19.1"},
                        {kernel,"ERTS  CXC 138 10","2.16.1"}]},
{erlang_version,"Erlang R16B (erts-5.10.1) [source] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},

To stop a RabbitMQ Server, use the rabbitmqctl command as shown below.

# sbin/rabbitmqctl stop


Issue: On CentOS 6, if you’ve used yum to install rabbitmq, or from source as explained above, and if you are getting “BOOT FAILED {could_not_start_tcp_listener,{“::”,5672}}” message, you might have port conflict issue.

Solution: Matahari package that is installed by default on CentOS 6, also runs on port 5672. This process is started by default. Try stopping the qpidd (Qpid AMQP daemon), and see if it solves the problem. If you don’t need Matahari, you can also uninstall matahari, matahari-broker, qpid-cpp-server-ssl and qpid-cpp-server packages.

Stop the qpidd daemon, and disable it from system startup using chkconfig command.

# chkconfig --list | grep -i qpid
qpidd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

# service qpidd stop
Stopping Qpid AMQP daemon:                                 [  OK  ]

# chkconfig qpidd off

# chkconfig --list | grep -i qpid
qpidd           0:off   1:off   2:off   3:off   4:off   5:off   6:off

Now, if you start the RabbitMQ server, it should work.

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 4 comments… add one }

  • Reg April 20, 2013, 8:22 am

    Great post! I just recently installed rabbitmq and erlang on a debian server running Puppet Master. This was very helpful!

  • John April 22, 2013, 12:27 am

    When I go to rabbitmq website, I see vmware logo on one side.

    I didn’t realize that vmware/emc is behind the rabbitmq open source initiative.

  • jan October 10, 2014, 5:13 am

    hello. i have problem starting rabbitmq server using your manual.

    ERROR: epmd error for host red5: address (cannot connect to host/port)

    red5 is name of my server

    can you help me?

  • jan October 10, 2014, 5:26 am

    i have fixed it.

Leave a Comment