Port 1883 is unencrypted MQTT, a publish/subscribe messaging protocol used by IoT devices and home automation. The TLS version normally runs on port 8883. It should not be reachable from the public internet.
- Port
- 1883
- Protocol
- TCP
- Service
- MQTT
- Expose to internet?
- No
- Also used by
- Mosquitto, EMQX, HiveMQ, Home Assistant, IoT devices
Is port 1883 safe to open?
MQTT on 1883 is plain text, and brokers that allow anonymous access let anyone subscribe to every topic with # and publish commands to devices. Exposed brokers have leaked sensor data and allowed control of locks, lights and industrial equipment.
How to secure MQTT
- Disable anonymous access. Mosquitto 2.x does this by default; check
allow_anonymous falseand configure apassword_file. - Use TLS on 8883 for anything outside the local network.
- Use ACLs so each client can only read and write its own topics.
- Bind to the internal interface with an explicit
listener 1883 192.168.x.x.
Check if port 1883 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':1883 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 1883 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 1883
# or
nmap -p 1883 HOST
# Windows
Test-NetConnection HOST -Port 1883Test the MQTT service itself
mosquitto_sub -h HOST -p 1883 -t '$SYS/#' -C 1 -vRestrict port 1883 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:1883:1883) 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 1883 proto tcp
sudo ufw deny 1883/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=1883/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="1883" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 1883 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1883 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 1883 from internet" -Direction Inbound -Protocol TCP -LocalPort 1883 -RemoteAddress Internet -Action BlockMonitor port 1883
Run a TCP port monitor against your public IP on port 1883: 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 5672 | AMQP (RabbitMQ) | High risk |
| Port 5222 | XMPP (client connections) | Low risk |
| Port 6379 | Redis | Critical risk |
FAQ
What is port 1883 used for?
Port 1883 is unencrypted MQTT, a publish/subscribe messaging protocol used by IoT devices and home automation. The TLS version normally runs on port 8883. It is also used by Mosquitto, EMQX, HiveMQ, Home Assistant, IoT devices.
Is it safe to open port 1883?
Not to the public internet. MQTT on 1883 is plain text, and brokers that allow anonymous access let anyone subscribe to every topic with # and publish commands to devices. Exposed brokers have leaked sensor data and allowed control of locks, lights and industrial equipment.
Is port 1883 TCP or UDP?
MQTT uses TCP on port 1883.
How do I check if port 1883 is open?
On the server, run sudo ss -tulpn | grep ':1883 ' (Linux) or Get-NetTCPConnection -LocalPort 1883 (Windows) to see what is listening. From another machine, run nc -zv HOST 1883 or Test-NetConnection HOST -Port 1883.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.