Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] cmccambridge - mosquitto-unraid

Featured Replies

eclipse-mosquitto.png

 

Application: mosquitto-unraid

Overview: Container for eclipse-mosquitto with Unraid ease-of-use tweaks

Docker: https://quay.io/repository/cmccambridge/mosquitto-unraid 

Application GitHub: https://github.com/cmccambridge/mosquitto-unraid 

 

This container is a minimal port of the official Eclipse Mosquitto Docker container with minor tweaks to work more conveniently in Unraid.

 

Breaking Change Announcement (2021-01-20): Starting with Version 2.0.0, this container requires manual configuration to run! See more details below: 

 

 

For details on how to configure the container, please see the README on GitHub! You can configure:

  • Persistent Data
  • Logging
  • Authentication
  • TLS
  • Websockets

 

Questions?

Post any other questions or issues relating to this Docker container on Unraid in this thread, or by opening an issue on GitHub.

Edited by cmccambridge
2.0.0 Breaking change

  • Author

@jonp or @trurl could you move this over to the Docker Containers support thread section?

 

@Squid Anything extra I need to do on the CA side for a second template in my existing repository?

 

Thanks all for all of your help!

1 hour ago, cmccambridge said:

@Squid Anything extra I need to do on the CA side for a second template in my existing repository?

 

no

  • 9 months later...

Stupid question @cmccambridge....

 

The community apps version of the container is 1.5.8... But I see the current version on your github is 1.6.x.

 

EDIT: Never mind. It looks like when it installed originally the repository was listed as "cmccambridge/mosquitto-unraid:1.5.8". I changed it to "cmccambridge/mosquitto-unraid:latest" and all is good.

Edited by JasonJoel

  • Author

Ugh, great catch. Thanks for letting me know @JasonJoel!

 

This bug has been there since I migrated from quay.io in April 2019 and I never noticed, because I made the same edit locally that you've just done...

 

Good news is your fix is exactly correct. I've committed the same to the template repository, so other new installs and folks accidentally pinned at 1.5.8 should receive the update soon as well. Fixed with this PR.

Edited by cmccambridge
link PR

Awesome, and thanks. I use this container for a bazillion things, and very much appreciate you maintaining it!

  • 1 year later...
  • Author

Hello all,

 

BREAKING CHANGE ANNOUNCEMENT!

If you have never customized your Mosquitto container, you MUST take action after the next container update!

 

Starting with Mosquitto 2.0.0, the Eclipse project requires explicit configuration to enable listening on non-loopback network interfaces and to allow anonymous (unauthenticated) connections to the MQTT server. This change was made by the Eclipse project to harden their security posture, and is documented in the 2.0.0 release announcement and the official Eclipse migration guide.

 

The unRAID container is taking this breaking change as well, though I'm trying to make it as painless as possible... Three options for you to consider, in order of increasing difficulty:

  1. Set the RUN_INSECURE_MQTT_SERVER variable to return to the old default/insecure 1.x settings: A MQTT server on port 1883 that allows anonymous connections. If you have never customized Mosquitto configuration files, this will be your easiest option!
    1. In Docker Manager, click "Check for Updates" and wait for it to complete.
    2. Edit your Mosquitto-unraid container configuration
    3. You should see a new variable field, "Run Insecure MQTT Server". Change the value from 0 to 1.
    4. Save your changes.
    5. If available, run the Mosquitto container update.
  2. Edit the mosquitto-unraid-default.conf file in the configuration directory. If you would like more hands-on customization of this new security posture, give this a try.
    1. Run the Mosquitto container update.
    2. You will find a generated file mosquitto-unraid-default.conf in your "Config" path, e.g. /mnt/user/appdata/mosquitto/mosquitto-unraid-default.conf
    3. Read the file, select an option to enable, and save your changes.
    4. Restart the Mosquitto container.
  3. Configure the Mosquitto container to your liking (or update your existing configuration), including at least one listener. For advanced users.
    1. Refer to the mosquitto-unraid documentation or the official Mosquitto configuration docs.
    2. Restart the Mosquitto container after making your changes.

