Question
I configured ejabberd to listen in ports 5222, 5269 and 5280. However, when I start ejabberd and look at the ports it opens for listening, he also opened a strange port. In fact, the port number varies every time I start ejabberd.
Why does ejabberd listen in that port?
Explanation
That listening socket is not opened by ejabberd itself, it's opened by Erlang. It is related to epmd and the node connectivity. There is a complete shell session that you can try yourself. The epmd program shows which programs have such a port open in the machine:
$ epmd -names epmd: up and running on port 4369 with data: name ejabberd at port 33581
Erlang node connectivity allows to stop ejabberd, and perform many other administrative tasks implemented in ejabberdctl. It also allows to attach an interactive Erlang shell to the ejabberd node. Finally, it also allows ejabberd clustering.
To have Erlang node connectivity it is required to have epmd and this port listening in ejabberd.
As a side note: It is strongly recommended to block the port 4369 in the firewall for external connections. epmd listens in this port, and usually epmd is not needed from outside the machine.
Related Links
- What is epmd and why does it keep running?
- Chapter 5: Securing ejabberd in the ejabberd Installation and Operation Guide
- Ejabberd listening on port 1212



Recent comments
12 hours 10 min ago
13 hours 40 min ago
15 hours 17 min ago
16 hours 4 min ago
20 hours 50 min ago
1 day 1 min ago
1 day 15 min ago
1 day 27 min ago
1 day 37 min ago
1 day 41 min ago