Mosquitto setup
How to successfully install and set up *Eclipse Mosquitto*.
This guide describes how to install Mosquitto on Debian (x64, oldstable/stable/testing) and configure it to use the PureLife Cloud.
Mosquitto can also be used on other platforms and these instructions should be transferable, however we do not provide support for this.
Installation
The Mosquitto version in the Debian package sources is outdated. It is therefore recommended to use the package source of the Mosquitto project and install a current Mosquitto version.
To do this, the key for signing the packages must first be added to apt
.
After that, the package sources can be added.
Now Mosquitto can be installed from the package sources
Mosquitto version 2.* should now be installed.
Extended authentication
For secure operation, Mosquitto’s authentication and authorization capabilities must be extended. This requires the installation of the Mosquitto Auth plugin. We provide this for various platforms and Mosquitto versions.
If a plugin is not available for your platform/version, you can contact us, and we will check if a deployment is possible. Please tell us the operating system (name, version), architecture and Mosquitto version of your production environment. Alternatively, you can create the plugin yourself.
The configuration should not be visible to other users
More information can be found in the documentation.
Limitation
The auth-plugin offers the possibility to integrate different authentication methods into Mosquitto. However, the plugin does not work simultaneously with other authentication methods. If other authentication methods are to be used, the parameter per_listener_settings true
must be set and the plugin must have its own mosquito listener.
More information can be found in the documentation.
Account für PureLife-Cloud anlegen
To speed up the initialization of the MQTT connection, it is recommended to create a user for the PureLife cloud in the password text file.
Configuration
Now Mosquitto can be configured. To do this, create a configuration file with a text editor.
And insert the following:
After adjusting the configuration, Mosquitto should restart.
For an encrypted connection via MQTTS, store the appropriate certificates and restart the server.