What port does MQTT use?
MQTT uses 1883 and 8883, and which one depends on what you are doing.
Plain and TLS, the same split as every other protocol that gained encryption later.
| Port | Protocol | Name | What it is for |
|---|---|---|---|
| 1883 | TCP | MQTT | Lightweight publish/subscribe messaging for IoT devices. |
| 8883 | TCP | MQTT over TLS | Encrypted MQTT. |
Exposing it
Unencrypted and often unauthenticated by default. Use port 8883 for MQTT over TLS.
Checking it is listening
sudo lsof -i :1883 # macOS, Linux
netstat -ano | findstr :1883 # Windows
nc -zv host 1883 # from elsewhere
An "address already in use" error on a port nothing appears to be holding usually means the socket is in TIME_WAIT rather than that a process has it — the ports reference covers that and the ephemeral range.
Frequently asked questions
What port does MQTT use?
MQTT uses ports 1883, 8883, and they do different jobs. 1883: Lightweight publish/subscribe messaging for IoT devices. 8883: Encrypted MQTT.
Is port 1883 safe to expose to the internet?
Unencrypted and often unauthenticated by default. Use port 8883 for MQTT over TLS.
How do I check whether MQTT is listening?
sudo lsof -i :1883 on macOS or Linux, netstat -ano | findstr :1883 on Windows. From another machine, nc -zv host 1883 says whether anything answers.
Other services
- What port does SSH use?
- What port does RDP use?
- What port does MySQL use?
- What port does PostgreSQL use?
- What port does SQL Server use?
- What port does Oracle use?
- What port does MongoDB use?
- What port does Redis use?
- What port does Memcached use?
- What port does Elasticsearch use?
- What port does DNS use?
- What port does NTP use?
Port 1883 in full · Port 8883 in full · Every service · All port numbers