InfluxDB + Chronograf
InfluxDB time-series database with Chronograf admin UI.
Overview
InfluxDB is a purpose-built time-series database designed specifically for handling high-velocity, timestamped data from IoT sensors, application metrics, and monitoring systems. Originally developed by InfluxData in 2013, it addresses the unique challenges of time-series data through specialized storage engines, query optimization for temporal patterns, and built-in retention policies that automatically manage data lifecycle. Unlike traditional relational databases, InfluxDB excels at ingesting millions of data points per second while providing sub-second query performance for analytics and alerting.
This stack combines InfluxDB 2.7 with Chronograf to create a comprehensive time-series data platform. While InfluxDB 2.x includes a built-in UI, Chronograf provides advanced visualization capabilities, alerting rules, and administrative tools that complement InfluxDB's native interface. The configuration establishes automatic initialization with organization, bucket, and authentication setup, plus inter-service connectivity for data exploration and dashboard creation.
This combination is ideal for DevOps teams implementing observability solutions, IoT developers collecting sensor data, and organizations requiring real-time analytics on timestamped metrics. The stack provides both the high-performance data storage capabilities of InfluxDB and the intuitive visualization tools of Chronograf, making it accessible for both technical operators and business users who need to analyze time-series patterns.
Key Features
- High-performance time-series storage engine optimized for timestamped data ingestion and retrieval
- Flux query language with advanced time-series functions for complex temporal analytics
- Built-in data retention policies with automatic downsampling and expiration management
- Chronograf's drag-and-drop dashboard builder with time-series specific visualizations
- Real-time alerting system with customizable thresholds and notification channels
- Multi-tenant organization and bucket structure for data isolation and access control
- Native support for both push and pull data collection patterns
- Advanced time-series functions including aggregations, transformations, and predictive analytics
Common Use Cases
- 1IoT sensor networks collecting temperature, humidity, and environmental data from distributed devices
- 2Application performance monitoring with metrics collection from microservices architectures
- 3Financial data analysis for real-time trading metrics and market data aggregation
- 4Industrial equipment monitoring for predictive maintenance and operational efficiency
- 5Website analytics tracking user behavior patterns and performance metrics over time
- 6Energy management systems monitoring power consumption and grid performance data
- 7DevOps infrastructure monitoring collecting system metrics, logs, and performance indicators
Prerequisites
- Minimum 1GB RAM allocated to Docker (InfluxDB requires 256MB minimum, 1GB+ recommended for production)
- Available ports 8086 (InfluxDB) and 8888 (Chronograf) on the host system
- Basic understanding of time-series data concepts and Flux or InfluxQL query syntax
- Environment variables configured for INFLUX_USER, INFLUX_PASSWORD, INFLUX_ORG, INFLUX_BUCKET, and INFLUX_TOKEN
- Docker Compose version 3.8 or higher with volume and network support
- Understanding of InfluxDB's bucket and organization concepts for proper data modeling
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 influxdb: 3 image: influxdb:2.74 container_name: influxdb5 restart: unless-stopped6 environment: 7 DOCKER_INFLUXDB_INIT_MODE: setup8 DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}9 DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}10 DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}11 DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}12 DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUX_TOKEN}13 volumes: 14 - influxdb_data:/var/lib/influxdb215 - influxdb_config:/etc/influxdb216 ports: 17 - "8086:8086"18 networks: 19 - influx-network2021 chronograf: 22 image: chronograf:latest23 container_name: chronograf24 restart: unless-stopped25 environment: 26 INFLUXDB_URL: http://influxdb:808627 volumes: 28 - chronograf_data:/var/lib/chronograf29 ports: 30 - "8888:8888"31 depends_on: 32 - influxdb33 networks: 34 - influx-network3536volumes: 37 influxdb_data: 38 influxdb_config: 39 chronograf_data: 4041networks: 42 influx-network: 43 driver: bridge.env Template
.env
1INFLUX_USER=admin2INFLUX_PASSWORD=changeme1233INFLUX_ORG=myorg4INFLUX_BUCKET=mybucket5INFLUX_TOKEN=my-super-secret-tokenUsage Notes
- 1Docs: https://docs.influxdata.com/influxdb/v2/
- 2Access InfluxDB UI at http://localhost:8086 | Chronograf at http://localhost:8888
- 3Use INFLUX_TOKEN for API authentication in your applications
- 4Query with Flux or InfluxQL - Flux recommended for v2.x
- 5Retention policies control data lifecycle - configure per bucket
- 6Backup: influx backup /path/to/backup, restore with influx restore
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
influxdb
influxdb:
image: influxdb:2.7
container_name: influxdb
restart: unless-stopped
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUX_TOKEN}
volumes:
- influxdb_data:/var/lib/influxdb2
- influxdb_config:/etc/influxdb2
ports:
- "8086:8086"
networks:
- influx-network
chronograf
chronograf:
image: chronograf:latest
container_name: chronograf
restart: unless-stopped
environment:
INFLUXDB_URL: http://influxdb:8086
volumes:
- chronograf_data:/var/lib/chronograf
ports:
- "8888:8888"
depends_on:
- influxdb
networks:
- influx-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 influxdb:5 image: influxdb:2.76 container_name: influxdb7 restart: unless-stopped8 environment:9 DOCKER_INFLUXDB_INIT_MODE: setup10 DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}11 DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}12 DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}13 DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}14 DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUX_TOKEN}15 volumes:16 - influxdb_data:/var/lib/influxdb217 - influxdb_config:/etc/influxdb218 ports:19 - "8086:8086"20 networks:21 - influx-network2223 chronograf:24 image: chronograf:latest25 container_name: chronograf26 restart: unless-stopped27 environment:28 INFLUXDB_URL: http://influxdb:808629 volumes:30 - chronograf_data:/var/lib/chronograf31 ports:32 - "8888:8888"33 depends_on:34 - influxdb35 networks:36 - influx-network3738volumes:39 influxdb_data:40 influxdb_config:41 chronograf_data:4243networks:44 influx-network:45 driver: bridge46EOF4748# 2. Create the .env file49cat > .env << 'EOF'50INFLUX_USER=admin51INFLUX_PASSWORD=changeme12352INFLUX_ORG=myorg53INFLUX_BUCKET=mybucket54INFLUX_TOKEN=my-super-secret-token55EOF5657# 3. Start the services58docker compose up -d5960# 4. View logs61docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/influxdb-chronograf/run | bashTroubleshooting
- Connection refused on port 8086: Ensure InfluxDB container is fully started and DOCKER_INFLUXDB_INIT_MODE environment variables are properly set
- Chronograf shows 'Unable to connect to InfluxDB': Verify the INFLUXDB_URL environment variable points to http://influxdb:8086 and both containers are on the same network
- Authentication failures with INFLUX_TOKEN: Check that the token matches between InfluxDB initialization and client applications, and verify token has proper read/write permissions
- High memory usage during data ingestion: Configure appropriate retention policies and batch write sizes, monitor for inefficient Flux queries causing memory spikes
- Empty dashboards in Chronograf: Ensure data is being written to the correct bucket and organization, verify Chronograf is connected to the right InfluxDB instance
- Time zone issues in data visualization: Configure proper timezone settings in both InfluxDB and Chronograf, ensure client applications send UTC timestamps
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download