Is port 1883 (MQTT) open on my router, and how do I close it?
Port 1883 is the default port for MQTT, a lightweight messaging protocol used by smart-home hubs, sensors and IoT platforms. If it's reachable from the public internet and the broker accepts anonymous connections — which the protocol allows by default — anyone who finds it can read or send messages; AdminKit's port-check tool shows if yours is reachable.
By AdminKit team, Netbase JSC · Updated
Key takeaways
- Port 1883 is IANA’s registered port for plaintext MQTT. If it is reachable from the internet and the broker accepts anonymous clients, a stranger can read and send messages on your network.
- An anonymous client can do more than read sensor values: it receives the last retained state of every topic it subscribes to, can publish commands, and can push a device offline by reusing its client ID.
- AdminKit’s MQTT check sends one CONNECT with no credentials to your own public IP and reports the broker’s answer: anonymous access allowed, authentication required, or no connection.
- Close the router forward first. If you truly need remote access, require per-device credentials, use TLS on 8883, and prefer a VPN.
Why does an open port 1883 matter?
MQTT (Message Queuing Telemetry Transport) is a publish-subscribe messaging protocol built to be lightweight enough for small IoT devices, and it’s the backbone of a huge share of smart-home, building-automation and industrial sensor deployments. A device “publishes” a message to a topic (like home/livingroom/temperature), and anything “subscribed” to that topic receives it, all routed through a central broker. IANA registers port 1883 as MQTT’s default plaintext port, and 8883 for MQTT over TLS.
The protocol itself, per the OASIS MQTT 5.0 standard, explicitly supports authentication — Section 5 covers “Authentication of Clients by the Server” and recommends implementations “SHOULD offer Authentication, Authorization and secure communication options.” Critically, though, MQTT does not require authentication, and the CONNECT packet’s username and password fields are optional. Whether a broker insists on them is a configuration choice. If that broker is also reachable from the public internet, anyone who finds it can subscribe to topics, read everything being published, or publish their own messages, which connected devices may act on without question.
Why do so many brokers accept anonymous clients?
Because for years that was the easy default. Eclipse Mosquitto, one of the most common self-hosted brokers, is a good illustration. Its 2.0 migration notes describe the change: on 1.x, a configured listener allowed unauthenticated clients by default; from 2.0, allow_anonymous “now defaults to false”, and a broker started with no configuration binds only to the loopback interfaces, so only the local host can connect.
That change protects new installs, not old ones. A broker set up on 1.x and upgraded in place keeps whatever its configuration file says, and setup guides for hubs and hobby projects often add allow_anonymous true so the first device connects without fuss. Other brokers, and brokers embedded inside hubs and NVRs, have their own defaults that you can only learn from their documentation or by testing.
What can an anonymous client do on an open broker?
More than most owners expect. Every row below is ordinary MQTT behavior described in the MQTT 5.0 standard, available to any client the broker lets in:
| MQTT feature | What a stranger gets on an anonymous broker |
|---|---|
Multi-level wildcard # | One subscription to # “matches any number of levels within a topic name”, so it receives every normal topic at once |
| Retained messages | The standard says “a new non-shared subscriber will receive the most recent state”, so the stranger sees current door, alarm and presence states instantly, without waiting |
| PUBLISH to command topics | Devices that obey .../set or .../cmd topics act on the stranger’s message as on any other |
| Retained PUBLISH | A forged retained message stays on the broker and is handed to every device that subscribes later, including after a restart of that device |
| Client ID reuse | If the stranger connects with a device’s client ID, the broker disconnects the existing client with reason code 0x8E (Session taken over) |
$SYS topics, on brokers that publish them | Broker software name and version, client counts and other internals that help an attacker pick an exploit |
Topics that begin with $ are not matched by a bare #, which is why the broker’s own $SYS statistics need a separate subscription. On a broker with no access control list, that separate subscription is just one more line.
How do you check if you’re actually exposed?
Don’t assume — check directly. AdminKit’s MQTT exposure check tests whether a broker on your own public IP is reachable (port 1883 by default, or a port you enter) and whether it accepts an anonymous connection, which is the specific combination that matters (a broker that’s reachable but requires valid credentials is a very different situation from one that accepts anyone). It tries MQTT 5 first and falls back to 3.1.1 if the broker does not speak 5. It never publishes, and it never subscribes to any of your topics; when anonymous access is allowed, the only extra thing it reads is the broker’s $SYS/broker/version.
The tool page calls AdminKit’s public Check API, and you can make the same calls from a script on the network you want to test. Called without an API key, the API, like the page, only probes the address the request comes from, so the target must be your own public IP:
curl -s https://api.adminkit.net/v1/check/my-ip
curl -s -X POST https://api.adminkit.net/v1/check/mqtt \
-H 'content-type: application/json' \
-d '{"target": "203.0.113.5", "options": {"port": 1883}}'
The response carries the same fields the page shows. This shortened example uses a documentation address and is illustrative, not copied from a real broker:
{
"check": "machine.mqtt",
"target": "203.0.113.5:1883",
"status": "fail",
"summary": "anonymous access allowed",
"evidence": {
"tls_used": false,
"protocol_version": 5,
"reason_code": 0,
"anonymous_accepted": true
}
}
Alongside it, run port check against your own IP (only with your own consent — it only ever scans the IP making the request) to see which commonly-exposed device ports, including 1883, are currently reachable from outside.
To find your current public IP before running these checks from outside your own network, use what is my IP.
How do you read the MQTT check result?
The result shows a state, the CONNACK code the broker sent back, and the transport. The code is shown in hex without a leading zero, so success appears as 0x0. The codes below come from the MQTT 5.0 reason-code table and from Table 3.1 of the MQTT 3.1.1 standard:
| State shown | CONNACK you may see | What it means | What to do |
|---|---|---|---|
| Anonymous access allowed | MQTT 5 or 3.1.1, 0x0 (Success / Connection Accepted) | Anyone on the internet can use this broker | Remove the port forward now, then require credentials |
| Authentication required | MQTT 5 0x86 (Bad User Name or Password) or 0x87 (Not authorized); MQTT 3.1.1 0x4 or 0x5 | Reachable, but a login is enforced | Still reachable from the internet in plaintext; close it or move remote clients to TLS on 8883 behind a VPN |
| Could not complete a connection | none | Nothing answered with MQTT on this port, or the connection was refused or timed out | Good if expected; re-check after router changes |
| Skipped — not your own IP | none | The address is not the one you are browsing from | Run the check from the network you want to test |
If the check also shows a $SYS/broker/version string, the broker hands out its software name and version to anonymous clients. Note that string; it tells you which release notes and advisories apply to your broker.
How do you find the device running the broker?
If 1883 shows open and accepting connections, the next step is identifying the source on your own network, since closing the port on your router is only half the fix if the underlying device keeps re-opening it (some smart-home hubs use UPnP to request port forwards automatically every time they restart):
- Check your router’s port-forwarding or UPnP-mapped-ports list for an entry pointing at 1883 or 8883.
- Identify which device that forward points to — smart-home hubs (Home Assistant installs, proprietary hub devices), NVRs, and some building-automation gateways are the most common sources.
- Check that device’s own configuration for a setting like “remote access,” “cloud bridge,” or “external MQTT” — this is often what triggered the port forward in the first place, and disabling it may remove the need for the forward entirely.
A few device categories account for most of the accidental MQTT exposure we’d expect to see on home and small-business networks:
- Home Assistant installs that enable the built-in MQTT broker add-on for local automations, where a port forward added for an unrelated reason (remote dashboard access, for example) can incidentally expose the broker too if it isn’t scoped carefully.
- NVRs and camera systems that use MQTT internally to publish motion-detection events, sometimes with a broker that listens on all network interfaces by default rather than just localhost.
- Building-automation gateways bridging older BACnet or Modbus equipment into an MQTT-based dashboard, often installed by a contractor who prioritized getting the integration working over locking down the broker afterward.
- DIY IoT projects (a Raspberry Pi running Mosquitto or a similar broker for a hobby project) where a port forward was added during setup and simply never removed once the project was working.
How do you close it or secure it?
You generally have two options, and they aren’t mutually exclusive:
Close the port if you don’t need internet access to the broker at all (the common case — most smart-home automations only need devices to reach the broker locally):
- Remove the port-forwarding rule for 1883/8883 from your router’s admin page.
- Disable UPnP on your router if the device re-creates the forward automatically; UPnP lets devices on your network open ports without asking you each time, which is convenient but removes a layer of control.
- Re-run port check afterward to confirm the broker’s port is no longer reachable from outside; then re-run the MQTT exposure check for protocol-level confirmation that the broker no longer accepts an anonymous connection from outside.
If you genuinely need remote access to the broker (for example, checking sensor data while away from home):
- Require authentication on the broker — disable anonymous access in the broker’s configuration and set a username/password or client certificates for every client.
- Use TLS (port 8883) rather than plaintext 1883 for any connection that crosses the public internet; is port 8883 (MQTTS) exposed covers what TLS does and does not fix.
- Restrict access by source IP where your broker software supports it, rather than leaving it open to any address.
- Consider a VPN into your home or office network instead of exposing the broker port directly — this keeps the broker itself unreachable from the open internet entirely.
The broker-side settings (password files, binding to one interface, topic ACLs) are walked through step by step in how to harden a home or SMB MQTT broker.
Is this a bug, or how the protocol works?
The gap here isn’t a bug in any specific product — it’s a consequence of a protocol designed for lightweight, often resource-constrained devices, where mandatory authentication adds overhead some deployments skip. The same pattern shows up with other machine protocols; see our guide on Modbus TCP exposure for a closely related issue on industrial networks, where the stakes of an unauthenticated, internet-reachable protocol are often even higher, and CoAP for the equivalent gap on low-power IoT and sensor devices.
If you’d rather not run the broker yourself, Netbase sets up and runs the Secure MQTT Broker for you as a custom engagement: every connection needs its own credentials, with no anonymous-access option, plus default-deny per-topic access control so one device can’t read or write topics it has no reason to touch. Talk to our team about your devices; otherwise, the steps above are the fix.
Which brokers may you test?
Every check this guide links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a broker or network you don’t control — AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.
This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.
Frequently asked questions
Why would MQTT be exposed on my home or office router in the first place?
Usually it's unintentional: a smart-home hub, NVR, or IoT gateway runs an MQTT broker for its own internal use, and either the device's firmware opens the port via UPnP automatically, or someone forwarded the port manually for remote access and forgot about it.
Is 1883 always MQTT, or could it be something else?
Port 1883 is IANA's registered port for MQTT, but any service can technically run on any port. If a port scan shows 1883 open, confirm what's actually listening before assuming it's a misconfigured broker — AdminKit's MQTT exposure check (/tools/mqtt-check/) tests for MQTT protocol behavior specifically — it sends an anonymous CONNECT and reads the broker's CONNACK — not just whether the port responds.
What's the difference between port 1883 and 8883?
1883 is plain, unencrypted MQTT. 8883 is MQTT over TLS, encrypting the connection. An open 8883 port is still a problem if the broker accepts unauthenticated connections — encryption protects the data in transit, not who's allowed to connect.
I use a cloud IoT platform (AWS IoT, Azure IoT Hub, a managed broker). Does this apply to me?
Managed cloud MQTT services generally require authentication by design and aren't the broker type this guide is about. This guide is about brokers running on your own hardware (a hub, gateway, NVR, or self-hosted server) that might be reachable from the internet without you realizing it.
Will closing port 1883 break my smart-home devices?
Only if those devices need MQTT to reach your broker from outside your own network, which is uncommon — most smart-home MQTT traffic stays entirely local. Closing the port at your router (not on the device itself) stops internet access to the broker while local devices keep working normally.
Can someone on an open broker disconnect my devices, not just read them?
Yes. The MQTT 5.0 standard says that if a new connection uses a client ID that is already connected, the broker disconnects the existing client with reason code 0x8E (Session taken over). On an anonymous broker, anyone who learns a device's client ID can keep pushing that device off.
Want AdminKit to watch this for you?
Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.
Talk to an expert
Huy Nguyen (David), Founder & CEO, Netbase JSC
Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.