Skip to content

Install Mosquitto MQTT Brocker

Volodymyr Huz edited this page Nov 25, 2019 · 1 revision

Install and configure Mosquitto MQTT brocker.

Update packages list

sudo apt-get update

Install Mosquitto

sudo apt-get install mosquitto

Enable Mosquitto to run on startup

sudo systemctl enable mosquitto

When you have firewall installed use following command to open port

sudo ufw allow 1883/tcp

Create Mosquitto user, I used mqttusr name for the user

sudo mosquitto_passwd -c /etc/mosquitto/passwd mqttusr

Disable anonymous access

sudo nano /etc/mosquitto/mosquitto.conf

allow_anonymous false
password_file /etc/mosquitto/passwd

Restart Mosquitto to use last configuration changes

sudo systemctl restart mosquitto

Use MQTT.fx to subscribe and publish something into a topic for testing and debuging

Clone this wiki locally