Skip to content
statance
MenuClose
← All ports

Port 5672: AMQP (RabbitMQ)

High risk

Port 5672 is AMQP, the messaging protocol applications use to publish to and consume from RabbitMQ queues. AMQP over TLS uses 5671. It should not be reachable from the public internet.

Port
5672
Protocol
TCP
Service
AMQP (RabbitMQ)
Expose to internet?
No
Also used by
RabbitMQ, ActiveMQ Artemis, Qpid

Is port 5672 safe to open?

A reachable broker lets anyone with credentials read or inject messages, which often carry orders, emails or jobs. RabbitMQ’s default guest user can only connect from localhost, but administrators sometimes lift that restriction or create weak users.

How to secure AMQP (RabbitMQ)

  • Delete the guest user or keep loopback_users restricting it to localhost.
  • Create per-application users with permissions limited to their vhost.
  • Allow 5672 only from application servers, and use TLS (5671) across networks.

Check if port 5672 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':5672 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 5672 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 5672 # or nmap -p 5672 HOST # Windows Test-NetConnection HOST -Port 5672

Test the AMQP (RabbitMQ) service itself

nc -vz HOST 5672

Restrict port 5672 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:5672:5672) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 5672 proto tcp sudo ufw deny 5672/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=5672/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="5672" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 5672 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 5672 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 5672 from internet" -Direction Inbound -Protocol TCP -LocalPort 5672 -RemoteAddress Internet -Action Block

Monitor port 5672

Run a TCP port monitor against your public IP on port 5672: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 15672RabbitMQ management UIHigh risk
Port 4369Erlang Port Mapper Daemon (epmd)High risk
Port 9092Apache KafkaHigh risk

FAQ

What is port 5672 used for?

Port 5672 is AMQP, the messaging protocol applications use to publish to and consume from RabbitMQ queues. AMQP over TLS uses 5671. It is also used by RabbitMQ, ActiveMQ Artemis, Qpid.

Is it safe to open port 5672?

Not to the public internet. A reachable broker lets anyone with credentials read or inject messages, which often carry orders, emails or jobs. RabbitMQ’s default guest user can only connect from localhost, but administrators sometimes lift that restriction or create weak users.

Is port 5672 TCP or UDP?

AMQP (RabbitMQ) uses TCP on port 5672.

How do I check if port 5672 is open?

On the server, run sudo ss -tulpn | grep ':5672 ' (Linux) or Get-NetTCPConnection -LocalPort 5672 (Windows) to see what is listening. From another machine, run nc -zv HOST 5672 or Test-NetConnection HOST -Port 5672.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.