• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install RabbitMQ Server on Ubuntu 18.04 & 16.04 LTS

Written by Rahul, Updated on June 4, 2019

RabbitMQ is the most popular open source message broker. RabbitMQ is a lightweight application available for most of the popular operating systems. RabbitMQ supports multiple messaging protocols. RabbitMQ can be easily deployed in a distributed and federated configurations to meet high-scale, high-availability requirements.

This tutorial will help you to install RabbitMQ on Ubuntu 18.04 LTS and 16.04 LTS systems.

Step 1 – Install RabbitMQ on Ubuntu

First of all, enable RabbitMQ PPA repository on your system. Also, import rabbitmq signing key on your system. Use the following commands to do this.

echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

After that update apt cache and install RabbitMQ server on your system.

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

Step 2 – Manage RabbitMQ Service

After completing installations, enable the RabbitMQ service on your system. Also, start the RabbitMQ service. Use one of the below methods sysvinit for older systems or systemctl for the latest operating system.

Using Init –

sudo update-rc.d rabbitmq-server defaults
sudo service rabbitmq-server start
sudo service rabbitmq-server stop

Uisng Systemctl –

sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server
sudo systemctl stop rabbitmq-server

Step 3 – Create Admin User in RabbitMQ

By default rabbitmq creates a user named “guest” with password “guest”. You can also create your own administrator account on RabbitMQ server using following commands. Change password with your own password.

sudo rabbitmqctl add_user admin password 
sudo rabbitmqctl set_user_tags admin administrator
sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

Step 4 – Setup RabbitMQ Web Management Console

RabbitMQ also provides and web management console for managing the entire RabbitMQ. To enable web management console run following command on your system. The web management console helps you with managing the RabbitMQ server.

sudo rabbitmq-plugins enable rabbitmq_management

RabbitMQ dashboard starts on port 15672. Access your server on the port to get the dashboard. Use the username and password created in step 3

install rabbitmq server

After login, you will get the RabbitMQ management web interface dashboard.

install rabbitmq server dashboard

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

