Installation guides

Installing RabbitMQ on Debian

Step-by-Step Guide

  1. Update the Package Index
    Open a terminal and update the package index to ensure you have the latest information about available packages:
   sudo apt update
  1. Install Erlang
    RabbitMQ requires Erlang to be installed. Add the Erlang repository:
   sudo apt install -y gnupg
   curl -fsSL https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
   echo "deb https://packages.erlang-solutions.com/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/erlang.list
   sudo apt update
   sudo apt install -y erlang
  1. Add RabbitMQ Repository
    Add the RabbitMQ repository to your system:
   curl -fsSL https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey | sudo apt-key add -
   echo "deb https://packagecloud.io/rabbitmq/rabbitmq-server/debian/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
   sudo apt update
  1. Install RabbitMQ
    Install RabbitMQ using the apt package manager:
   sudo apt install -y rabbitmq-server
  1. Start and Enable RabbitMQ
    Start the RabbitMQ service:
   sudo systemctl start rabbitmq-server

Enable RabbitMQ to start on boot:

   sudo systemctl enable rabbitmq-server
  1. Verify RabbitMQ Installation
    Check the RabbitMQ service status to ensure it is running:
   sudo systemctl status rabbitmq-server

If RabbitMQ is running, you should see an active (running) status.

  1. Enable RabbitMQ Management Plugin
    Enable the RabbitMQ management plugin to access the web-based management interface:
   sudo rabbitmq-plugins enable rabbitmq_management

The management interface will be available at http://your_server_ip:15672/.

  1. Create an Administrative User
    Create an administrative user for the RabbitMQ management interface:
   sudo rabbitmqctl add_user your_username your_password
   sudo rabbitmqctl set_user_tags your_username administrator
   sudo rabbitmqctl set_permissions -p / your_username ".*" ".*" ".*"
  1. Access the Management Interface
    Open your web browser and navigate to http://your_server_ip:15672/. Log in using the administrative user credentials you created.
  2. Secure RabbitMQ (Optional)
    For added security, consider setting up SSL/TLS and configuring a firewall to restrict access. Edit the RabbitMQ configuration file: sudo nano /etc/rabbitmq/rabbitmq.conf Add the necessary SSL/TLS configuration parameters. For example: listeners.ssl.default = 5671 ssl_options.cacertfile = /path/to/cacert.pem ssl_options.certfile = /path/to/cert.pem ssl_options.keyfile = /path/to/key.pem ssl_options.verify = verify_peer ssl_options.fail_if_no_peer_cert = true Restart RabbitMQ to apply the changes: sudo systemctl restart rabbitmq-server
  3. Monitor RabbitMQ
    You can monitor RabbitMQ using the management interface or by using the rabbitmqctl command-line tool:
    bash sudo rabbitmqctl status
Other Recent Posts