
RabbitMQ is an open-source message and streaming broker that enables efficient communication between distributed systems. It's highly extensible with plugins and supports multiple messaging protocols that improve application reliability while enabling fast deployment and integration with other systems.
This article explains how to Install RabbitMQ on Ubuntu 24.04 and secure it on the server.
Before you begin:
Deploy a Ubuntu 24.04 instance on Vultr.
Set up a domain A record pointing to the instance IP address. For example, rabbitmq.example.com.
Access the server using SSH as a non-root user with sudo privileges.
RabbitMQ is available in the default repositories on Ubuntu 24.04. Follow the steps below to install the Erlang dependency package and RabbitMQ on your server.
View the available RabbitMQ APT repository information.
Output:
Install the erlang and gnupg dependency packages.
Install RabbitMQ.
RabbitMQ uses the rabbitmq-server system service to run and manage the application processes on your server. Follow the steps below to manage the RabbitMQ system service.
Enable the RabbitMQ service to start at boot time.
Start the RabbitMQ service.
View the RabbitMQ service status and verify that it's running.
Output:
RabbitMQ uses a management plugin to enable access to the web management panel. Follow the steps below to enable the RabbitMQ plugin, create an administrative user account, and grant the user full permissions to the application processes.
Enable the RabbitMQ management plugin.
Create a new administrative user account with a strong password. Replace admin with your actual user and StrongPassword with your desired user password.
Grant the user administrative privileges.
Grant the user full permissions to all RabbitMQ resources on the server.
Within the above command:
.*: Grants configuration privileges to the user..*: Grants write privileges to the user on any resource..*: Grants read privileges to the user read.RabbitMQ listens for incoming connection requests on the default TCP port 15672 on your server. Set up a reverse proxy such as Nginx to secure the RabbitMQ port and process connection requests using a custom port such as the HTTP port 80. In addition, secure RabbitMQ connection using valid SSL certificates to enable HTTPS connections on the server as described in the following sections.
Install Nginx.
Enable Nginx to start at boot time.
Start the Nginx service.
Disable the default Nginx configuration file.
Create a new Nginx virtual host configuration such as rabbitmq.conf using a text editor such as nano.
Add the following contents to the file. Replace rabbitmq.example.com with your actual domain.
Save and close the file.
The above Nginx configuration creates a new virtual host profile that listens for incoming connections on the HTTP port 80 using your domain rabbitmq.example.com and forwards all connection requests to the RabbitMQ localhost port 15672.
Enable the virtual host configuration.
Test the Nginx configuration for errors.
Restart the Nginx service to apply the configuration changes.
Allow incoming connections to the HTTP port 80 through the default UFW firewall configuration.
Reload UFW to apply your configuration changes.
Install the Certbot Let's Encrypt Client tool.
Generate a new SSL certificate using your domain available in the Nginx virtual host configuration. Replace rabbitmq.example.com and admin@example.com with your actual details.
Restart the Nginx service to apply your SSL configuration changes.
Allow incoming connections to the HTTPS port 443 through the default UFW firewall configuration.
Reload UFW to apply your configuration changes.
Restart the RabbitMQ service.
Access your domain using a web browser such as Chrome to access the RabbitMQ web administration console.
Log in to the RabbitMQ Console using the admin user credentials you created earlier when prompted.
Click Nodes within the RabbitMQ console to view your active node statistics.
You installed RabbitMQ on a Ubuntu 24.04 server and secured the application to enable message streaming between applications. For more information, visit the RabbitMQ documentation.
0 Comments
Be the first to comment and share your perspective with the community.