๐ 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
๐ Links
| ย | ย |
|---|---|
| ๐ฆ 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
- Open the MOS Hub and search for InfluxDB
- Set a secure
DOCKER_INFLUXDB_INIT_PASSWORD(minimum 8 characters) - Optionally set
DOCKER_INFLUXDB_INIT_ADMIN_TOKENor leave empty to auto-generate - Click Install
- Access the Web UI at
http://YOUR_SERVER_IP:8086 - Login with your admin credentials
- 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_PASSWORDmust 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.