Homebrew is a popular package manager for macOS. RabbitMQ formula is available from Homebrews core tap (out of the box).
The formula will also install a recent supported Erlang/OTP version as a dependency.
Before installing make sure the taps are up-to-date:
brew update
Then, install RabbitMQ server with:
brew install rabbitmq
Installing the RabbitMQ formula will install key dependencies such as a supported Erlang/OTP version.
The RabbitMQ server scripts and CLI tools are installed into the sbin directory under /usr/local/Cellar/rabbitmq/{version}/ for Intel Macs or /opt/homebrew/Cellar/rabbitmq/{version}/ for Apple Silicon Macs.
They should be accessible from /usr/local/opt/rabbitmq/sbin for for Intel Macs or /opt/homebrew/opt/rabbitmq/sbin for Apple Silicon Macs. Links to binaries have been created under /usr/local/sbin for Intel Macs or /opt/homebrew/sbin for Apple Silicon ones.
To find out locations for your installation, use:
brew info rabbitmq
With Homebrew, the node and CLI tools will use the logged in user account by default.
Unlike some other installation methods, namely the Debian and RPM packages, RabbitMQ Homebrew formula uses generic UNIX binary builds and does not require sudo.
To start a node in the foreground, run:
CONF_ENV_FILE="/opt/homebrew/etc/rabbitmq/rabbitmq-env.conf" /opt/homebrew/opt/rabbitmq/sbin/rabbitmq-server
To start a node in the background, use brew services start:
brew services start rabbitmq
To stop a running node, use:
brew services stop rabbitmq
or CLI tools directly:
/opt/homebrew/opt/rabbitmq/sbin/rabbitmqctl shutdown
The command will wait for the node process to stop. If the target node is not running, it will exit with a warning.
File and directory locations used by Homebrew differ from Intel Macs to Apple Silicon ones. To find out locations for your installation, use:
brew info rabbitmq
On Apple Silicon Macs, RabbitMQ configuration file located at /opt/homebrew/etc/rabbitmq/rabbitmq.conf. The file does not exist by default and can be created.
It is possible to use environment variables to control certain settings. rabbitmq-env.conf is located at /opt/homebrew/etc/rabbitmq/rabbitmq-env.conf
See RabbitMQ configuration guide to learn more.
The formula sets up links to CLI tools under /usr/local/sbin for Intel Macs or /opt/homebrew/sbin for Apple Silicon Macs.
In case that directory is not in PATH, it is recommended to append it:
# for macOS Intel export PATH=$PATH:/usr/local/sbin # for Apple Silicon export PATH=$PATH:/opt/homebrew/sbin
Add the above export to the shell profile (such as ~/.bashrc for bash or ~/.zshrc for zsh) to have PATH updated for every new shell, including OS restarts.
If you have questions about the contents of this guide or any other topic related to RabbitMQ, don't hesitate to ask them using GitHub Discussions or our community Discord server.
If you'd like to contribute an improvement to the site, its source is available on GitHub. Simply fork the repository and submit a pull request. Thank you!