Grafana

The Open Platform for Beautiful Analytics and Monitoring

What is Grafana?

Grafana is the leading open-source platform for monitoring and observability. It allows you to query, visualize, alert on, and understand your metrics no matter where they’re stored – from Prometheus to InfluxDB, MySQL to Elasticsearch, and dozens of other data sources.

Transform your raw data into stunning, interactive dashboards that tell the story of your infrastructure, applications, and services. Whether you’re monitoring server performance, tracking application metrics, or analyzing business data, Grafana provides the tools to make sense of it all.

Used by thousands of companies worldwide – from startups to Fortune 500 enterprises – Grafana has become the de facto standard for visualization and monitoring in modern cloud-native environments.

Why Choose Grafana?

System Requirements

Minimum Requirements

  • CPU: 1 core (multi-core recommended)
  • RAM: 255 MB minimum (512MB+ recommended)
  • Storage: 1 GB for installation
  • Database: SQLite (built-in) or MySQL/PostgreSQL
  • Browser: Chrome, Firefox, Safari, Edge (latest)
  • Network: Port 3000 (default)

Recommended for Production

  • CPU: 4+ cores for better query performance
  • RAM: 4-8 GB (scales with data sources)
  • Storage: SSD storage, 10GB+ for dashboards/plugins
  • Database: PostgreSQL or MySQL for HA setups
  • Network: Reverse proxy with SSL/TLS
  • Monitoring: Dedicated data source servers

Installation Guide

Deploy Grafana with Docker and start visualizing your data in minutes.

1. Create Directory Structure

Create directories to persist Grafana data:

mkdir -p ~/grafana/{data,config,plugins}
cd ~/grafana

2. Simple Docker Deployment

Quick start with Docker (SQLite backend):

docker run -d 
  --name=grafana 
  -p 3000:3000 
  -v ./data:/var/lib/grafana 
  -e "GF_SECURITY_ADMIN_PASSWORD=admin" 
  --restart unless-stopped 
  grafana/grafana:latest

3. Production Setup with Docker Compose

Create docker-compose.yml for a full monitoring stack with Prometheus:

version: '3'

services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - ./data:/var/lib/grafana
      - ./config:/etc/grafana
      - ./plugins:/var/lib/grafana/plugins
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=your_secure_password
      - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
      - GF_SERVER_ROOT_URL=https://grafana.yourdomain.com
      - GF_SMTP_ENABLED=true
      - GF_SMTP_HOST=smtp.gmail.com:587
      - [email protected]
      - GF_SMTP_PASSWORD=your-app-password
      - [email protected]
    networks:
      - monitoring

  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus/config:/etc/prometheus
      - ./prometheus/data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    networks:
      - monitoring

  node-exporter:
    image: prom/node-exporter:latest
    container_name: node-exporter
    restart: unless-stopped
    ports:
      - "9100:9100"
    command:
      - '--path.procfs=/host/proc'
      - '--path.sysfs=/host/sys'
      - '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    networks:
      - monitoring

networks:
  monitoring:
    driver: bridge

4. Create Prometheus Configuration

Create prometheus/config/prometheus.yml:

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node-exporter:9100']

  - job_name: 'grafana'
    static_configs:
      - targets: ['grafana:3000']

5. Start the Stack

Launch Grafana and Prometheus together:

docker-compose up -d

6. Initial Login and Setup

Access Grafana at http://your-server-ip:3000:

  • Default username: admin
  • Default password: admin (or your custom password)
  • You’ll be prompted to change the password on first login
  • Complete the welcome wizard to get started

7. Add Prometheus Data Source

Configure Prometheus as a data source:

  1. Go to Configuration → Data Sources
  2. Click “Add data source”
  3. Select “Prometheus”
  4. Set URL to: http://prometheus:9090
  5. Click “Save & Test”

Quick Reference

Default Port: 3000

Default Credentials:
admin / admin

Security: Change admin password immediately!

Tip: Import pre-built dashboards from grafana.com/dashboards

Prometheus UI:
http://your-ip:9090

Data Sources & Integration

Time Series Databases

  • Prometheus
  • InfluxDB
  • Graphite
  • OpenTSDB
  • TimescaleDB

Relational Databases

  • MySQL / MariaDB
  • PostgreSQL
  • Microsoft SQL Server
  • SQLite
  • Oracle

Cloud & Services

  • AWS CloudWatch
  • Azure Monitor
  • Google Cloud Monitoring
  • Datadog
  • New Relic

Logging & Tracing

  • Loki (Grafana Logs)
  • Elasticsearch
  • Jaeger (tracing)
  • Tempo (tracing)
  • Zipkin

IoT & Custom

  • MQTT
  • JSON API
  • CSV
  • Custom plugins
  • Webhooks

