Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Debian 8 - Installing RabbitMQ Message Broker

Installation

The "debian" way

The easiest way to install a RabbitMQ server is to simply execute:

sudo apt-get install rabbitmq-server -y

This will install version 3.3.5.

Manual Deb Install

Alternatively, you could download the deb from their installation page for Debian/Ubuntu.

# Install gdebi so dependencies will auto install
sudo apt-get install gdebi -y

# Fetch the deb
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.5.6/rabbitmq-server_3.5.6-1_all.deb

# Install the deb
sudo gdebi rabbitmq-server_3.5.6-1_all.deb

You will now have version 3.5.6 installed.

Apt Repository

If you want the latest release and automatic updates through apt, then you can add their repository.

# Add to your sources list.
echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee -a /etc/apt/sources.list

# Add their key to prevent warning messages.
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc

sudo apt-get update
sudo apt-get install rabbitmq-server -y

You will now have version 3.5.6 installed.

Extra Commands

Check the Version

sudo rabbitmqctl status | grep RabbitMQ

Manage the Service

sudo service rabbitmq-server [start|stop|restart]

Enable the Management Console

sudo rabbitmq-plugins enable rabbitmq_management

# Create admin account
sudo rabbitmqctl add_user [username] [password]
sudo rabbitmqctl set_user_tags [username] administrator
sudo rabbitmqctl set_permissions -p / [username] ".*" ".*" ".*"

sudo service rabbitmq-server restart

Now just navigate to http://[server ip]:15672/ and login.

Create Connection Limit

echo "ulimit -n [limit]" | sudo tee /etc/default/rabbitmq-server

# Restart the service to take effect.
sudo service rabbitmq-server restart

References

Last updated: 7th May 2024
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch