What ports does RabbitMQ use?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
RabbitMQ is an open-source message broker that helps applications to communicate asynchronously and scalably. Understanding the network ports that RabbitMQ utilizes is crucial for configuring security firewalls, troubleshooting, and ensuring the system is accessible and operates efficiently under various network policies.
Default Ports Used by RabbitMQ
RabbitMQ uses several ports for different purposes, such as listening for client connections, cluster communication, and management interfaces. Below is a summary of the default ports used:
- 4369: EPMD (Erlang Port Mapper Daemon), used for node discovery in RabbitMQ clustering.
- 5672: Standard AMQP clients connection without TLS.
- 5671: AMQP clients connection secured with TLS.
- 25672: Used for Erlang inter-node and CLI tools communication within the cluster (Erlang distribution server port). The actual port number depends on how RabbitMQ was started and can differ.
- 15672: HTTP API clients and RabbitMQ management UI; secured with TLS if configured.
Here's a table summarizing the default ports and their uses:
| Port | Protocol | Usage | Secure (TLS) |
| 4369 | TCP | Erlang Port Mapper Daemon (EPMD) | No |
| 5672 | TCP | AMQP clients | No |
| 5671 | TCP | AMQP clients | Yes |
| 25672 | TCP | Erlang distribution for clustering | Configurable |
| 15672 | TCP | Management interface and HTTP API clients | Configurable |
Technical Aspects and Examples
1. AMQP Ports (5672 and 5671)
AMQP (Advanced Message Queuing Protocol) is the core protocol used by RabbitMQ for messaging. Port 5672 is used for connections without TLS, suitable for internal networks where security is handled by other means. For secure communications over the internet or untrusted networks, port 5671 is utilized, where traffic is encrypted using TLS.
Example Configuration:
2. Management and Monitoring (Port 15672)
The RabbitMQ Management Plugin provides a web-based UI and HTTP-API interface, running by default on port 15672. This is particularly useful for monitoring and managing the broker's resources, queues, bindings, and connections.
Example Access:
3. Clustering and Node Communication (Port 25672)
RabbitMQ clustering uses the Erlang distribution mechanism, primarily over port 25672, to facilitate communication between different nodes (Erlang processes) within the cluster. This is vital for processes such as synchronization of queue status and mirroring.
Cluster Configuration Example:
Security Considerations
When configuring RabbitMQ, it's imperative to consider the security implications associated with exposing these ports, especially over public networks. Utilizing firewalls to restrict access to trusted IPs and enabling TLS (on ports 5671 and 15672) are common practices to prevent unauthorized access and data breaches.
Conclusion
Understanding the function and significance of each port RabbitMQ uses is key to effectively configuring, managing, and securing your RabbitMQ deployment. Monitoring these ports and applying appropriate security measures ensures that the message broker performs optimally while maintaining data integrity and confidentiality.