41 Comments

  1. Avatar Jared Reply
    July 27, 2020 at 8:47 pm

    Great tutorial! Thanks!

  2. Avatar dk Reply
    July 8, 2020 at 2:21 am

    this is a very good and easy tutorial =)
    thanks =)

  3. Avatar Bart Reply
    November 3, 2019 at 2:51 pm

    Rabbit mq until 3.6.12 is easy to install… but not recommended anymore.
    For RabbitMq 3.8 you need the latest Erlang… which is very complicated to install by our software team. Erlang seems some high level language which probably makes Rabbitmq slower…

    Since the old version is unstable … our customers simple stop communicating between 1 and 60 minutes…
    we finally decided to stop with RabbitMQ and Erlang. Sorry this is a dead end, not mature software yet.

  4. Avatar Uday Reply
    October 3, 2019 at 8:32 am

    Very helpful thnkuu

  5. Avatar kiny Reply
    July 4, 2019 at 2:52 am

    Thanks TechAdmin ,You save my time

  6. Avatar raviraj Reply
    June 18, 2019 at 10:14 am

    Thanks it works perfectly

  7. Avatar HaRiSK Reply
    May 13, 2019 at 4:01 am

    Your tutorial is not working with me :'(

    • Avatar xx Reply
      August 14, 2019 at 7:28 am

      I work fine! what’s the problem for you?

  8. Avatar Moein Hosseini Reply
    February 18, 2019 at 3:04 pm

    You have missing part in your tutorial to work man. Honestly I think everyone in internet should test their tutorial before publishing to avoid wasting others time.
    In ubuntu 18.04 you have to edit /etc/rabbitmq/rabbitmq-env.conf and set [email protected] to works!
    Anyway thanks for your tutorial.

  9. Avatar Ram Reply
    January 29, 2019 at 1:53 am

    Hi

    Installed version of rabbitmq crashed and not able to restart. So I uninstalled and reinstalling using above steps. But I am getting below error while installing.

    sudo apt-get install rabbitmq-server
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following additional packages will be installed:
    socat
    The following NEW packages will be installed:
    rabbitmq-server socat
    0 upgraded, 2 newly installed, 0 to remove and 49 not upgraded.
    Need to get 0 B/5,346 kB of archives.
    After this operation, 6,771 kB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Selecting previously unselected package socat.
    (Reading database … 133187 files and directories currently installed.)
    Preparing to unpack …/socat_1.7.3.1-1_amd64.deb …
    Unpacking socat (1.7.3.1-1) …
    Selecting previously unselected package rabbitmq-server.
    Preparing to unpack …/rabbitmq-server_3.6.15-1_all.deb …
    Unpacking rabbitmq-server (3.6.15-1) …
    Processing triggers for man-db (2.7.5-1) …
    Processing triggers for systemd (229-4ubuntu21.15) …
    Processing triggers for ureadahead (0.100.0-19) …
    Setting up socat (1.7.3.1-1) …
    Setting up rabbitmq-server (3.6.15-1) …
    Job for rabbitmq-server.service failed because the control process exited with error code. See “systemctl status rabbitmq-server.service” and “journalctl -xe” for details.
    invoke-rc.d: initscript rabbitmq-server, action “start” failed.
    ● rabbitmq-server.service – RabbitMQ broker
    Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Mon 2019-01-28 17:50:12 PST; 8ms ago
    Process: 16329 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
    Process: 16202 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
    Process: 15981 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
    Main PID: 15981 (code=exited, status=1/FAILURE)

    Jan 28 17:50:12 ip-10-129-30-10 systemd[1]: Failed to start RabbitMQ broker.
    Jan 28 17:50:12 ip-10-129-30-10 systemd[1]: rabbitmq-server.service: Unit entered failed state.
    Jan 28 17:50:12 ip-10-129-30-10 systemd[1]: rabbitmq-server.service: Failed with result ‘exit-code’.
    dpkg: error processing package rabbitmq-server (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for systemd (229-4ubuntu21.15) …
    Processing triggers for ureadahead (0.100.0-19) …
    Errors were encountered while processing:
    rabbitmq-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  10. Avatar Simone Reply
    January 10, 2019 at 10:47 am

    I think that this tutorial is suggesting the wrong version of Erlang, because I spent like 4 hours.
    Rabbit didn’t start, so I had to remove all PPA/repo and just type ‘sudo apt-get install rabbitmq-server’

  11. Avatar mohit Reply
    January 7, 2019 at 8:25 pm

    I am using RabbitMQ for one of my project but due to some reason On first time I am not able to consume all the messages from the queue. I am using this for bulk upload off csv file which create users data

  12. Avatar Nandkishor Patil Reply
    January 3, 2019 at 12:32 pm

    Hi Raul,
    thank you for this helpful article i have setup rabbitmq server and this is working fine for shall
    but i am not able to run as localhost:15672

    can you help me

  13. Avatar Ragul Reply
    August 21, 2018 at 12:12 pm

    How to downgarde rabbitmq to version 3.6.9

  14. Avatar Sanjeev Gupta Reply
    June 26, 2018 at 12:11 pm

    Hii Rahul,
    I am getting the following error.

    Adding new user `rabbitmq’ (UID 123) with group `rabbitmq’ …
    Not creating home directory `/var/lib/rabbitmq’.
    Job for rabbitmq-server.service failed because the control process exited with error code. See “systemctl status rabbitmq-server.service” and “journalctl -xe” for details.
    invoke-rc.d: initscript rabbitmq-server, action “start” failed.
    ● rabbitmq-server.service – RabbitMQ broker
    Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Tue 2018-06-26 17:34:33 IST; 6ms ago
    Process: 26951 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
    Process: 26825 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
    Process: 26606 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
    Main PID: 26606 (code=exited, status=1/FAILURE)

    Jun 26 17:34:33 SDD-22 systemd[1]: Failed to start RabbitMQ broker.
    Jun 26 17:34:33 SDD-22 systemd[1]: rabbitmq-server.service: Unit entered fa…e.
    Jun 26 17:34:33 SDD-22 systemd[1]: rabbitmq-server.service: Failed with res…’.
    Hint: Some lines were ellipsized, use -l to show in full.
    dpkg: error processing package rabbitmq-server (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for systemd (229-4ubuntu21.1) …
    Processing triggers for ureadahead (0.100.0-19) …
    Errors were encountered while processing:
    rabbitmq-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    • Avatar Apoorv Kesharwani Reply
      December 20, 2018 at 11:32 am

      I also encountered the same error. Did you find any resolution?

      • Avatar Bill Reply
        January 18, 2019 at 7:28 pm

        Don’t install Erlang manually. If you already installed it in the first steps, remove Erlang by doing this:

        sudo apt-get purge erlang*

        Then start from Step 2 in this guide and do this:

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

        • Avatar Uri Reply
          June 3, 2019 at 10:20 am

          Bill,

          You Are The BEST.

          this comment ended 4 hours of pure frustration.

          Thanks.

  15. Avatar Sunil Reply
    June 6, 2018 at 12:17 pm

    Awesome. Crisp and clear steps.

  16. Avatar Nickolas Grigorciuc Reply
    April 26, 2018 at 12:48 pm

    Thank you V.M. All perfect works 🙂

  17. Avatar Megha Reply
    April 19, 2018 at 2:24 pm

    Thanks a ton! This helped me setup my RabbitMQ locally in a jiffy! 🙂

  18. Avatar Anurag Reply
    April 16, 2018 at 5:39 am

    hi can you help me with ngnix config so that i can use RabbitMQ management web interface dashboard

  19. Avatar sai Reply
    March 8, 2018 at 2:53 pm

    Hi Rahul,
    After installation, i got below issue. I am not able to start RabbitMq server.

    ——————————————————————–

    rabbitmq-server.service – RabbitMQ broker
    Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
    Active: inactive (dead) since Thu 2018-03-08 20:18:51 IST; 2min 21s ago
    Process: 4222 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
    Process: 4044 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
    Main PID: 3538 (code=exited, status=0/SUCCESS)
    Status: “Initialized”

    Starting broker…
    : systemd unit for activation check: “rabbitmq-server.service”
    : Started RabbitMQ broker.
    : completed with 0 plugins.
    : Started RabbitMQ broker.
    : Started RabbitMQ broker.
    : Stopping RabbitMQ broker…
    : Stopping and halting node ‘[email protected]’
    : Gracefully halting Erlang VM
    : Stopped RabbitMQ broker.
    ———————————————————————————–

    • Rahul Rahul K. Reply
      March 9, 2018 at 3:52 am

      Try below command:

      systemctl enable rabbitmq-server.service

      • Avatar sai Reply
        March 9, 2018 at 6:52 am

        Hi Rahul,
        Thanks for the Quick reply.
        After this command also I got same issue.

      • Avatar sai Reply
        March 12, 2018 at 1:50 pm

        Hi Rahul,
        Thanks a lot , its working fine now.

  20. Avatar Ruben Reply
    January 21, 2018 at 12:13 pm

    Thanks a lot!

  21. Avatar meghana Reply
    January 9, 2018 at 5:17 am

    Hi rahul, while logging in the management console i’m getting User can only log in via localhost .

  22. Avatar Kamal EL BAARARI Reply
    January 4, 2018 at 9:21 am

    Hi Rahul, first of all, thank you so mush, .I successfully installed rabbitmq, but when i will start it i have the problem “FAILED – check /var/log/rabbitmq/startup_\{log, _err\} [Fail]”.

  23. Avatar sanjay Reply
    December 29, 2017 at 5:00 am

    I installed your following steps but can’t access web management console please help me.

    • Rahul Rahul K. Reply
      December 30, 2017 at 4:10 am

      What are you getting on the webpage? Any error message in the system log?

  24. Avatar djamel Reply
    December 4, 2017 at 8:50 am

    Thank’s a lot

  25. Avatar Black Int Reply
    November 9, 2017 at 6:34 am

    Thanks Rahul.

  26. Avatar HiIcy Reply
    November 8, 2017 at 3:40 am

    thank you very much .I successfully installed rabbitmq on Ubuntu 16.04 LTS,that’s very useful !

  27. Avatar Anne Reply
    November 7, 2017 at 12:22 am

    Thank you so much. I just installed rabbitmq successfully on Ubuntu 17.10.

  28. Avatar Aleksey Reply
    November 4, 2017 at 11:46 pm

    Thanks a lot.
    Just installed on my virtualbox guest machine (ubuntu 16.04.3).
    All okay.

    Will be nice to provide guide for plugin installation and maybe recommend some helpful plugins?

  29. Avatar sk Reply
    October 24, 2017 at 9:56 am

    Works 🙂

  30. Avatar Francis Reply
    October 12, 2017 at 3:39 am

    Worked like a charm, thank you.

  31. Avatar Dario Zadro Reply
    September 11, 2017 at 4:23 pm

    Great quick guide! However, you only need to install erlang-nox not the full erlang package. Thanks!

  32. Avatar Sara Reply
    July 21, 2017 at 6:23 am

    Thanks TechAdmin ,You save my time

  33. Avatar Talreja Reply
    May 12, 2017 at 4:32 pm

    Successfully installed rabbitmq on Ubuntu 16.04…. Awesome post.. keep it up tecadmin

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy