How to Install Mosquitto On Ubuntu

Step 1. Run following command on ec2 instance:-

sudo apt-get install mosquito

sudo apt-get update
 sudo apt-get install pkg-config cmake openssl libc-ares-dev libssl-dev python-mosquitto

sudo apt-get install gcc make g++ libssl-dev


tar xzf mosquitto-1.4.7.tar.gz

cd mosquitto-1.4.7

cmake .
 sudo make install

sudo mkdir /etc/mosquitto

sudo mv /usr/local/etc/mosquitto/mosquitto.conf /etc/mosquitto/mosquitto.conf

Step 2. Run following commands create service mosquitto:-

sudo nano /etc/init/mosquitto.conf

Add following lines to file:-

start on net-device-up
 exec /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Step 3. Add user to mosquitto:-

cd /usr/local/bin

sudo mosquitto_passwd -c /etc/mosquitto/passwd password



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s