How to access RabbitMq publicly
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
RabbitMQ can be made reachable from outside the host, but "publicly accessible" should not mean "open to the internet with default settings." A message broker is infrastructure, and exposing it carelessly is a security problem, not a networking achievement.
The technical steps are simple: listen on the right interface, open the right ports, create real users, and secure the connection path. The hard part is doing that without exposing management or AMQP endpoints more broadly than necessary.
What Needs To Be Exposed
RabbitMQ commonly uses:
- '
5672for plain AMQP' - '
5671for TLS AMQP' - '
15672for the management UI'
If you need remote producers and consumers, focus on the AMQP port. If you need the management UI remotely, protect it much more aggressively than the broker port itself.
Listen on a Non-Local Interface
RabbitMQ must listen on an address other than localhost:
Depending on your deployment, you may prefer binding to a specific private IP instead of all interfaces. That is safer when the server has multiple network paths.
After editing configuration, restart RabbitMQ:
Create a Real User
Do not expose RabbitMQ with the default guest account. By default, RabbitMQ restricts guest to localhost for a reason.
Create a dedicated user:
Use the minimum privileges your application actually needs. Not every client needs administrator access.
Secure the Network Path
If external traffic is required, use one or more of these:
- firewall rules
- IP allowlists
- VPN access
- TLS on broker connections
- reverse proxy for management UI
For example, with UFW:
That is much better than opening the ports globally.
Enable TLS for Client Connections
If credentials or messages cross untrusted networks, plain AMQP is a weak choice. Configure TLS instead:
Then clients connect over amqps:// or equivalent TLS-enabled settings in their library.
Management UI Is a Separate Risk
The management plugin is convenient, but it is also a powerful administrative surface. If you must reach it remotely, do not rely only on the RabbitMQ login page.
Safer options:
- expose it only through a VPN
- place it behind a reverse proxy with additional auth
- restrict it to a trusted IP range
Publicly reachable admin UIs are one of the easiest infrastructure mistakes to avoid.
Common Pitfalls
- Opening
5672and15672to the whole internet with no IP restriction. - Trying to use the
guestaccount remotely instead of creating proper users. - Exposing the management UI with the same care level as the AMQP port.
- Running broker traffic over public networks without TLS.
- Treating "it connects from outside" as the only success criterion.
Summary
- RabbitMQ can be accessed remotely by listening on a reachable interface and opening the right ports.
- Create dedicated users and do not rely on the default guest account.
- Protect broker and management ports with firewalls, allowlists, VPNs, or reverse proxies.
- Use TLS for remote AMQP traffic whenever it crosses untrusted networks.
- The right goal is secure remote access, not merely public exposure.
Related reading
- How to access SASL configure kafka from Kafka cli
- How to achieve delayed queue with apache kafka?
- How to achieve high availability in a Kafka Streams app during deployment?
- How to achieve multi-tenancy in the context of Kafka and storm?
- How to acquire a lock by a key
- How to add basic authentication for Tensorflow serving
- How to achieve strong consistency in MongoDB Replica Sets?
- How to adapt Fenwick tree to answer range minimum queries

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.