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.
Step 2: Choose a Datacenter Location
Pick a datacenter location based on your needs, such as New York, London, or Frankfurt.
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.
Step 5: Configure and Launch
Set the Network Type and Authentication Method (SSH key or password). Name the instance and click Create Instance.
Locate Your Instance’s IP Address
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
Step 2: Install RabbitMQ
Install RabbitMQ server by running:
apt install rabbitmq-server
Step 3: Check RabbitMQ Service Status
Verify that RabbitMQ is enabled and running:
systemctl is-enabled rabbitmq-server
systemctl status rabbitmq-server
Step 4: Check Listening Ports
Check which ports RabbitMQ is using with:
ss -tulpn
Step 5: Configure RabbitMQ Environment
Edit the RabbitMQ environment file:
nano /etc/rabbitmq/rabbitmq-env.conf
Update the following settings:
NODENAME=noble64
NODE_IP_ADDRESS=192.168.5.65
NODE_PORT=5672
Step 6: Restart RabbitMQ
Restart RabbitMQ for changes to take effect:
systemctl restart rabbitmq-server
Step 7: Verify RabbitMQ on Port 5672
Confirm that RabbitMQ is running on port 5672:
ss -tulpn | grep 5672
Step 8: Enable RabbitMQ Management Plugin
Enable the web-based management interface:
rabbitmq-plugins enable rabbitmq_management
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 ".*" ".*" ".*"
Step 10: Verify Listening Ports
Check that RabbitMQ is listening on the correct ports:
ss -tulpn
Step 11: Restart RabbitMQ
Restart RabbitMQ to apply user settings:
systemctl restart rabbitmq-server
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
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.