virtualMachinerabbitmq

Connect to RabbitMQ from a different machine

For security reasons, the RabbitMQ ports in this solution cannot be accessed over a public IP address. To connect to RabbitMQ from a different machine, you must open ports 5672 and 5672 for remote access. Refer to the FAQ for more information on this.

IMPORTANT: Making this application’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

If you want to use a transport connector to use RabbitMQ from a different machine, stop your RabbitMQ server and edit the /opt/bitnami/rabbitmq/etc/rabbitmq/rabbitmq.config file, setting the bind address from 127.0.0.1 to 0.0.0.0:

...
{rabbit,
  [%%
   %% Network Connectivity
   %% ====================
   %%

   %% By default, RabbitMQ will listen on all interfaces, using
   %% the standard (reserved) AMQP port.
   %%
    {tcp_listeners, [5672]},
...

If you don’t want to connect to the management console from a different machine, edit the same file with the following configuration:

...
{rabbitmq_management,
[%% Pre-Load schema definitions from the following JSON file. See
 %% http://www.rabbitmq.com/management.html#load-definitions
 %%
 %% {load_definitions, "/path/to/schema.json"},

 %% Log all requests to the management HTTP API to a file.
 %%
 %% {http_log_dir, "/path/to/access.log"},

 %% Change the port on which the HTTP listener listens,
 %% specifying an interface for the web server to bind to.
 %% Also set the listener to use SSL and provide SSL options.
 %%
  {listener, [{port, 15672},{ip, "127.0.0.1"}]}
...

Restart the server for the changes to come into effect.

To connect to RabbitMQ from a different machine, use a command like the one below:

$ rabbitmqadmin -H SERVER-IP -u USER_NAME -p PASSWORD list vhosts
Last modification December 21, 2022