Skip to content
statance
MenuClose
← All ports

Port 5222: XMPP (client connections)

Low risk

Port 5222 is XMPP client-to-server, used by Jabber chat clients. Servers talk to each other on 5269. It is normally meant to be reachable from the internet.

Port
5222
Protocol
TCP
Service
XMPP (client connections)
Expose to internet?
Yes, usually
Also used by
ejabberd, Prosody, Openfire

Is port 5222 safe to open?

An XMPP server for public users needs 5222 open and uses STARTTLS. Risks are account brute force, open in-band registration used by spammers, and unpatched server software.

How to secure XMPP (client connections)

  • Require TLS for client connections (Prosody c2s_require_encryption = true).
  • Disable open in-band registration unless you want public sign-ups.
  • Keep the server software patched.

Check if port 5222 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':5222 '

Windows (PowerShell): what is listening

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

From another machine: is it reachable

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

Open port 5222 in the firewall

ufw (Ubuntu, Debian)

sudo ufw allow 5222/tcp

firewalld (RHEL, Rocky, Alma, Fedora)

sudo firewall-cmd --permanent --add-port=5222/tcp sudo firewall-cmd --reload

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Allow 5222/TCP" -Direction Inbound -Protocol TCP -LocalPort 5222 -Action Allow

Monitor port 5222

Add a TCP port monitor for 5222 and Statance connects to it from up to six regions, alerting you by email, Slack, Discord or PagerDuty when XMPP (client connections) stops answering. TCP port monitoring.

Related ports

Port 1883MQTTHigh risk
Port 3478STUN / TURNLow risk

FAQ

What is port 5222 used for?

Port 5222 is XMPP client-to-server, used by Jabber chat clients. Servers talk to each other on 5269. It is also used by ejabberd, Prosody, Openfire.

Is it safe to open port 5222?

Usually, yes. An XMPP server for public users needs 5222 open and uses STARTTLS. Risks are account brute force, open in-band registration used by spammers, and unpatched server software.

Is port 5222 TCP or UDP?

XMPP (client connections) uses TCP on port 5222.

How do I check if port 5222 is open?

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

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.