The following ports need to be forwarded for MQTT:
MQTT - Internet of Things
- TCP: 1883
- UDP: 1883
Forward Ports for MQTT
You might need to forward some ports in your router when you use MQTT. By forwarding ports you allow connection requests coming from the internet to be directed to MQTT.
Routers do not generally allow incoming connection requests from the internet. By forwarding ports you can work around this limitation.
Before You Forward a Port
Before you can forward a port you need to know the following things:
- Your router's internal IP address.
- Your device's internal IP address.
- Each of the TCP and UDP ports that you need to forward.
How to Locate Your Router's IP Address
The easiest way to locate your router's IP address is to run our free Router Detector utility. Our Router Detector tool is free to use and is part of our Network Utilities software.
We have a guide you can follow Find Your Router IP Address if you don't want to run the software.
Setting Up a Port Forward for MQTT
You can use our Network Utilities software to automatically forward ports for you. Our Network Utilities software allows you to add port forwards and also remove them when you no longer need them to maximize your network security.
Alternatively you can do it by hand. The way to forward a port is:
- Log in to your router.
- Locate the section in your router that deals with port forwarding.
- Put your device's IP address in the proper box in your router.
- Put the TCP and UDP ports that you are forwarding for MQTT in the correct boxes in your router.
You probably will need to reboot your router for the changes to take effect.
You can choose your router from our list to see exactly how to forward ports for MQTT:
List of Routers - Customized for MQTT
Those are the steps to take in order to forward ports in your router for MQTT.