Deployment Overview of RabbitMQ on Server¶
Prerequisites and Basic Requirements¶
The application requires an Ubuntu operating system. The following requirements must be met for a successful deployment:
-
Privileges: Root or sudo access is required to install packages and manage services.
-
Ports:
-
443(HTTPS) for external access via the proxy. -
15672(Internal Management API) used by the local proxy. -
DNS/Network: The server requires outbound internet access to reach DNS servers (
1.1.1.1,8.8.8.8,9.9.9.9) and to obtain SSL certificates via Certbot.
FQDN of the final panel on the hostkey.in domain¶
The management interface is accessible through a specific subdomain template:
| Parameter | Value |
|---|---|
| Prefix | rabbitmq |
| Domain | hostkey.in |
| Full template | rabbitmq{Server_ID}.hostkey.in |
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration and data persistence:
-
/etc/rabbitmq: Contains RabbitMQ configuration files (rabbitmq-env.conf,rabbitmq.conf). -
/root/nginx: Contains the Docker Compose file for the Nginx proxy. -
/data/nginx/user_conf.d: Stores Nginx virtual host configurations and proxy settings. -
/data/nginx/nginx-certbot.env: Contains environment variables for the Nginx container.
Application installation process¶
The RabbitMQ application is installed via the system package manager and configured through several steps:
-
System Update: The
aptcache is updated to ensure the latest available packages are used. -
Environment Configuration: A configuration file
/etc/rabbitmq/rabbitmq-env.confis created to pin the RabbitMQ node name tolocalhost. This ensures stable communication within the server environment. -
Package Installation: The
rabbitmq-serverpackage is installed viaapt. -
Plugin Activation: The
rabbitmq_managementplugin is enabled to allow access to the web-based management interface. -
Service Configuration:
-
A configuration file
/etc/rabbitmq/rabbitmq.confis created to restrict the management listener to the local loopback interface (127.0.0.1) on port15672. -
The RabbitMQ service is enabled and started via the system service manager.
-
User and Virtual Host Setup:
-
An administrative user is created with administrator privileges.
-
A default virtual host (
/) is configured, and the admin user is granted full permissions over it.
Access Rights and Security¶
-
Management Interface: The management interface is restricted to
127.0.0.1(localhost) at the application level, meaning it cannot be accessed directly from the internet via port 15672. -
Proxy Access: External access is provided through an Nginx proxy running in a Docker container, which handles SSL termination and forwards requests to the local RabbitMQ service.
-
Permissions: The administrative user is granted full permissions (
.*for configuration,.*for write, and.*for read) on the default virtual host.
Databases¶
RabbitMQ does not use an external database; it manages its own internal state and message queues within its service process.
Docker Containers and Their Deployment¶
The deployment includes one application-related container used to manage SSL certificates and reverse proxying:
Nginx Proxy Container
-
Image:
jonasal/nginx-certbot:latest -
Ports: Uses
hostnetwork mode (mapping directly to host ports). -
Volumes:
-
nginx_secrets:/etc/letsencrypt(External volume for SSL certificates) -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d(Configuration files) -
Environment Variables:
-
Restart Policy:
unless-stopped
Application Update Instructions¶
To update the RabbitMQ application, perform the following steps:
-
Update the system package list and upgrade the rabbitmq-server package using the package manager:
-
If changes are made to the Docker proxy configuration, restart the Nginx container:
Location of configuration files and data¶
-
RabbitMQ Environment Config:
/etc/rabbitmq/rabbitmq-env.conf -
RabbitMQ Main Config:
/etc/rabbitmq/rabbitmq.conf -
Nginx Proxy Configs:
/data/nginx/user_conf.d/ -
SSL Certificates: Managed via the
nginx_secretsDocker volume.
Available ports for connection¶
| Port | Service | Access Type |
|---|---|---|
| 443 | HTTPS (Nginx Proxy) | External |
| 15672 | RabbitMQ Management API | Internal Only |