How to Forward Ports in Your Router for MQTT

Thumbnail image of Port Forward Staff
Port Forward Staff
July 23, 2021 (Last Updated: ) | Reading Time: 1 minutes

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:

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:

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

Forward Ports for MQTT

The following ports need to be forwarded for MQTT:

MQTT - Internet of Things

  • TCP: 1883
  • UDP: 1883

Those are the steps to take in order to forward ports in your router for MQTT.

Still Can't Connect After Forwarding Your Ports?

Some internet connections can't be port forwarded at all. If your ISP uses CGNAT, or you are behind two routers (double NAT), incoming connections never reach your router, no matter how its ports are set.

For those connections a VPN is the way around it. NordVPN includes Meshnet, which links your devices over an encrypted connection so they can reach each other from anywhere, without opening any ports.

NordVPN: faster than ever

Get NordVPN

NordVPN links are affiliate links: if you sign up through one, we get a small commission. That's how we keep most of this site ad-free.

More From Portforward