Let me know if you have any questions, and apologies for the disruption!

 

I debated a long time about whether I could somehow work around this breaking change, and in the end concluded that I cannot... without knowing how you may have customized Mosquitto, any automatic change I might attempt could be even more disruptive than this change, so I have erred on the side of caution in propagating the breaking change. Hopefully the pre-generated configuration options in mosquitto-unraid-default.conf or the override RUN_INSECURE_MQTT_SERVER option will provide you a quick way to resume previous functionality!

  • 1 year later...

hi i have trouble understanding all this stuff..  and i try to run nano  in the console terminal for the mosquitto    but doesnt work

 

i want  to do is send  home assistant a command to turn on a switch.. but want to run from a user script

i have

"test"   as the topic

"turn_on"   as a message to turn on

"turn_off"  as a message to turn off

 

i hjave no idea what i doing...  i tried to read the documenations..    is there any docs for a noob 

so i can run like

 

"mosquitto test/turn_on"    something like that .

  • 4 months later...

Hi, I have installed this container and seem to be getting some errors in the Log.  what can this be?

 

1659882243: Error: Permission denied.
1659884044: Error: Permission denied.
1659885845: Error: Permission denied.
1659887646: Error: Permission denied.
1659889447: Error: Permission denied.
1659891248: Error: Permission denied.
1659893049: Error: Permission denied.
1659894850: Error: Permission denied.
1659896651: Error: Permission denied.
1659898452: Error: Permission denied.
1659900253: Error: Permission denied.
1659902054: Error: Permission denied.
1659903855: Error: Permission denied.
1659905656: Error: Permission denied.
1659907457: Error: Permission denied.
1659909258: Error: Permission denied.
1659911059: Error: Permission denied.
1659912860: Error: Permission denied.
1659914661: Error: Permission denied.
1659916462: Error: Permission denied.
1659918263: Error: Permission denied.
1659920064: Error: Permission denied.
1659921865: Error: Permission denied.
1659923666: Error: Permission denied.
1659925467: Error: Permission denied.
1659927268: Error: Permission denied.
1659929069: Error: Permission denied.
1659930870: Error: Permission denied.
1659932671: Error: Permission denied.
1659934472: Error: Permission denied.
1659936273: Error: Permission denied.
1659938074: Error: Permission denied.
1659939875: Error: Permission denied.
1659941676: Error: Permission denied.
1659943477: Error: Permission denied.
1659945278: Error: Permission denied.
1659947079: Error: Permission denied.
1659948880: Error: Permission denied.
1659950681: Error: Permission denied.
1659952482: Error: Permission denied.
1659954283: Error: Permission denied.
1659956084: Error: Permission denied.
1659957885: Error: Permission denied.
1659959686: Error: Permission denied.
1659961487: Error: Permission denied.
1659963288: Error: Permission denied.
1659965089: Error: Permission denied.
1659966890: Error: Permission denied.
1659968691: Error: Permission denied.
1659970492: Error: Permission denied.
1659972293: Error: Permission denied.
1659974094: Error: Permission denied.
1659975895: Error: Permission denied.
1659977696: Error: Permission denied.
1659979497: Error: Permission denied.
1659981298: Error: Permission denied.
1659983099: Error: Permission denied.
1659984900: Error: Permission denied.
1659986701: Error: Permission denied.
1659988502: Error: Permission denied.
1659990303: Error: Permission denied.
1659992104: Error: Permission denied.
1659993905: Error: Permission denied.
1659995706: Error: Permission denied.
1659997507: Error: Permission denied.
1659999308: Error: Permission denied.
1660001109: Error: Permission denied.
1660002910: Error: Permission denied.
1660004711: Error: Permission denied.
1660006512: Error: Permission denied.
1660008313: Error: Permission denied.
1660010114: Error: Permission denied.
1660011915: Error: Permission denied.
1660013716: Error: Permission denied.
1660015517: Error: Permission denied.
1660017318: Error: Permission denied.
1660019119: Error: Permission denied.
1660020920: Error: Permission denied.
1660022721: Error: Permission denied.
1660024522: Error: Permission denied.
1660026323: Error: Permission denied.
1660028124: Error: Permission denied.
1660029925: Error: Permission denied.
1660031726: Error: Permission denied.
1660033527: Error: Permission denied.
1660035328: Error: Permission denied.
1660037129: Error: Permission denied.
1660038930: Error: Permission denied.
1660040731: Error: Permission denied.
1660042532: Error: Permission denied.

  • 2 years later...

