How to install RabbitMQ on Ubuntu 18.04

Step 0: Install newest version of Erlang

$ wget -O- | sudo apt-key add -
$ echo "deb bionic contrib" | sudo tee /etc/apt/sources.list.d/erlang.list


sudo apt update
sudo apt install erlang

Check Erlang version:

$ erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().'  -noshell

Step 1: Add RabbitMQ Repository To Ubuntu 18.04

$ wget -O- | sudo apt-key add -
$ wget -O- | sudo apt-key add -


$ echo "deb $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list

Step 2: Install RabbitMQ Server Ubuntu 18.04 LTS

To install RabbitMQ Server Ubuntu 18.04, update apt list, then install rabbitmq-server package:

sudo apt update
sudo apt install rabbitmq-server

Check status:

sudo systemctl status  rabbitmq-server.service


sudo service rabbitmq-server status

Check RabbitMQ version:

sudo rabbitmqctl status | grep RabbitMQ

Check if the service is configured to start on boot or not:

$ systemctl is-enabled rabbitmq-server.service 

If it returns disabled, enable it by running:

sudo systemctl enable rabbitmq-server

Step 3: Check your firewall

After installing RabbitMQ, ufw is enabled and configured by default. If you don’t want that, you can disable it by this command:

sudo ufw disable

Step 4: Enable the RabbitMQ Management Dashboard (Optional)

You can optionally enable the RabbitMQ Management Web dashboard for easy management.

sudo rabbitmq-plugins enable rabbitmq_management

The Web service should be listening on TCP port 15672.

Double if the port is listening:

$ ss -tunelp | grep 15672
tcp LISTEN 0 1024* uid:132 ino:1577718 sk:3d <->

By default, the guest user exists and can connect only from localhost. You can point your browser to http://localhost:15672 and login with this user locally with the password “guest”.

To be able to login on the network, create an admin user like below:

sudo rabbitmqctl add_user admin StrongPassword
sudo rabbitmqctl set_user_tags admin administrator

RabbitMQ User Management Commands

Delete User:

sudo rabbitmqctl delete_user user

Change User Password:

sudo rabbitmqctl change_password user strongpassword

Create new Virtualhost:

sudo rabbitmqctl add_vhost /my_vhost

List available Virtualhosts:

sudo rabbitmqctl list_vhosts

Delete a virtualhost:

sudo rabbitmqctl delete_vhost /myvhost

Grant user permissions for vhost:

sudo rabbitmqctl set_permissions -p /myvhost user ".*" ".*" ".*"

List vhost permissions:

sudo rabbitmqctl list_permissions -p /myvhost

To list user permissions:

sudo rabbitmqctl list_user_permissions user

Delete user permissions:

sudo rabbitmqctl clear_permissions -p /myvhost user




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why Companies Prefer Kotlin Over Java for New Projects

Integrating WSO2 EI with IBM MQ’s docker container Version 8.0

How to improve SAP performance with an automated tool — Just with a click ?

Build a secure HUB VPC with Fortigate firewall and alibaba CEN-TR to secure enterprise cross VPCs…

Why Extension is needed in ShowTouchesEnabler

(A) To configure web server on the top of docker container !!

ssh into database is working, but not from apps.

Announcing FaunaDB 2.7

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chi Thuc Nguyen

Chi Thuc Nguyen

More from Medium

How PMM Algorithm Works?

Integer Programming for Cohort Detection

30 ways to be a better programmer —  part II

Imagning programming as a great proffesion is a key!!

Recognizing Handwritten Digits with Scikit-Learn