Installing on Debian and Ubuntu
Overview
This guide covers RabbitMQ installation on Debian, Ubuntu and distributions based on one of them.
RabbitMQ is included in standard Debian and Ubuntu repositories. However, the versions included are many releases behind latest RabbitMQ releases and may provide RabbitMQ versions that are already out of support.
Team RabbitMQ produces our own Debian packages and distributes them using Cloudsmith.
Key sections of this guide are
- Ways of installing the latest RabbitMQ version on Debian and Ubuntu
- Supported Ubuntu and Debian distributions
- Privilege requirements
- Quick start installation snippet that uses a Cloudsmith mirror repositories
- Manage the service (start it, stop it, and get its status)
- How to inspect node and service logs
Supported Erlang versions will be provisioned from one of the modern Erlang apt repositories on Launchpad or a Cloudsmith.io mirror.
Those looking for a more detailed description of the installation steps performed should refer to
- Manual installation using apt and the Cloudsmith repository
More advanced topics include
- Version Pinning of apt packages
How to Install Latest RabbitMQ on Debian and Ubuntu
With Apt
Currently, the recommended option for installing modern RabbitMQ on Debian and Ubuntu is using apt repositories on a Cloudsmith mirror (quick start script).
The repositories provide a modern version of Erlang. Alternatively, the latest version of Erlang is available via a Launchpad PPA and other repositories.
Manually Using Dpkg
Alternatively, the package can be downloaded manually and installed with dpkg -i
.
This option will require manual installation of all RabbitMQ package dependencies and is highly discouraged.
Supported Distributions
RabbitMQ is supported on several major Debian-based distributions that are still supported by their primary vendor or developer group.
For Debian, this means that RabbitMQ core team focus around package is on the current and prior release of Debian-based distributions, i.e. inline with distribution EOL policy.
Currently the list of supported Debian-based distributions includes
- Ubuntu 20.04 through 23.04
- Debian Bullseye (11), Bookworm (12), and Trixie ("testing")
The package may work on other Debian-based distributions if dependencies are satisfied (e.g. using a backports repository) but their testing and support is done on a best effort basis.
Where to Get Recent Erlang Version on Debian and Ubuntu
RabbitMQ needs Erlang/OTP to run. Erlang/OTP packages in standard Debian and Ubuntu repositories can be significantly out of date and not supported by modern RabbitMQ versions.
Most recent Erlang/OTP release series are available from a number of alternative apt repositories:
Erlang Release Series | Apt Repositories that provide it | Notes |
26.x |
| Supported starting with 3.12.0, and is required starting with 3.13.0. See Erlang compatibility guide. |
25.x |
| Supported starting with 3.10.0, required starting with 3.11.0. See Erlang compatibility guide. |
This guide will focus on the Debian repositories maintained by Team RabbitMQ on Launchpad and on Cloudsmith.io.
Using RabbitMQ Apt Repositories on Cloudsmith
Team RabbitMQ maintains two apt repositories on Cloudsmith, a package hosting service. They provide packages for most recent RabbitMQ and modern Erlang releases.
The Cloudsmith repository has a monthly traffic quota that can be exhausted. For this reason, examples below use a Cloudsmith repository mirror. All packages in the mirror repository are signed using the same signing key.
This guide will focus on a more traditional and explicit way of setting up additional apt repositories and installing packages.
All steps covered below are mandatory unless otherwise specified.
Cloudsmith Quick Start Script
Below is a shell snippet that performs those steps and assumes that Ubuntu 22.04 is used. They are documented in more detail below.
#!/bin/sh
sudo apt-get install curl gnupg apt-transport-https -y
## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Community mirror of Cloudsmith: modern Erlang repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Community mirror of Cloudsmith: RabbitMQ repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null
## Add apt repositories maintained by Team RabbitMQ
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
## Provides RabbitMQ
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
EOF
## Update package indices
sudo apt-get update -y
## Install Erlang packages
sudo apt-get install -y erlang-base \
erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
erlang-runtime-tools erlang-snmp erlang-ssl \
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
All steps covered below are mandatory unless otherwise specified.
Install Essential Dependencies
sudo apt-get update -y
sudo apt-get install curl gnupg -y
Enable apt HTTPS Transport
In order for apt to be able to download RabbitMQ and Erlang packages from the Cloudsmith.io mirror or Launchpad,
the apt-transport-https
package must be installed:
sudo apt-get install apt-transport-https
Add Repository Signing Keys
Cloudsmith signs distributed packages using their own GPG keys, one per repository.
In order to use the repositories, their signing keys must be added to the system. This will enable apt to trust packages signed by that key.
sudo apt-get install curl gnupg apt-transport-https -y
## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Community mirror of Cloudsmith: modern Erlang repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Community mirror of Cloudsmith: RabbitMQ repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null
See the guide on signatures to learn more.
Add a Source List File
As with all 3rd party apt repositories, a file describing the RabbitMQ and Erlang package repositories
must be placed under the /etc/apt/sources.list.d/
directory.
/etc/apt/sources.list.d/rabbitmq.list
is the recommended location.
The file should have a source (repository) definition line that uses the following pattern:
## Provides modern Erlang/OTP releases from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
## Provides RabbitMQ from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
The next couple of sections discusses what distribution and component values are supported.
Distribution
In order to set up an apt repository that provides the correct package, a few decisions have to be made. One is determining the distribution name. It often matches the Debian or Ubuntu release used:
jammy
for Ubuntu 23.04jammy
for Ubuntu 22.04focal
for Ubuntu 20.04bionic
for Ubuntu 18.04buster
for Debian Buster, Bullseye, and Sid
Not all distributions are covered (indexed). For example, freshly released ones usually
won't be recognized by the package hosting services.
But there are good news: since the package indexed for these distributions is the same,
any reasonably recent distribution name would suffice in practice.
For example, users of Debian Sid or Debian Bullseye
can both use bullseye
for distribution name.
Below is a table of OS release and distribution names that should be used with the RabbitMQ apt repositories.
Release | Distribution |
---|---|
Ubuntu 23.04 | jammy |
Ubuntu 22.04 | jammy |
Ubuntu 20.04 | focal |
Ubuntu 18.04 | bionic |
Debian Bookworm | bullseye |
Debian Bullseye | bullseye |
Debian Sid | bullseye |
To add the apt repository to the source list directory (under /etc/apt/sources.list.d
), use:
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu $distribution main
## Provides RabbitMQ from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu $distribution main
EOF
where $distribution
is the name of the Debian or Ubuntu distribution used (see the table above).
For example, on Debian Bullseye and Bookworm it would be
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/debian bullseye main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/debian bullseye main
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/debian bullseye main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/debian bullseye main
## Provides RabbitMQ from a Cloudsmith mirror
##
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/debian bullseye main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/debian bullseye main
# another mirror for redundancy
deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/debian bullseye main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/debian bullseye main
EOF
Install Packages
After updating the list of apt
sources it is necessary to run apt-get update
:
sudo apt-get update -y
Then install the package with
## Install Erlang packages
sudo apt-get install -y erlang-base \
erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
erlang-runtime-tools erlang-snmp erlang-ssl \
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
Debian Package Version and Repository Pinning
Version pinning is an optional step. If not used, apt
will install the most recent version
available.
When the same package (e.g. erlang-base
) is available from multiple apt repositories operators need
to have a way to indicate what repository should be preferred. It may also be desired to restrict Erlang version to avoid undesired upgrades.
apt package pinning feature can be used to address both problems.
Package pinning is configured with a file placed under the /etc/apt/preferences.d/
directory, e.g. /etc/apt/preferences.d/erlang
.
After updating apt preferences it is necessary to run apt-get update
:
sudo apt-get update -y
The following preference file example will configure apt
to install erlang-*
packages from the Cloudsmith
mirror used in the examples above:
# /etc/apt/preferences.d/erlang
Package: erlang*
Pin: origin ppa1.novemberain.com
# Note: priority of 1001 (greater than 1000) allows for downgrading.
# To make package downgrading impossible, use a value of 999
Pin-Priority: 1001
The following is similar to the example above but prefers Launchpad:
# /etc/apt/preferences.d/erlang
Package: erlang*
Pin: origin ppa.launchpad.net
# Note: priority of 1001 (greater than 1000) allows for downgrading.
# To make package downgrading impossible, use a value of 999
Pin-Priority: 1001
Effective package pinning policy can be verified with
sudo apt-cache policy
The following preference file example will pin all erlang-*
packages to 25.3
(assuming package epoch for the package is 1):
# /etc/apt/preferences.d/erlang
Package: erlang*
Pin: version 1:25.3.2.5-1
# Note: priority of 1001 (greater than 1000) allows for downgrading.
# To make package downgrading impossible, use a value of 999
Pin-Priority: 1001
The following preference file example will pin rabbitmq-server
package to 3.13.4
(assuming package epoch for the package is 1):
# /etc/apt/preferences.d/rabbitmq
Package: rabbitmq-server
Pin: version 1:3.13.4-1
# Note: priority of 1001 (greater than 1000) allows for downgrading.
# To make package downgrading impossible, use a value of 999
Pin-Priority: 1001
Manual Installation with Dpkg
In some cases it may be easier to download the package directly from GitHub and install it manually using sudo dpkg -i
.
Below is a download link.
Description | Download | Signature |
---|---|---|
.deb for Debian-based Linux (from GitHub) | rabbitmq-server_3.13.4-1_all.deb | Signature |
When installing manually with dpkg
, it is necessary to install package dependencies first.
dpkg
, unlike apt
, does not resolve or manage dependencies.
Here's an example that does that, installs wget
, downloads the RabbitMQ package and installs it:
# sync package metadata
sudo apt-get update
# install dependencies manually
sudo apt-get -y install socat logrotate init-system-helpers adduser
# download the package
sudo apt-get -y install wget
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.13.4/rabbitmq-server_3.13.4-1_all.deb
# install the package with dpkg
sudo dpkg -i rabbitmq-server_3.13.4-1_all.deb
rm rabbitmq-server_3.13.4-1_all.deb
Installation via apt repositories is recommended
over downloading the package directly and installing via dpkg -i
. When the RabbitMQ
package is installed manually with dpkg -i
the operator is responsible for making sure
that all package dependencies are met.
User Privilege Requirements
RabbitMQ Debian package will require sudo
privileges to install and manage.
In environments where sudo
isn't available, consider using the
generic binary build instead.
Run RabbitMQ Server
Start the Server
The server is started as a daemon by default when the
RabbitMQ server package is installed. It will run as a non-privileged user rabbitmq
.
As an administrator, start and stop the server as usual for Debian-based systems:
systemctl start rabbitmq-server
Configuring RabbitMQ
On most systems, a node should be able to start and run with all defaults. Please refer to the Configuration guide to learn more and Production Checklist for guidelines beyond development environments.
Note: the node is set up to run as system user rabbitmq
.
If location of the node database or the logs is changed,
the files and directories must be owned by this user.