Installing MQTT

By David
First published 13th May 2024

In order to install MQTT on mu linux server machine I took the following steps:

  1. sudo apt update
  2. sudo apt install mosquitto-clients
  3. sudo apt install mosquitto
  4. sudo systemctl status mosquitto to check if mosquitto has been installed
  5. sudo systemctl enable mosquitto to get mosuitto started on system start
  6. sudo mosquitto_passwd -c /etc/mosquitto/passwd david to set a userid and password for authentication to mosquitto (NOT the password to the linux account)
  7. sudo nano /etc/mosquitto/conf.d/default.conf and set the contents to:
    allow_anonymous false
    password_file /etc/mosquitto/passwd
  8. sudo systemctl restart mosquitto