Close Menu
    Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Install RabbitMQ Server on Ubuntu 18.04 & 16.04 LTS

    How to Install RabbitMQ Server on Ubuntu 18.04 & 16.04 LTS

    By RahulDecember 20, 20222 Mins Read

    RabbitMQ is the most popular open-source message broker. RabbitMQ is a lightweight application available for most of popular operating systems. RabbitMQ supports multiple messaging protocols. RabbitMQ can be easily deployed in 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.

    Prerequisities

    Login to your Ubuntu system and update current packages.

    sudo apt-get update && sudo apt-get upgrade
    

    Also, included the below step based on our reader’s experiences added in the comments section. Remove erlang packages already installed on your system.

    sudo apt-get purge erlang*
    

    Step 1 – Install RabbitMQ on Ubuntu

    First of all, enable the 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 the apt cache and install the 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 the password “guest”. You can also create your own administrator account on the RabbitMQ server using the following commands. Change your 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 the web management console run the 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 in, you will get the RabbitMQ management web interface dashboard.

    install rabbitmq server dashboard

    RabbitMQ
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Understanding the LD_LIBRARY_PATH Environment Variable

    The Beginner’s Guide to Building Your First RPM Package

    The Beginner’s Guide to Building Your First Debian Package

    View 44 Comments

    44 Comments

    1. Gabi on February 2, 2022 10:51 am

      Thank you so much, this was very very helpful!!

      Reply
    2. venk on February 18, 2021 11:13 pm

      works great, thanks a lot!

      Reply
    3. Jared on July 27, 2020 8:47 pm

      Great tutorial! Thanks!

      Reply
    4. dk on July 8, 2020 2:21 am

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

      Reply
    5. Bart on November 3, 2019 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.

      Reply
    6. Uday on October 3, 2019 8:32 am

      Very helpful thnkuu

      Reply
    7. kiny on July 4, 2019 2:52 am

      Thanks TechAdmin ,You save my time

      Reply
    8. raviraj on June 18, 2019 10:14 am

      Thanks it works perfectly

      Reply
    9. HaRiSK on May 13, 2019 4:01 am

      Your tutorial is not working with me :'(

      Reply
      • xx on August 14, 2019 7:28 am

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

        Reply
    10. Moein Hosseini on February 18, 2019 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 NODENAME=rabbit@localhost to works!
      Anyway thanks for your tutorial.

      Reply
    11. Ram on January 29, 2019 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)

      Reply
    12. Simone on January 10, 2019 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’

      Reply
    13. mohit on January 7, 2019 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

      Reply
    14. Nandkishor Patil on January 3, 2019 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

      Reply
    15. Ragul on August 21, 2018 12:12 pm

      How to downgarde rabbitmq to version 3.6.9

      Reply
    16. Sanjeev Gupta on June 26, 2018 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)

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

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

        Reply
        • Bill on January 18, 2019 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

          Reply
          • Uri on June 3, 2019 10:20 am

            Bill,

            You Are The BEST.

            this comment ended 4 hours of pure frustration.

            Thanks.

            Reply
          • Joe on September 13, 2021 7:34 pm

            Thank you a lot. You saved me 6 painful hours.

            Reply
    17. Sunil on June 6, 2018 12:17 pm

      Awesome. Crisp and clear steps.

      Reply
    18. Nickolas Grigorciuc on April 26, 2018 12:48 pm

      Thank you V.M. All perfect works 🙂

      Reply
    19. Megha on April 19, 2018 2:24 pm

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

      Reply
    20. Anurag on April 16, 2018 5:39 am

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

      Reply
    21. sai on March 8, 2018 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 ‘rabbit@stg-trident-app2’
      : Gracefully halting Erlang VM
      : Stopped RabbitMQ broker.
      ———————————————————————————–

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

        Try below command:

        systemctl enable rabbitmq-server.service

        Reply
        • sai on March 9, 2018 6:52 am

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

          Reply
        • sai on March 12, 2018 1:50 pm

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

          Reply
    22. Ruben on January 21, 2018 12:13 pm

      Thanks a lot!

      Reply
    23. meghana on January 9, 2018 5:17 am

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

      Reply
    24. Kamal EL BAARARI on January 4, 2018 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]”.

      Reply
    25. sanjay on December 29, 2017 5:00 am

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

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

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

        Reply
    26. djamel on December 4, 2017 8:50 am

      Thank’s a lot

      Reply
    27. Black Int on November 9, 2017 6:34 am

      Thanks Rahul.

      Reply
    28. HiIcy on November 8, 2017 3:40 am

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

      Reply
    29. Anne on November 7, 2017 12:22 am

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

      Reply
    30. Aleksey on November 4, 2017 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?

      Reply
    31. sk on October 24, 2017 9:56 am

      Works 🙂

      Reply
    32. Francis on October 12, 2017 3:39 am

      Worked like a charm, thank you.

      Reply
    33. Dario Zadro on September 11, 2017 4:23 pm

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

      Reply
    34. Sara on July 21, 2017 6:23 am

      Thanks TechAdmin ,You save my time

      Reply
    35. Talreja on May 12, 2017 4:32 pm

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

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Install PIP on macOS: A Comprehensive Guide
    • Find Objects Between Two Dates in MongoDB: A Practical Guide
    • How to Check Packages Update History in Ubuntu
    • How to Grep for Contents after a Matching Pattern
    • How to Change Port in Next.Js
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.