Skip to content

Grafana installation

smilebasti edited this page Dec 7, 2025 · 10 revisions

Grafana is not required but it displays the nice dashboard with the data gathered and stored in InfluxDB.

A complete installation example is available with the docker-compose.yml file.

Installing Grafana

Docker Compose

services:
  grafana:
    image: grafana/grafana-oss
    restart: unless-stopped
    ports:
      - '3000:3000'
    volumes:
      - ./grafana-storage:/var/lib/grafana # after start: sudo chown 472:472 grafana-storage 

Set up Grafana for npmGrafStats

Create a new Data source

In settings create a new data source to connect to InfluxDB. Set the follwing:

  • a name (you can choose)
  • select Flux as query language
  • set url to your influxdb ip and port (don't forget http(s):// )
  • disable basic auth
  • set organization and default-bucket (to npmgrafstats or to what you created in InfluxDB) (the organization and bucket name is not hard-coded into the Dashboard anymore starting v2.3. see #14)
  • set token to a read API token created in InfluxDB GUI

Set up the Dashboard

Import or upload a Dashboard. You can do so from Grafana using the ID 18826WITH a Domain filter option (https://grafana.com/grafana/dashboards/18826) or ID 24518 for NO filter (https://grafana.com/grafana/dashboards/24518). But you can also upload it manually using the npmGrafStats Map Dashboard v*.json file. Select the beforehand created data source to be used.

Now you should see the Dashboard 🎉 It‘s sorted in rows with much more Information than needed. You open or hide these rows or delete them if not needed. And the last think: enjoy 😉

For original installation instructions of Grafana see: https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/

Clone this wiki locally