The task is to make the smart home system using the MQTT protocol, read many articles about it and mostly describe how to install and configure Mosquitto, but within the local network, and I am interested in access from the external network. In general, I don’t have a lot of skills using mqtt (or, to be more precise, then 0), so I’m hard to imagine how to do this.

At first, I thought of putting the mqtt server on an external hosting and making a kind of cloud to which data would come and be transmitted for display on the website on the same hosting, but I did not find information on the Internet how to install mqtt on an external hosting. If someone came across a solution to this issue, I will be very grateful if you push me in the right direction.

  • If by external hosting you mean renting a virtual server, then installing any software on it is no different from installing on a physical computer in your home - Mike
  • The fact of the matter is that I meant ordinary hosting, because the prices for Dedik (server) are too biting. Generally, I stumbled upon Mosquitto-php but didn’t understand whether it was suitable for my purposes, and whether it was possible to throw it on the hosting. - Misha Busko
  • Not. The mqtt protocol cannot work via http. so http hosting will not work anyway. You can put the server at home and start the Internet on it with a real ip (or the real ip should be on the router and the mqtt port on it then be forwarded to the server). And you can connect to it outside - Mike
  • I also thought about this way, you only need to connect a real ip, but now you need to decide on what to put the server, because as far as I understand it, if you put it on a PC, then you need to keep it on all the time. And where else can you put the server? Is the Arduino suitable for this? - Misha Busko
  • Arduino brains are clearly not enough. But it’s very realistic to upload to any OpenWRT router and include the mqtt server in it. Well, or a separate single-board computer based on some kind of Raspberry - Mike

1 answer 1

I could not answer in the comment, I write the answer for this =)

How to Install and Secure the Mosquitto MQTT Messaging Broker on CentOS 7

VPS (OpenVZ) server with CentOS 7 can be found at around $ 10 per year. Search lowendbox.com . For example, here (not advertising) =)