Install MQTT Broker on Ubuntu 18.04 & 14.04

Mr.aegkaluk sopapun
Aug 7, 2018 · 1 min read

Open port TCP:1883 on firewall

Install Mosquitto Broker

sudo apt-get update
sudo apt-get install mosquitto

Install the Clients and Test

sudo apt-get install mosquitto-clients

Secure with a Password

sudo mosquitto_passwd -c /etc/mosquitto/passwd mqtt_user_name
Password: mqtt_password

Create a configuration file for Mosquitto pointing to the password file we have just created.

sudo nano /etc/mosquitto/conf.d/default.conf

allow_anonymous false
password_file /etc/mosquitto/passwd

sudo systemctl restart mosquitto

Ref :

ส่วน Ubuntu 14.04 จะมีวิธีติดตั้งดังนี้ครับ

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto

เราก็จะได้ mqtt broker ไว้ใช้งานแล้วล่ะครับ

Mr.aegkaluk sopapun

Written by

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade