If you like what you see..... buy me a coffee!
[ Ссылка ]
This video is a tutorial on how to install mosquitto mqtt broker in docker!
Here are a few links to get you started....
[ Ссылка ]
[ Ссылка ]
(0:00) Intro
(1:56) Start by creating local volume on the docker host..
mkdir mosquitto
(2:33) Now we are ready to install mosquitto in a docker container.
sudo vi docker-compose.yaml
mqtt:
container_name: mqtt
image: eclipse-mosquitto
restart: always
volumes:
- /home/adrian/mosquitto/config: /mosquitto/config
- /home/adrian/mosquitto/data: /mosquitto/data
- /home/adrian/mosquitto/log: /mosquitto/log
ports:
- 1883:1883
- 9001:9001
Onces thats done, save the file and...
sudo docker-compose up -d
Now we are ready to get the config file from eclipse-mosquitto repo...
sudo git clone [ Ссылка ] eclipse-mosquitto
cd eclipse-mosquitto
sudo mv mosquitto.conf ../mosquitto/config
Once all that is done, jump over to portainer and reboot the mqtt container.
(6:22) Now we are ready to create a username and password for mosquitto.
sudo docker exec -it mqtt sh
mosquitto_passwd -c /mosquitto/config/pwfile hass
(7:36) Lastly, we need to edit mosquitto.conf
sudo vi mosquitto.conf
password_file /mosquitto/config/pwfile
Save it and then jump over to restart the mqtt container for the changes to take.
Thats pretty much it.
If you like the video, please subscribe to my channel. If you have any questions or comments, hit me up in the comments below. As always, if there are any videos out there you would like to see, let me know in the comments as well and I will see what i can do.
Mosquitto Broker in Docker !!!
Теги
mosquittomqttbrokersmart homehome automationdockerbhaburns home automationmosquitto mqtteclipse mosquittomosquitto dockermqtt broker dockermqtt brokermosquitto mqtt configurationeclipse mosquitto githubeclipse mosquitto dockereclipse mosquitto configeclipse mosquitto tutorialeclipse mosquitto docker username passwordeclipse mosquitto clientmosquitto docker passwordmosquitto docker containermosquitto docker setup