Application Metrics

  • Prometheus exporters
  • Telegraf
  • StatsD
  • Collectd
  • Application Insights

Creating Your First Dashboard

Import Pre-Built Dashboards

The fastest way to get started is importing community dashboards:

  1. Visit grafana.com/dashboards
  2. Search for dashboards (e.g., “Node Exporter Full”)
  3. Copy the dashboard ID (e.g., 1860)
  4. In Grafana: Dashboards → Import
  5. Enter the ID and click “Load”
  6. Select your Prometheus data source
  7. Click “Import”

Popular Dashboards

  • 1860: Node Exporter Full (system metrics)
  • 3662: Prometheus 2.0 Stats
  • 7362: Docker and System Monitoring
  • 11074: Node Exporter for Prometheus
  • 6126: Kubernetes Cluster Monitoring

Build Custom Dashboard

Create a dashboard from scratch:

  1. Click “+ ” → Create Dashboard
  2. Click “Add new panel”
  3. Select your data source (Prometheus)
  4. Write a query (e.g., node_cpu_seconds_total)
  5. Choose visualization type (Graph, Gauge, Table, etc.)
  6. Customize colors, thresholds, and labels
  7. Click “Apply” to save the panel
  8. Add more panels and organize layout
  9. Save dashboard with Ctrl+S

Panel Types

  • Time series: Line graphs for trends
  • Gauge: Single value with thresholds
  • Stat: Big number display
  • Bar chart: Categorical comparison
  • Heatmap: Density visualization
  • Table: Structured data view

Alerting & Notifications

Setting Up Alerts

Create alerts to monitor critical metrics:

  1. Go to Alerting → Alert rules
  2. Click “New alert rule”
  3. Define query and threshold conditions
  4. Set evaluation interval (e.g., every 1m)
  5. Configure “for” duration (alert after X time)
  6. Add labels and annotations
  7. Create or select notification policy
  8. Save the alert rule

Example Alert: High CPU

Query:
avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100 < 20

Condition:
When value is BELOW 20 for 5 minutes

Action:
Send notification to Slack channel

Notification Channels

Configure where alerts are sent (Alerting → Contact points):

  • Email: Send to email addresses
  • Slack: Post to Slack channels
  • PagerDuty: Create incidents
  • Discord: Webhook notifications
  • Teams: Microsoft Teams messages
  • Webhook: Custom HTTP endpoints
  • Telegram: Bot messages
  • OpsGenie: Alert management

Slack Integration Example

  1. Create Slack webhook URL in Slack
  2. In Grafana: Alerting → Contact points
  3. Add new contact point
  4. Select "Slack"
  5. Paste webhook URL
  6. Test and save

Advanced Features

Variables & Templating

Create dynamic dashboards with variables:

  • Filter by server, region, or environment
  • Dropdown menus for easy switching
  • Multi-value selection support
  • Query-based variable population
  • Use in panel queries: $variable_name

Annotations

Mark important events on graphs:

  • Deployments and releases
  • System maintenance windows
  • Incidents and outages
  • Query-based or manual annotations

Playlists

Rotate through dashboards automatically for NOC displays.

User Management & Permissions

  • Create users and teams
  • Role-based access control (Viewer, Editor, Admin)
  • Organization support for multi-tenancy
  • LDAP/Active Directory integration
  • OAuth authentication (Google, GitHub, etc.)

API & Automation

  • REST API for dashboard management
  • Programmatic dashboard creation
  • Automated snapshot generation
  • Terraform provider for IaC

Reporting

Generate and schedule PDF reports of dashboards for stakeholders.

Maintenance & Troubleshooting

Regular Maintenance

Update Grafana to the latest version:

docker-compose pull
docker-compose down
docker-compose up -d

Backup Grafana data:

tar -czf grafana-backup-$(date +%Y%m%d).tar.gz ./data

Clean up old data:

docker exec -it grafana grafana-cli admin data-migration clean-annotations

Common Issues

Data source connection failed:

Verify network connectivity. For Docker, ensure containers are on the same network. Check firewall rules.

Slow dashboard loading:

Optimize queries, reduce time range, use query caching, or increase Grafana resources.

Alerts not firing:

Check evaluation interval, verify data source is reachable, review alert rule conditions.

Plugins won't install:

Ensure plugin directory is writable. Use GF_INSTALL_PLUGINS environment variable or install manually.

Start Visualizing Your Data Today

Deploy Grafana and transform raw metrics into actionable insights with beautiful dashboards.

View All Self-Hosted Services Official Grafana Documentation Browse Dashboards

Grafana is open-source software maintained by Grafana Labs. Visit grafana.com for documentation and community resources.