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

wget http://mosquitto.org/files/source/mosquitto-1.4.7.tar.gz

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
 respawn
 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

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s