{"id":1756,"date":"2017-04-17T06:53:50","date_gmt":"2017-04-17T13:53:50","guid":{"rendered":"http:\/\/internetofhomethings.com\/homethings\/?p=1756"},"modified":"2017-04-19T17:05:35","modified_gmt":"2017-04-20T00:05:35","slug":"vps-application-1-mqtt-broker","status":"publish","type":"post","link":"https:\/\/internetofhomethings.com\/homethings\/?p=1756","title":{"rendered":"VPS Application 1: MQTT Broker"},"content":{"rendered":"<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/vps_mqtt.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1779\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/vps_mqtt.jpg\" alt=\"\" width=\"450\" height=\"225\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/vps_mqtt.jpg 450w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/vps_mqtt-300x150.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Using an MQTT Broker to publish and subscribe to IoT events is a critical aspect of many IoT infrastructures. And hosting your own broker retains complete control in your hands. This writing provides step-by-step instructions for installing the Mosquitto MQTT broker on a VPS running Linux Ubuntu 16.04.<\/p>\n<p>Don&#8217;t have a personal Virtual Private Server (VPS)? Check <a href=\"http:\/\/wp.me\/p5NRQ8-sm\" target=\"_blank\">here <\/a>\u00a0to find out how to get one.<\/p>\n<h2 style=\"text-align: center;\"><strong>MQTT Broker Installation Overview<\/strong><\/h2>\n<p style=\"text-align: left;\">Installing the Mosquitto MQTT broker on your Linux Ubuntu VPS can be broken down into 3 basic steps. And if you wish to also provide secure connections, four additional steps are needed.<\/p>\n<ol>\n<li>Install Mosquitto<\/li>\n<li>Configuring MQTT Passwords<\/li>\n<li>Configuring MQTT Over Websockets<\/li>\n<li>Securing your MQTT Broker\n<ol>\n<li>Install Certbot<\/li>\n<li>Run Cerbot<\/li>\n<li>Setting up Certbot Automatic Renewals<\/li>\n<li>Configuring MQTT SSL<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2 style=\"text-align: center;\"><strong>Installing Mosquitto<\/strong><\/h2>\n<p>A \u00a0telnet client is needed to install and configure the MQTT broker on your VPS. PuTTY is a widely used telnet client. It can be downloaded <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/\" target=\"_blank\">here<\/a>. Make sure you have a telnet client installed and your non-root linux user credentials are handy before continuing.<\/p>\n<p>Then, log in with your non-root user with PuTTY and install Mosquitto with <code>apt-get by entering:<\/code><\/p>\n<p>sudo apt-get install mosquitto mosquitto-clients<\/p>\n<p>The MQTT broker service will start automatically after the installation has completed. To test, open a second command-line interface (CLI) using PuTTY. With one of the terminal windows, subscribe to a test topic named &#8220;mymqtttesttopic&#8221; by entering:<\/p>\n<p>mosquitto_sub -h localhost -t mymqtttesttopic<\/p>\n<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1786\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe.jpg\" alt=\"\" width=\"582\" height=\"130\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe.jpg 582w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe-300x67.jpg 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/a><\/p>\n<p>Then, publish a message from the other terminal:<\/p>\n<p>mosquitto_pub -h localhost -t mymqtttesttopic -m &#8220;Sent from my own MQTT Broker&#8221;<\/p>\n<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_publish.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1787\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_publish.jpg\" alt=\"\" width=\"823\" height=\"113\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_publish.jpg 823w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_publish-300x41.jpg 300w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_publish-768x105.jpg 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/a><\/p>\n<p>If the installation is properly working, the subscribe terminal will receive the message:<\/p>\n<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe_rx.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1788\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe_rx.jpg\" alt=\"\" width=\"582\" height=\"130\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe_rx.jpg 582w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/01\/mqtt_subscribe_rx-300x67.jpg 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/a><\/p>\n<h2 style=\"text-align: center;\"><strong>Configuring MQTT Passwords<\/strong><\/h2>\n<p>First level of security is to configure Mosquitto to use passwords. Mosquitto includes a utility to generate a special password file called <code>mosquitto_passwd<\/code>. Using this\u00a0utility, you will be\u00a0prompted to enter a password for the specified username, and place the results in <code>\/etc\/mosquitto\/passwd<\/code>. From the terminal, enter:<\/p>\n<p>sudo mosquitto_passwd -c \/etc\/mosquitto\/passwd test<span class=\"highlight\">user<\/span><\/p>\n<p><strong>Note<\/strong>: <em>Use &#8220;password&#8221; for the password for this test case when prompted<\/em><\/p>\n<p>Now we&#8217;ll open up a new configuration file for Mosquitto and tell it to use this password file to require logins for all connections:<\/p>\n<p>sudo nano \/etc\/mosquitto\/conf.d\/default.conf<\/p>\n<p>This should open an empty file. Paste in the following:<\/p>\n<div class=\"code-label \" title=\"\/etc\/mosquitto\/conf.d\/default.conf\">\/etc\/mosquitto\/conf.d\/default.conf<\/div>\n<pre class=\"code-pre \"><code>allow_anonymous false\r\npassword_file \/etc\/mosquitto\/passwd\r\n<\/code><\/pre>\n<p><code>allow_anonymous false<\/code> will disable all non-authenticated connections, and the <code>password_file<\/code> line tells Mosquitto where to look for user and password information. Save and exit the file.<\/p>\n<p>Now we need to restart Mosquitto and test our changes:<\/p>\n<p>sudo systemctl restart mosquitto<\/p>\n<p>Try to publish a message without a password:<\/p>\n<p>mosquitto_pub -h localhost -t &#8220;test&#8221; -m &#8220;hello world&#8221;<\/p>\n<p>The message should be rejected:<\/p>\n<div class=\"secondary-code-label \" title=\"Output\">Output<\/div>\n<pre class=\"code-pre \"><code>Connection Refused: not authorized.\r\nError: The connection was refused.\r\n<\/code><\/pre>\n<p>Before we try again with the password, switch to your second terminal window again, and subscribe to the &#8216;test&#8217; topic, using the username and password this time:<\/p>\n<p>mosquitto_sub -h localhost -t test -u &#8220;<span class=\"highlight\">testuser<\/span>&#8221; -P &#8220;<span class=\"highlight\">password<\/span>&#8221;<\/p>\n<p>It should connect and sit, waiting for messages. You can leave this terminal open and connected for the rest of the tutorial, as we&#8217;ll periodically send it test messages.<\/p>\n<p>Now publish a message with your other terminal, again using the username and password:<\/p>\n<p>mosquitto_pub -h localhost -t &#8220;test&#8221; -m &#8220;hello world&#8221; -u &#8220;<span class=\"highlight\">testuser<\/span>&#8221; -P &#8220;<span class=\"highlight\">password<\/span>&#8221;<\/p>\n<p>The message should be passed from one terminal to the other in the same way as the initial test without passwords. If the message was received, we have successfully added password protection to our Mosquitto MQTT Broker.<\/p>\n<h2 style=\"text-align: center;\"><strong>Passwords for multiple users<\/strong><\/h2>\n<p>Most likely, your MQTT broker will need to support more than one user. Here is how to create a password file for multiple users:<\/p>\n<p style=\"text-align: left;\"><strong>First create a plain text file<\/strong>, adding a line for each user: &lt;username&gt;:&lt;password&gt;<\/p>\n<p style=\"text-align: left;\">sudo nano \/etc\/mosquitto\/passwd<\/p>\n<p style=\"text-align: left;\">For 3 users, the file contents:<\/p>\n<p style=\"text-align: left;\">username1:password1<br \/>\nusername2:password2<br \/>\nusername3:password3<\/p>\n<p style=\"text-align: left;\"><strong>Then encrypt the plain text file<\/strong>\u00a0by entering:<\/p>\n<p style=\"text-align: left;\">sudo mosquitto_passwd -U \/etc\/mosquitto\/passwd<\/p>\n<h2 style=\"text-align: center;\"><strong>Configuring MQTT Over Websockets<\/strong><\/h2>\n<p>You will probably want to have your MQTT Broker support Websockets. This makes it possible to communicate with your MQTT broker using JavaScript. Very useful for web applications. Here is how to add it to your Mosquitto configuration.<\/p>\n<p>Open the configuration file to add port listeners:<\/p>\n<p>sudo nano \/etc\/mosquitto\/conf.d\/default.conf<\/p>\n<p>Add to the bottom of the file:<\/p>\n<p>listener 1883 localhost<\/p>\n<p>listener 8883<\/p>\n<p>listener 8083<br \/>\nprotocol websockets<\/p>\n<p>listener 18083<br \/>\nprotocol websockets<\/p>\n<p>Then update the firewall to support these listener ports.<\/p>\n<p>sudo ufw allow 8883<br \/>\nsudo ufw allow 8083<br \/>\nsudo ufw allow 18083<\/p>\n<p>Restart Mosquitto to activate the listener configuration:<\/p>\n<p>sudo systemctl restart mosquitto<\/p>\n<p>Here is the MQTT port allocation:<\/p>\n<p>[wptg_comparison_table id=&#8221;21&#8243;]<\/p>\n<p>Note that the last listener on port 18083 is not a standard MQTT port. This port is used for insecure (non-encrypted connections). While it is not required, it can sometimes be useful when communicating with tiny IoT devices that cannot support the additional overhead required to connect using the SSL protocol.<\/p>\n<h2 style=\"text-align: center;\"><strong>Testing MQTT Websockets<\/strong><\/h2>\n<p>The easiest method of verifying the Websockets ports is to use a web browser MQTT client. While there are many such tools available, HiveMQ will be used for this demonstration.<\/p>\n<p>First, open an incognito web browser window to\u00a0<a href=\"http:\/\/www.hivemq.com\/demos\/websocket-client\/\" target=\"_blank\">this link.<\/a><\/p>\n<p><strong>Note:<\/strong><em> You must use an <strong>incognito<\/strong> window. A normal browser window sends extra information to track your browsing history. This extra http traffic will interfere with the MQTT websocket protocol and cause the connection to fail.<\/em><\/p>\n<p>And\u00a0create a new connection:<\/p>\n<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1808\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client-1.jpg\" alt=\"\" width=\"961\" height=\"473\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client-1.jpg 961w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client-1-300x148.jpg 300w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client-1-768x378.jpg 768w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/p>\n<p>Once the connection is made, publish a test message:<\/p>\n<p><a href=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client2-3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1811\" src=\"http:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client2-3.jpg\" alt=\"\" width=\"958\" height=\"482\" srcset=\"https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client2-3.jpg 958w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client2-3-300x151.jpg 300w, https:\/\/internetofhomethings.com\/homethings\/wp-content\/uploads\/2017\/04\/mqtt_client2-3-768x386.jpg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/a><\/p>\n<h2 style=\"text-align: center;\"><strong>Securing your MQTT\u00a0Broker<\/strong><\/h2>\n<p>There are four steps required to securing the MQTT Broker with SSL\/TLS.<\/p>\n<p><strong>Step 1: Install Certbot<\/strong><\/p>\n<p>We must first install the official client from an Ubuntu PPA, or <em>Personal Package Archive<\/em>. These are alternative repositories that package more recent or more obscure software. First, add the repository from the VPS terminal.<\/p>\n<p><strong>sudo add-apt-repository ppa:certbot\/certbot<\/strong><\/p>\n<p>Note: If this command is not found, the following package needs to be installed first:<\/p>\n<p><strong><code>sudo apt-get install software-properties-common<\/code><\/strong><\/p>\n<p>You&#8217;ll need to press <code>ENTER<\/code> to accept. Afterwards, update the package list to pick up the new repository&#8217;s package information.<\/p>\n<p><strong>sudo apt-get update <\/strong><\/p>\n<p>And finally, install the official Let&#8217;s Encrypt client, called <code>certbot<\/code>.<\/p>\n<p><strong>sudo apt-get install certbot <\/strong><\/p>\n<p>Now that we have <code>certbot<\/code> installed, let&#8217;s run it to get our certificate.<\/p>\n<p><strong>Step 2: Run Certbot<\/strong><\/p>\n<p><code>The Certbot<\/code>\u00a0that was just installed needs to answer a cryptographic challenge issued by the Let&#8217;s Encrypt API in order to prove we control our domain. It uses ports <code>80<\/code> (HTTP) and\/or <code>443<\/code> (HTTPS) to accomplish this. We&#8217;ll only use port <code>80<\/code>, so let&#8217;s allow incoming traffic on that port now:<\/p>\n<p><strong>sudo ufw allow http<\/strong><\/p>\n<div class=\"secondary-code-label \" title=\"Output\">Output<\/div>\n<pre class=\"code-pre \"><code>Rule added\r\n<\/code><\/pre>\n<p>We can now run Certbot to get our certificate. We&#8217;ll use the <code>--standalone<\/code> option to tell Certbot to handle the HTTP challenge request on its own, and <code>--standalone-supported-challenges http-01<\/code> limits the communication to port <code>80<\/code>. <code>-d<\/code> is used to specify the domain you&#8217;d like a certificate for, and <code>certonly<\/code> tells Certbot to just retrieve the certificate without doing any other configuration steps.<\/p>\n<p><strong>sudo certbot certonly &#8211;standalone &#8211;standalone-supported-challenges http-01 -d <span class=\"highlight\">mqtt.example.com<\/span><\/strong><\/p>\n<p>When running the command, you will be prompted to enter an email address and agree to the terms of service. After doing so, you should see a message telling you the process was successful and where your certificates are stored.<\/p>\n<p>We&#8217;ve got our certificates. Now we need to make sure Certbot renews them automatically when they&#8217;re about to expire.<\/p>\n<p><strong>Step 3: Setting up Cerbot Automatic Renewals<\/strong><\/p>\n<p>Let&#8217;s Encrypt&#8217;s certificates are only valid for ninety days. This is to encourage users to automate their certificate renewal process. We&#8217;ll need to set up a regularly run command to check for expiring certificates and renew them automatically.<\/p>\n<p>To run the renewal check daily, we will use <code>cron<\/code>, a standard system service for running periodic jobs. We tell <code>cron<\/code> what to do by opening and editing a file called a <code>crontab<\/code>.<\/p>\n<p><strong>sudo crontab -e <\/strong><\/p>\n<p>You&#8217;ll be prompted to select a text editor. Choose your favorite, and you&#8217;ll be presented with the default <code>crontab<\/code> which has some help text in it. Paste in the following line at the end of the file, then save and close it.<\/p>\n<div class=\"code-label \" title=\"crontab\">crontab<\/div>\n<pre class=\"code-pre \"><code>. . .\r\n15 3 * * * certbot renew --noninteractive --post-hook \"systemctl restart mosquitto\"\r\n<\/code><\/pre>\n<p>The <code>15 3 * * *<\/code> part of this line means &#8220;run the following command at 3:15 am, every day&#8221;. The <code>renew<\/code>command for Certbot will check all certificates installed on the system and update any that are set to expire in less than thirty days. <code>--noninteractive<\/code> tells Certbot not to wait for user input.<\/p>\n<p><code>--post-hook \"systemctl restart mosquitto\"<\/code> will restart Mosquitto to pick up the new certificate, but only if the certificate was renewed. This <code>post-hook<\/code> feature is what older versions of the Let&#8217;s Encrypt client lacked, and why we installed from a PPA instead of the default Ubuntu repository. Without it, we&#8217;d have to restart Mosquitto every day, even if no certificates were actually updated. Though your MQTT clients should be configured to reconnect automatically, it&#8217;s wise to avoid interrupting them daily for no good reason.<\/p>\n<p>Now that automatic certificate renewal is all set, we&#8217;ll get back to configuring Mosquitto to be more secure.<\/p>\n<p><strong>Step 4. Configuring MQTT SSL<\/strong><\/p>\n<p>To enable SSL encryption, we need to tell Mosquitto where our Let&#8217;s Encrypt certificates are stored. Open up the configuration file we previously started:<\/p>\n<p>sudo nano \/etc\/mosquitto\/conf.d\/default.conf<\/p>\n<p>Replace the file content with the following:<\/p>\n<pre class=\"easycode; title:;lang:;\">allow_anonymous false\r\npassword_file \/etc\/mosquitto\/passwd\r\n\r\nlistener  1883 localhost\r\n\r\nlistener 8883\r\ncertfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/cert.pem\r\ncafile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/chain.pem\r\nkeyfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/privkey.pem\r\n\r\nlistener 8083\r\nprotocol websockets\r\ncertfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/cert.pem\r\ncafile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/chain.pem\r\nkeyfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/privkey.pem\r\n\r\nlistener 18083\r\nprotocol websockets<\/pre>\n<div class=\"code-label \" title=\"\/etc\/mosquitto\/conf.d\/default.conf\"><\/div>\n<div class=\"code-label \" title=\"\/etc\/mosquitto\/conf.d\/default.conf\">This file is the same as the last version, except the SSL certificates have been added to the SSL and websocket ports:<\/div>\n<div class=\"code-label \" title=\"\/etc\/mosquitto\/conf.d\/default.conf\">\n<pre class=\"easycode; title:;lang:;\">certfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/cert.pem\r\ncafile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/chain.pem\r\nkeyfile \/etc\/letsencrypt\/live\/&lt;yourVPSdomainname&gt;\/privkey.pem<\/pre>\n<\/div>\n<p><code>listener 8883<\/code> sets up an encrypted listener on port <code>8883<\/code>. This is the standard port for MQTT + SSL, often referred to as MQTTS. The next three lines, <code>certfile<\/code>, <code>cafile<\/code>, and <code>keyfile<\/code>, all point Mosquitto to the appropriate Let&#8217;s Encrypt files to set up the encrypted connections.<\/p>\n<p>Save and exit the file, then restart Mosquitto to update the settings:<\/p>\n<p><strong>sudo systemctl restart mosquitto <\/strong><\/p>\n<p>Now we test again using <code>mosquitto_pub<\/code>, with a few different options for SSL:<\/p>\n<p>mosquitto_pub -h <span class=\"highlight\">&lt;your VPS domainname&gt;<\/span>\u00a0-t test -m &#8220;hello again&#8221; -p 8883 &#8211;capath \/etc\/ssl\/certs\/ -u &#8220;<span class=\"highlight\">user1<\/span>&#8221; -P &#8220;<span class=\"highlight\">password<\/span>&#8221;<\/p>\n<p>Note that we&#8217;re using the full hostname instead of <code>localhost<\/code>. Because our SSL certificate is issued for <code><span class=\"highlight\">&lt;yourVPSdomainname&gt;<\/span><\/code>, if we attempt a secure connection to <code>localhost<\/code> we&#8217;ll get an error saying the hostname does not match the certificate hostname (even though they both point to the same Mosquitto server).<\/p>\n<p><code>--capath \/etc\/ssl\/certs\/<\/code> enables SSL for <code>mosquitto_pub<\/code>, and tells it where to look for root certificates. These are typically installed by your operating system, so the path is different for Mac OS, Windows, etc. <code>mosquitto_pub<\/code> uses the root certificate to verify that the Mosquitto server&#8217;s certificate was properly signed by the Let&#8217;s Encrypt certificate authority. It&#8217;s important to note that <code>mosquitto_pub<\/code> and <code>mosquitto_sub<\/code> will not attempt an SSL connection without this option (or the similar <code>--cafile<\/code> option), even if you&#8217;re connecting to the standard secure port of <code>8883<\/code>.<\/p>\n<p>If all goes well with the test, we&#8217;ll see <strong>hello again<\/strong> show up in the other <code>mosquitto_sub<\/code> terminal.<\/p>\n<p>You can also run additional tests using the HiveMQ MQTT client again to verify the websocket port 8083, which is now configured securely. This time, make sure the &#8220;SSL&#8221; checkbox is selected when making a connection.<\/p>\n<p>Once this final test has been performed successfully, your MQTT broker is fully set up!<\/p>\n<h2 style=\"text-align: center;\"><strong>In Closing<\/strong><\/h2>\n<p>With your own secure MQTT broker running on a VPS, you have a powerful platform at your disposal. Using a reliable provider, you no longer need to keep any hardware running 24-7, no longer vulnerable to power interruptions or computer crashes. And there are no constraints on your custom configuration options. That is all taken care of by the VPS provider.<\/p>\n<p>I hope you find this information useful<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using an MQTT Broker to publish and subscribe to IoT events is a critical aspect of many IoT infrastructures. And hosting your own broker retains complete control in your hands. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,19,111],"tags":[88,153],"class_list":["post-1756","post","type-post","status-publish","format-standard","hentry","category-alltheposts","category-internet-of-things","category-mqtt","tag-mqtt","tag-vps-mqtt-installation"],"_links":{"self":[{"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/posts\/1756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1756"}],"version-history":[{"count":27,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/posts\/1756\/revisions"}],"predecessor-version":[{"id":1824,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=\/wp\/v2\/posts\/1756\/revisions\/1824"}],"wp:attachment":[{"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/internetofhomethings.com\/homethings\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}