Mosquitto Installation - bapowell/bapowell.github.io GitHub Wiki

References

https://mosquitto.org/download/

Debian buster

Add repository

Ref: https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/

$ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key

$ sudo apt-key add mosquitto-repo.gpg.key

$ cd /etc/apt/sources.list.d/

$ sudo wget http://repo.mosquitto.org/debian/mosquitto-buster.list

$ sudo apt update

Install

$ sudo apt install mosquitto

  • This also sets mosquitto up as a systemd service, and starts it:
    • Output from install:
      • Created symlink /etc/systemd/system/multi-user.target.wants/mosquitto.service → /lib/systemd/system/mosquitto.service.
    • ps -ef shows:
      • /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Service

  • Status/start/stop:

    • sudo systemctl status mosquitto.service
    • sudo systemctl start mosquitto.service
    • sudo systemctl stop mosquitto.service
  • Tail the log using either:

    • sudo journalctl -f -u mosquitto -o cat
    • sudo tail -f /var/log/mosquitto/mosquitto.log
  • To enable Mosquitto to run automatically at boot and upon crashes:

    • sudo systemctl enable mosquitto.service
  • To disable:

    • sudo systemctl disable mosquitto.service