
RabbitMQ is an open-source message broker that facilitates communication between distributed applications through message queuing. It supports multiple messaging protocols including AMQP, MQTT, and STOMP, and provides features such as message routing, delivery acknowledgments, and clustering for high-availability deployments.
This article explains how to install RabbitMQ on an Ubuntu 26.04 server, enable the web management interface, set up Nginx as a reverse proxy with SSL encryption, and configure firewall rules for secure access.
Before you begin, you need to:
rabbitmq.example.com.RabbitMQ and its Erlang dependency are available in the default Ubuntu 26.04 APT repositories. The following steps install both packages and verify the installation.
Update the APT package index.
Install the Erlang runtime and the gnupg package required by RabbitMQ.
Install the RabbitMQ server.
The rabbitmq-server systemd service controls the RabbitMQ broker process. The following steps enable automatic startup on boot and verify the service status.
Enable RabbitMQ to start automatically at boot time.
Start the RabbitMQ service.
Verify that RabbitMQ is active and running.
The output should display active (running), confirming that the RabbitMQ broker is operational.
RabbitMQ includes a built-in management plugin that provides a web-based interface for monitoring queues, exchanges, and connections. The following steps enable the plugin and create an administrative user with full permissions.
Enable the RabbitMQ management plugin.
Create a new administrative user. Replace example_admin with your desired username and strong_password with a secure password.
Assign the administrator tag to the user.
Grant the user full permissions on all RabbitMQ resources.
The three ".*" patterns grant configure, write, and read permissions respectively on all resources in the default virtual host.
Uncomplicated Firewall (UFW) is active by default on Ubuntu 26.04. The following steps open ports for HTTP and HTTPS traffic required by the Nginx reverse proxy.
Allow HTTP traffic on port 80.
Allow HTTPS traffic on port 443.
The RabbitMQ management interface listens on localhost port 15672 by default. Setting up Nginx as a reverse proxy allows access through a domain name on standard HTTP/HTTPS ports. The following steps install Nginx, configure the reverse proxy, and generate a trusted SSL certificate.
Install Nginx.
Enable Nginx to start automatically at boot time.
Start the Nginx service.
Unlink the default Nginx virtual host configuration.
Create a new Nginx virtual host configuration file. Replace rabbitmq.example.com with your actual domain.
Add the following configuration to the file. Replace rabbitmq.example.com with your actual domain.
Save and close the file.
This configuration listens on port 80 and forwards all requests to the RabbitMQ management interface running on 127.0.0.1:15672.
Enable the virtual host by creating a symbolic link.
Test the Nginx configuration for syntax errors.
The output should confirm that the configuration syntax is ok and the test is successful.
Restart Nginx to activate the virtual host.
Install the Certbot Let's Encrypt client and the Nginx plugin.
Generate an SSL certificate for your domain. Replace rabbitmq.example.com with your actual domain.
Follow the on-screen prompts to complete the certificate generation. Certbot automatically updates the Nginx configuration to enable HTTPS.
The RabbitMQ management interface is now accessible through your domain over HTTPS.
Open a web browser and navigate to your domain. Replace rabbitmq.example.com with your actual domain.
Enter the administrative username and password you created earlier to log in.
Click Nodes in the navigation bar to view broker statistics including memory usage, message rates, and connection counts.
You have installed RabbitMQ on an Ubuntu 26.04 server, enabled the web management interface, and secured it with Nginx as a reverse proxy and a trusted Let's Encrypt SSL certificate. RabbitMQ supports clustering and federation for scaling message throughput across multiple nodes. For more information, refer to the official RabbitMQ documentation.
0 Comments
Be the first to comment and share your perspective with the community.