To install and run RabbitMQ on macOS using Homebrew, follow these steps. This guide assumes you have Homebrew installed on your macOS. If you haven't installed Homebrew yet, you can find the installation instructions at https://brew.sh/.
- Open a Terminal window on your macOS.
- Update Homebrew to ensure you have the latest package definitions. Run:
brew update
- Install RabbitMQ using Homebrew by running:
brew install rabbitmq
RabbitMQ's binaries are located in its sbin
directory, which is not in the system's PATH by default. You can add it to your PATH to make running RabbitMQ commands more convenient.
-
Find the RabbitMQ installation path. If you installed RabbitMQ via Homebrew, it's typically located at
/opt/homebrew/opt/rabbitmq/sbin
. You can verify this path by running:brew info rabbitmq
Look for the output lines mentioning where RabbitMQ is installed and the
sbin
directory. -
Edit your shell profile. Depending on your shell, this might be
.bash_profile
,.bashrc
,.zshrc
, or another file. For example, if you're using bash, you can open.bash_profile
in your home directory with a text editor:open -e ~/.bash_profile
If you're using zsh, you might edit
.zshrc
instead:open -e ~/.zshrc
-
Add RabbitMQ's
sbin
directory to your PATH. Append the following line to your shell profile file (adjust the path if your Homebrew installation of RabbitMQ is located elsewhere):export PATH="$PATH:/opt/homebrew/opt/rabbitmq/sbin"
-
Save the file and reload your shell profile. For bash, you can use:
source ~/.bash_profile
For zsh, use:
source ~/.zshrc
- Start RabbitMQ using the Homebrew service command:
This command will start RabbitMQ and configure it to run at boot.
brew services start rabbitmq
RabbitMQ comes with a management interface that runs on port 15672. To access it:
-
Enable the RabbitMQ Management Plugin (if it's not already enabled) by running:
rabbitmq-plugins enable rabbitmq_management
-
Open a web browser and navigate to http://localhost:15672/ to access the RabbitMQ Management Interface.
-
Log in with the default username and password, which are both
guest
.
You're now ready to use RabbitMQ on your macOS system.