Server Build Instructions

This section describes the process for obtaining a copy of the RabbitMQ server source code, as well as instructions for building the server from source.

Obtaining the source

First, obtain the source code from our GitHub repositories:

git clone https://github.com/rabbitmq/rabbitmq-server.git

Then, use make to pull down dependencies and build the server:

cd rabbitmq-server
make

Required Libraries and Tools

In order to build RabbitMQ, you will need a few tools.

RabbitMQ requires a recent version of Python 2 and simplejson.py (an implementation of a JSON reader and writer in Python), for generating AMQP 0-9-1 framing code. simplejson.py is included as a standard json library in the Python core since 2.6 release.

Additionally, you will need

  • the Erlang development and runtime tools
    If you are on a Debian-based system then you need the erlang-nox, erlang-dev and erlang-src packages installed. If you are building and installing Erlang from source then you must ensure that openssl is installed on your system.
  • a recent version of GNU make
  • a recent version of xsltproc, which is part of libxslt
  • a recent version of xmlto
  • zip and unzip

Building the server

Change to the rabbitmq-server directory, and type make.

Other interesting Makefile targets include

all
The default target. Builds the server.
shell
Builds the client libraries and starts an Erlang shell with the libraries loaded.
run-broker
Builds the server and starts an instance with an interactive Erlang shell. This will by default put data, including a Mnesia database, in /tmp/rabbitmq-test-instances, but this location can be overridden by setting the Makefile variable TEST_TMPDIR:

make run TEST_TMPDIR=/some/other/location/for/rabbitmq-test-instances

clean
Removes temporary build products.
distclean
Removes all build products.
tests
Runs a set of tests.
source-dist
Constructs a source-code distribution archive in ./PACKAGES.

Building Server Packages

In practice, building RabbitMQ server from source is of limited use unless an easy to deploy package (e.g. a Debian one) can be produced.

Building a Generic UNIX Package

To build a generic UNIX package, use the package-generic-unix target in the server repository. You'd need to provide a version and (commonly) opt out of artifact signing:

# replace x, y, z, and build with your own values, e.g.
# 3.7.0.801
make package-generic-unix VERSION=x.y.z.build UNOFFICIAL_RELEASE=true
                  
Built artifacts will be placed under the PACKAGES directory.

Building a Debian Package

Producing a Debian package requires a number of build time dependencies. On a recent Debian-based system (e.g. Ubuntu 15.10), they can be installed with

sudo apt-get install -y debhelper erlang-dev erlang-src python-simplejson \
                        xmlto xsltproc erlang-nox zip rsync
                  

To build a generic UNIX package, use the package-deb target in the server repository. You'd need to provide a version and (commonly) opt out of artifact signing:

# replace x, y, z, and build with your own values, e.g.
# 3.7.0.801
make package-deb VERSION=x.y.z.build UNOFFICIAL_RELEASE=true
                  
Built artifacts will be placed under the PACKAGES directory.

Building a Windows Package

Producing a Windows package requires a Debian-based machine and number of build time dependencies. On a recent Debian-based system (e.g. Ubuntu 15.10), they can be installed with

sudo apt-get install -y tofrodos nsis elinks
                  

To build a Windows package, use the package-windows target in the server repository. You'd need to provide a version and (commonly) opt out of artifact signing:

# replace x, y, z, and build with your own values, e.g.
# 3.7.0.801
make package-windows VERSION=x.y.z.build UNOFFICIAL_RELEASE=true
                  
Built artifacts will be placed under the PACKAGES directory.