One-click Droplet for Mosquitto, InfluxDB, Telegraf & Grafana
Eclipse Mosquitto - An open source MQTT broker to collect your data via MQTT protocol
InfluxDB - The Time Series Data Platform to store your data in time series database
Telegraf - The open source server agent to connect Mosquitto and InfluxDB together
Grafana - The open observability platform to draw some graphs and more
Based on: https://github.com/Miceuz/docker-compose-mosquitto-influxdb-telegraf-grafana
- A DigitalOcean account - Sign up here
- doctl CLI - Installation guide
Instead of manually deploying a new Droplet, you can run scripts/install.sh
on an existing DigitalOcean Droplet to set up the environment. This script automates the installation process.
- Update package lists and upgrade all packages
apt-get update && apt-get upgrade
- Download and install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
- Install docker-compose and git
apt-get update && apt-get install -y docker-compose git
- Run the installation script for this project
curl -sSL https://github.com/DO-Solutions/iot-docker/raw/master/scripts/install.sh | bash
To deploy a new Droplet with the necessary software installed:
- Clone this repo:
git clone https://github.com/DO-Solutions/iot-docker
- Enter the directory:
cd iot-docker
- Deploy the Droplet using the following command:
doctl compute droplet create iot-droplet \
--size s-2vcpu-4gb --image ubuntu-23-10-x64 \
--region lon1 --enable-backups \
--user-data-file cloudinit.yml
- To check on your deployment SSH into your Droplet and run
tail -f /var/log/cloud-init-output.log
- To check the running services run
cd /iot-docker && docker ps
- To shutdown the whole thing
cd /iot-docker && docker-compose down
- Post messages into Mosquitto to see data in Grafana:
sudo docker container exec mosquitto mosquitto_pub -t 'paper_wifi/test/' -m '{"humidity":21, "temperature":21, "battery_voltage_mv":3000}'
- Access Grafana at
http://<your-server-ip>:3000
. Username:admin
, Password:/iot-docker/grafanapassword.txt
. - Explore InfluxDB at
http://<your-server-ip>:8086
. Credentials indocker-compose.yml
.
Open in your browser:
http://<your-server-ip>:3000
Username is admin
Password can be found in /iot-docker/grafanapassword.txt
You should see a graph of the data you have entered with the mosquitto_pub
command.
You can poke around your InfluxDB setup here: http://<your-server-ip>:8086
Username and password are found in docker-compose.yml
- Allows anonymous connections.
- Configured to listen on port 1883.
listener 1883
allow_anonymous true
- Configuration details are available in
docker-compose.yml
.
- Set up to pipe MQTT messages to InfluxDB.
- Listens for topic
paper_wifi/test
. - Configuration can be modified as per the official documentation.
- Comes with a default data source pointing to InfluxDB.
- Configuration:
grafana-provisioning/datasources/automatic.yml
. - Default dashboard setup in
grafana-provisioning/dashboards
.
Jack Pearce, Solutions Engineer - [email protected]