sorry if my question is stupid but am trying to install the container and can't follow the steps.

 

i would like to run it with option 2 since 1 seems the least secure and 3 is not for me since i'm fairly new with unraid docker etc.

 

My Problem with option 2 is that the container i followed the steps and edit my mosquitto-unraid-default.conf file in the lines 28-30 and deleted the # so it looks like this:

 

listener 1883
protocol mqtt
password_file /mosquitto/config/passwd

 

now i start the container and it stops again. The logs show:

 

1726144166: Loading config file /mosquitto/config/mosquitto-unraid-default.conf
1726144166: mosquitto version 2.0.18 starting
1726144166: Config loaded from /mosquitto-unraid/include_dir.conf.
1726144166: Error: Unable to open pwfile "/mosquitto/config/passwd".
1726144166: Error opening password file "/mosquitto/config/passwd".
!! ATTENTION: MANUAL CONFIGURATION IS REQUIRED !!

Due to security hardening in Mosquitto 2.0, you MUST TAKE MANUAL ACTION to
reenable MQTT in this container!

OPTION 1: Set RUN_INSECURE_MQTT_SERVER to 1 in this container's settings

OPTION 2: Edit the file "mosquitto-unraid-default.conf" in your configuration
path for more details (Usually /mnt/user/appdata/mosquitto)

OPTION 3: Update your customized Mosquitto configuration to configure at
least one listener. See https://mosquitto.org/documentation/migrating-to-2-0/

 

https://github.com/cmccambridge/mosquitto-unraid#authentication

tells me to run (i assume in the unraid console since the container wont even start)

docker exec -it mosquitto touch /mosquitto/config/passwd

 

but the console shows me

Error response from daemon: Container b5dfb6360ea02ebf58e744cc1c166ff04e2e0496f46bb4cb778e0c2a4506698f is not running

if i do. which makes sense since the container is not running but it autostops every time i tell it to start.

 

any ideas whats wrong? i did not change anything else. screenshot of the containersetup is attached.

 

 

 

mosquitto settings 1.png

Edited by Icarium

  • 3 months later...

Hello Icarium,

 

I just have the same issue as you and it is related to location, permission and owner of password file generated.

 

Here what I have done to correct :

  1. Launch this docker with anonymous permission (Run Insecure MQTT Server = 0)
  2. Create a new password file from docker console with command mosquitto_passwd -c passwd MQTT_User
  3. Copy this passwd file to your persistent data directory cp passwd /mosquitto/data/
  4. Stop the docker
  5. Go in your Unraid file manager and set permission Read-only to "Other" at least on this file
  6. Change in your docker settings Run Insecure MQTT Server to 2
  7. Edit config file mosquitto-unraid-default.conf  and uncomment the following last line:
    1. listener 1883
    2. protocol mqtt
    3. password_file /mosquitto/data/passwd (change with the location of you password file from your persistent directory)
  8. Start your docker and go in your docker console to change permission and owner of your password file with :
    1. chown mosquitto: mosquitto/data/passwd
    2. chmod 700 mosquitto/data/passwd

    3. Check with ls -l mosquitto/data/passwd

Hope it helps you and other people to save some time in search not like me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.