Eclipse-mosquitto on QNAP NAS

That is the easiest way to setup Mosquitto MQTT to work in the QNAP

  1. Create mosquitto config file in text editor with name: mosquitto.conf
    File content:
    "
    persistence true
    persistence_location /mosquitto/data
    listener 1883
    log_dest file /mosquitto/log/mosquitto.log
    log_timestamp_format %Y-%m-%dT%H:%M:%S
    allow_anonymous true
    "
  2. Create a share folder: YOURFOLDERNAME on NAS or use existing one, then create subfolder name: mosquitto
  3. Upload the previously prepared file:‘‘mosquitto.conf’’ to folder : mosquitto
  4. In Container Station application click on ‘‘Create’’ - Then search for “eclipse mosquitto” in the list of available images , selecting “Docker Hub” as the source.
  5. Go to Advanced Settings →
    Network - Network Mode - NAT
    Host ->1883 Container ->1883 Protocol ->TCP
    Shared Folders → Add
    Volume from host → choose folder with mosquitto.conf file: YOURFOLDERNAME/mosquitto
    Mount point : “/mosquitto/config”
  6. Click on Create

MQTT should work now

If you want to setup an user.

  1. Open Mosquittto → Terminal → type ‘‘sh’’ and Enter
    type: ''mosquitto_passwd -c /mosquitto/config/pwfile YOURUSERNAME ‘’ → hit Enter
    Type twice YOURPASSWORD
    Exit terminal

update file “mosquitto.conf”
‘’
persistence true
persistence_location /mosquitto/data
listener 1883
log_dest file /mosquitto/log/mosquitto.log
log_timestamp_format %Y-%m-%dT%H:%M:%S
allow_anonymous false
password_file /mosquitto/config/pwfile
‘’
Restart Mosquitto container
Well done!