Refer to https://github.com/sukesh-ak/setup-mosquitto-with-docker for more details Must create mosquitto.conf file manually Create password file touch config/pwfile From mqtt container terminal issue the following command and you will be prompted for a password mosquitto_passwd -c /mosquitto/config/pwfile mqtt-user