RabbitMQ is a reliable, open-source message broker used for communication between distributed systems and microservices. This guide will walk you through setting up RabbitMQ on an Ubuntu 24.04 server, starting from creating an instance on Cloud.shape.host.

Why Use RabbitMQ?

RabbitMQ supports multiple messaging protocols and offers efficient handling of tasks like task queues, event streaming, and message routing between microservices. It’s ideal for DevOps and cloud environments due to its scalability, reliability, and ease of use.


Creating an Instance on Cloud.shape.host

Step 1: Access the Dashboard and Create

Log in to your Cloud.shape.host account, click Create, and select Instances.

Shape.host Resources dashboard with Create > Instance highlighted.

Step 2: Choose a Datacenter Location

Pick a datacenter location based on your needs, such as New York, London, or Frankfurt.

Shape.host instance form with the data center location selector highlighted.

Step 3: Select a Plan

Choose a plan depending on the resources you need (Standard, CPU-Optimized, or Memory-Optimized).

Step 4: Choose an Operating System

Select Ubuntu as the operating system for RabbitMQ installation.

Shape.host instance form with the operating system image selector highlighted.

Step 5: Configure and Launch

Set the Network Type and Authentication Method (SSH key or password). Name the instance and click Create Instance.

Shape.host instance form with the Create Instance button highlighted.

Locate Your Instance’s IP Address

Shape.host Resources dashboard with the server IP address highlighted.

Accessing Your Instance

Once your instance is launched, you can access it via:

  • SSH (for Linux/macOS):
    Open a terminal and run:
   ssh root@<your-instance-ip>

Replace <your-instance-ip> with your server’s public IP.

  • PuTTY (for Windows):
    Download PuTTY, enter the instance’s public IP in the Host Name field, and click Open.
  • Remote Desktop (for Windows-based OS):
    Use Remote Desktop and enter your instance’s public IP address to connect.

Installing and Configuring RabbitMQ

Step 1: Update and Upgrade the System

Run the following commands to update your system packages:

apt update -y
apt upgrade -y
Terminal showing APT package management commands and output.

Step 2: Install RabbitMQ

Install RabbitMQ server by running:

apt install rabbitmq-server
Terminal showing APT package management commands and output.

Step 3: Check RabbitMQ Service Status

Verify that RabbitMQ is enabled and running:

systemctl is-enabled rabbitmq-server
systemctl status rabbitmq-server
Terminal showing systemd service management commands or output.

Step 4: Check Listening Ports

Check which ports RabbitMQ is using with:

ss -tulpn
Terminal showing ss commands or output during Check Listening Ports.

Step 5: Configure RabbitMQ Environment

Edit the RabbitMQ environment file:

nano /etc/rabbitmq/rabbitmq-env.conf
Terminal showing nano commands or output during Configure RabbitMQ Environment.

Update the following settings:

NODENAME=noble64
NODE_IP_ADDRESS=192.168.5.65
NODE_PORT=5672
Terminal showing the GNU nano editor and configuration text.

Step 6: Restart RabbitMQ

Restart RabbitMQ for changes to take effect:

systemctl restart rabbitmq-server
Terminal showing systemd service management commands or output.

Step 7: Verify RabbitMQ on Port 5672

Confirm that RabbitMQ is running on port 5672:

ss -tulpn | grep 5672
Terminal showing ss commands or output during Verify RabbitMQ on Port 5672.

Step 8: Enable RabbitMQ Management Plugin

Enable the web-based management interface:

rabbitmq-plugins enable rabbitmq_management
Terminal displaying RabbitMQ management plugin enablement output.

Step 9: Create an Admin User

Create an administrator user and set permissions:

rabbitmqctl add_user admin adminpass
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
Terminal showing RabbitMQ administrator user and permission commands.

Step 10: Verify Listening Ports

Check that RabbitMQ is listening on the correct ports:

ss -tulpn
Terminal showing ss commands or output during Verify Listening Ports.

Step 11: Restart RabbitMQ

Restart RabbitMQ to apply user settings:

systemctl restart rabbitmq-server

Terminal showing systemd service management commands or output.

Access RabbitMQ Web UI

Step 12: Access the Web Interface
To access the RabbitMQ management interface, open a browser and visit:

http://51.254.111.73:15672/

Log in with:

  • Username: admin
  • Password: adminpass
RabbitMQ sign-in form.
RabbitMQ management overview with node and message statistics.

By following these steps, you will have RabbitMQ fully installed and configured on your Ubuntu 24.04 server. For scalable cloud infrastructure, consider Shape.host, offering robust Cloud VPS solutions for deploying RabbitMQ and other enterprise applications.