InfluxDB2 + Grafana Docker Container Installation with Ubuntu
This article explains how to install an InfluxDB and Grafana monitoring setup using Docker. This setup is ideal for live monitoring of your IT infrastructure.
Installation Docker
We use Ubuntu 22.04 (LTS) with Docker as the base. The latest installation instructions can always be found in the Docker Docs. Here are the commands for installing Docker on Ubuntu in brief:
# Add Docker GPG Key sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add APT repository to the system echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update
After that, Docker can be installed:
root@js-grafana-01:~# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
You can verify the installation with the following command:
root@js-grafana-01:~# sudo docker run hello-world
InfluxDB 2 Container
The Docker container for InfluxDB is started with the following command. Please adjust the parameters, especially username, password, first bucket name, and organization, to your infrastructure. **Note:** For testing purposes, we have changed the port to 8006. The default is 8086.
docker run -d -p 8006:8086 \ --name influxdb2 \ -v $PWD/data:/var/lib/influxdb2 \ -v $PWD/config:/etc/influxdb2 \ -e DOCKER_INFLUXDB_INIT_MODE=setup \ -e DOCKER_INFLUXDB_INIT_USERNAME=admin \ -e DOCKER_INFLUXDB_INIT_PASSWORD=relation \ -e DOCKER_INFLUXDB_INIT_ORG=Thomas-Krenn.AG \ -e DOCKER_INFLUXDB_INIT_BUCKET=proxmox-cl-bucket \ -e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=Relation123! \ influxdb:2.7.1
Using an HTTP call, you can now access the InfluxDB at `http://IP:8006` and log in with the credentials. If you want to make further changes later, you can use the Web UI to add additional organizations, buckets, or users.
Grafana Container
To visualize the data stored in InfluxDB, you also need to install Grafana. The following snippet is helpful for this:
root@js-grafana-01:~# docker run -d --name=grafana -p 8007:3000 grafana/grafana
- Note:** We use port 8007 for Grafana, while the default is 3000. Please adjust this for your environment. You can then access Grafana at http://IP:8007. The default login is `admin/admin`, and you will be prompted to change it upon first login.
Conclusion
This serves as the foundation for excellent real-time live monitoring of your IT infrastructure. In the article InfluxDB2 + Grafana Konfiguration eines Metric-Servers für Proxmox VE, you will learn how to populate InfluxDB with data from your Proxmox system and visualize it in Grafana.
|
Author: Jonas Sterr Jonas Sterr has been working for Thomas-Krenn for several years. Originally employed as a trainee in technical support and then in hosting (formerly Filoo), Mr. Sterr now mainly deals with the topics of storage (SDS / Huawei / Netapp), virtualization (VMware, Proxmox, HyperV) and network (switches, firewalls) in product management at Thomas-Krenn.AG in Freyung.
|

