๐Ÿ“ˆ InfluxDB

InfluxDB is an open-source time series database designed to handle high write and query loads. It is the perfect choice for storing metrics, events, and real-time analytics data from your applications and infrastructure.

It is commonly used with Grafana for visualization, Telegraf for data collection, and various monitoring tools.

๐Ÿท๏ธ Category: Database

๐Ÿณ Image: influxdb:latest


ย  ย 
๐Ÿ“ฆ Project github.com/influxdata/influxdb
๐Ÿ› Support GitHub Issues
๐Ÿ“– Docs docs.influxdata.com
๐Ÿ’› InfluxData www.influxdata.com

๐ŸŒ Ports

Port Protocol Description
8086 TCP InfluxDB HTTP API and Web Interface

๐Ÿ’พ Volumes

Host Path Container Path Mode Description
/mnt/cache/appdata/influxdb /var/lib/influxdb2 RW Persistent storage for InfluxDB data, configuration, and WAL files

โš™๏ธ Environment Variables

๐Ÿ”‘ Setup & Admin

Variable Default Masked Description
DOCKER_INFLUXDB_INIT_MODE setup โŒ Initialization mode: โ€˜setupโ€™ for first-time, โ€˜upgradeโ€™ for existing DB
DOCKER_INFLUXDB_INIT_USERNAME admin โŒ Admin account username
DOCKER_INFLUXDB_INIT_PASSWORD `` โœ… Admin password (min 8 chars, required for first start)
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN `` โœ… API token for admin operations (auto-generated if empty)

๐Ÿ—„๏ธ Organization & Bucket

Variable Default Masked Description
DOCKER_INFLUXDB_INIT_ORG mos โŒ Default organization name
DOCKER_INFLUXDB_INIT_BUCKET data โŒ Default bucket for time-series data
DOCKER_INFLUXDB_INIT_RETENTION 0 โŒ Retention period in hours (0 = infinite)

๐Ÿ‘ค Permissions

Variable Default Masked Description
PUID 500 โŒ User ID for file permissions
PGID 500 โŒ Group ID for file permissions
TZ Europe/Vienna โŒ Timezone for the container

๐Ÿš€ Quick Start

  1. Open the MOS Hub and search for InfluxDB
  2. Set a secure DOCKER_INFLUXDB_INIT_PASSWORD (minimum 8 characters)
  3. Optionally set DOCKER_INFLUXDB_INIT_ADMIN_TOKEN or leave empty to auto-generate
  4. Click Install
  5. Access the Web UI at http://YOUR_SERVER_IP:8086
  6. Login with your admin credentials
  7. Start writing data via the API or configure data sources like Telegraf

๐Ÿ”— Connection Information

API Endpoint:

http://YOUR_SERVER_IP:8086

InfluxDB URL for Grafana:

http://YOUR_SERVER_IP:8086

Organization: mos (or your custom value) Bucket: data (or your custom value) Token: Use the admin token from setup


๐Ÿ“ Writing Data Examples

Using curl:

curl -i -XPOST 'http://YOUR_SERVER_IP:8086/api/v2/write?org=mos&bucket=data' \
  --header 'Authorization: Token YOUR_TOKEN' \
  --data-raw 'cpu,host=server1 usage=45.2'

Line Protocol Format:

measurement,tag=value field=value timestamp

Example:

temperature,sensor=living_room value=22.5 1704067200000000000

๐Ÿ”Œ Data Collection Tools

Tool Purpose Integration
Telegraf System metrics collection Native InfluxDB output
Prometheus Metrics scraping Remote write to InfluxDB
Grafana Visualization Native InfluxDB v2 data source

๐Ÿ“Š Common Use Cases

Use Case Description
Server Monitoring CPU, memory, disk, network metrics
Application Metrics Response times, error rates, throughput
IoT Data Sensor readings, device telemetry
Financial Data Stock prices, trading metrics
Event Tracking User actions, system events

๐Ÿ”’ Security Notes

  • Always set a strong password for the admin account
  • Save your admin token securely - it cannot be recovered if lost
  • Use bucket-specific tokens for applications instead of admin token
  • Enable HTTPS for production deployments (use reverse proxy)

โš ๏ธ Important: The DOCKER_INFLUXDB_INIT_PASSWORD must be at least 8 characters long. The container will fail to start with a shorter password.

๐Ÿ’ก Tip: Use Telegraf with the InfluxDB output plugin to automatically collect system metrics from your MOS server.

๐Ÿ’ก Tip: Pair InfluxDB with Grafana for beautiful dashboards and alerting on your metrics.

๐Ÿ“š For more information: Visit the InfluxDB documentation for query language (Flux), API reference, and best practices.


MOS Templates โ€“ maintained by J000K3R

This site uses Just the Docs, a documentation theme for Jekyll.