What is port 1883 used for?
Lightweight publish/subscribe messaging for IoT devices.
Should port 1883 be open?
Open only if you need it. Expose it only when required, with encryption and strong authentication, ideally limited to known IP addresses. Port 1883 is unencrypted. Use MQTT over TLS on 8883 with authentication.
See what is listening on port 1883
# Linux
sudo ss -tlnp | grep ':1883 '
# macOS
sudo lsof -nP -i TCP:1883 -sTCP:LISTEN
# Windows (PowerShell)
Get-NetTCPConnection -LocalPort 1883 -State Listen
Open or block port 1883 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 1883/tcp
sudo ufw deny 1883/tcp
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 1883" -Direction Inbound -Protocol TCP -LocalPort 1883 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.
Test it from outside
A port can be open on the server but blocked upstream. The Port Checker connects from the internet, so it shows what the world sees. From your own machine, use nc -vz example.com 1883 (macOS/Linux) or Test-NetConnection example.com -Port 1883 (Windows).