Raspberry Pi Grafana: Complete Installation, Setup, and Dashboard Guide
Aug 21,2025

What is Grafana?
Raspberry Pi Grafana is an open-source analytics and visualization solution widely used for monitoring systems, infrastructures, and IoT devices.It transforms raw data into interactive, meaningful dashboards. Originally designed for time-series data, Grafana supports a wide variety of use cases, including real-time monitoring, historical data analysis, and custom metric tracking.
Grafana works by connecting to different types of data sources, such as InfluxDB, Prometheus, MQTT (via bridge tools), or even simple CSV files, and displays that data in visually engaging dashboards that can be shared and customized.
Key Features
✔ Dashboards:
Grafana's core strength lies in its dashboards. Users can create dynamic panels, graphs, tables, and charts that update in real time or show trends over time. Dashboards are fully customizable and can include variables, time filters, and multiple panels on a single screen, which makes Grafana data visualization Raspberry Pi both flexible and powerful.
✔ Alerts
Grafana supports powerful alerting capabilities. Users can set thresholds and conditions, and when those are met, Grafana can send notifications via email, Slack, Telegram, Discord, or other channels. This is essential in IoT environments where system or sensor failures must be addressed immediately.
✔ Multiple Data Sources
Grafana can connect to:
• Time-series databases: InfluxDB or Prometheus
• SQL databases: MySQL and PostgreSQL
• Cloud services: AWS CloudWatch or Google BigQuery
• IoT data streams: MQTT, Node-RED, or Telegraf bridges—check our Raspberry Pi MQTT Broker Guide for step-by-step instructions.
Why Use Grafana on a Raspberry Pi?
Running Grafana on a Raspberry Pi is a popular choice for edge computing and local monitoring scenarios—see our Raspberry Pi Network Monitor Guide for more details.The Raspberry Pi offers a compact, affordable, and energy-efficient platform for hosting lightweight visualization tools.
√ Low Cost: Ideal for prototyping or budget-constrained environments.
√ Portability: Easily deployed in remote locations, smart homes, or field operations.
√ Local Processing: Keeps sensitive data within the local network.
√ Integration: Works well with other edge services like InfluxDB, Mosquitto (MQTT), and Node-RED already running on the same Pi.
System Requirements
Hardware
• To install Grafana on Raspberry Pi 4/5, it’s recommended to use a board with at least 2 GB RAM (4 GB or more preferred).
• MicroSD card (16 GB minimum) or SSD for better performance and endurance
• Stable power supply (official Raspberry Pi adapter or equivalent)
• Optional: Heatsink or fan if running continuously under load
Software
• Operating System: Raspberry Pi OS (32-bit or 64-bit)—learn more in our Raspberry Pi Ubuntu Setup guide.
Installing Grafana on Raspberry Pi
For a smooth Grafana Raspberry Pi installation, make sure your system is updated. Run the following commands(see the Raspberry Pi Documentation for additional update tips):
1. Make sure your system is updated. Run the following commands:
sudo apt update && sudo apt upgrade -y
2. Then, install the necessary transport package:
sudo apt install -y apt-transport-https software-properties-common wget
3. Now add the Grafana APT repository:
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
4. Update your package list again and install Grafana:
sudo apt update
sudo apt install grafana(see the Grafana Installation Guide for detailed instructions)

5. Once installed, enable and start the service:
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
By default, Grafana runs on port 3000. Access it through your browser:
http://<raspberrypi_ip>:3000

Login (admin / admin) and change the password when prompted.

Setting Up Data Sources
InfluxDB: The Preferred Time-Series Database
InfluxDB is a lightweight, high-performance database specifically designed for storing sensor and metric data, and it pairs perfectly with Grafana InfluxDB Raspberry Pi setups for IoT monitoring. It integrates well with Raspberry Pi and is frequently paired with Grafana in IoT applications.
Installing InfluxDB2 on Raspberry Pi
1. First, add the InfluxDB repository. Run the following:
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian bullseye stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update
2. Then install InfluxDB:
sudo apt install -y influxdb2(refer to the InfluxDB Documentation for more guidance)
3. Enable and start the service:
sudo systemctl enable influxdb
sudo systemctl start influxdb
To verify it's working:
Open in your browser:
http://<raspberrypi_ip>:8086

You'll be prompted to:
• Create a user
• Set up an organization and bucket
• Get your API token

Connect InfluxDB 2.x to Grafana
1. Get Your InfluxDB Access Token
Log in to the InfluxDB Web UI at: http://<raspberrypi_ip>:8086
Then:
1. Go to Data > Tokens
2. Click on the token tied to your organization/bucket (or create a new one)

3. Copy the read/write token — you’ll use this in Grafana when building a Grafana InfluxDB 2 Raspberry Pi connection.
2. Open Grafana
Navigate to: http://<raspberrypi_ip>:3000
1. Go to Gear Icon > Data Sources
2. Click “Add data source”
3. Select InfluxDB

3. Configure InfluxDB 2.x in Grafana
In the configuration page:
Basic Settings
• Name: InfluxDB
• Query Language: Flux (for InfluxDB 2.x)
HTTP
• URL: http://localhost:8086 (or use your Pi's IP if running remotely)
Auth
• Do NOT enable basic auth
• Scroll to InfluxDB Details
InfluxDB Details
• Organization: Your InfluxDB organization name (case-sensitive)
• Token: Paste the API token you copied earlier
• Default Bucket: The name of your bucket (e.g., sensors)

Click Save & Test.

Creating a Dashboard: Monitoring Raspberry Pi CPU usage.
Step-by-Step: Telegraf + InfluxDB 2.x (via UI)
1. Navigate to “Data” > “Telegraf”
• Click the "Local Data" tab on the left menu
• Go to "Telegraf"
• Click “+ Create Configuration”

2. Choose a Telegraf Input Plugin
Select “System” from the list (or search “system” in the plugin search bar) and
Choose the Destination Bucket

3. Generate and Download the Config
InfluxDB will generate a custom telegraf.conf. Click “Download Config”
This file is ready to use with your Raspberry Pi.

4. Install Telegraf
sudo apt install -y telegraf
5. Replace the Telegraf Config with the One You Downloaded
Move the config to the correct path:
sudo mv /path/to/your/telegraf.conf /etc/telegraf/telegraf.conf
6. Start Telegraf
sudo systemctl enable telegraf
sudo systemctl start telegraf

7. Confirm Data Is Flowing
In the InfluxDB UI:
• Go to "Data Explorer"
• Select your bucket
• You should now see measurements like:
o Cpu mem system disk net

Step-by-Step: Create Grafana Dashboard Using Telegraf Data
1. Open Grafana
To complete the Grafana dashboard setup Raspberry Pi, open Grafana. In the sidebar, click 'Create' > 'Dashboard' and then click ‘Add new panel'.In the sidebar, click "Create" > "Dashboard" and then click “Add new panel”
Flux query:
from(bucket: "bkt_sunfounder")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system")
|> filter(fn: (r) => r.cpu == "cpu-total")
Panel settings:
• Visualization: Time series and Gauges
• Unit: Percent (0–100%)

Backup & Maintenance
Exporting Dashboards and Settings
Grafana provides a simple way to export dashboards manually, which is especially useful for migrating to another device or keeping a versioned backup.
To export a dashboard:
1. Open the dashboard in Grafana.
2. Click the gear icon in the top-right corner.
3. Select “JSON model”.
4. Click “Export” and save the file to your local machine.
You can import this JSON later by:
• Navigating to "Dashboards" > "Import"
• Uploading the file or pasting the JSON code
This ensures that your layout, queries, and panel configurations are preserved.
Backing Up Grafana Configuration and Data
If you want a complete backup beyond just dashboards — especially for long-term deployments — you'll need to back up the entire Grafana environment, including:
1. Grafana Configuration Files
Located at:
/etc/grafana/
These files contain system settings, server ports, and authentication options.
To back them up:
sudo cp -r /etc/grafana /home/pi/backups/grafana_conf/
2. Grafana SQLite Database (Default Storage)
If you're using the default SQLite database, your dashboards and users are stored here:
/var/lib/grafana/grafana.db
Back it up like this:
sudo cp /var/lib/grafana/grafana.db /home/pi/backups/
For users running Grafana with MySQL or PostgreSQL, export the corresponding database as per standard procedures.
3. Grafana Plugins and Custom Files
If you've installed plugins:
/var/lib/grafana/plugins/
Back them up too, especially if you’re replicating to another system.
Troubleshooting Common Issues
Here are a few typical problems and how to solve them:
✘ Grafana not starting after reboot
Check service status: sudo systemctl status grafana-server
If inactive or failed, try: sudo systemctl restart grafana-server
✘ Data source not loading
Make sure the InfluxDB service is running.
Verify that your token, bucket, and organization values in the data source settings are correct.
✘ Dashboard panels show “No data”
Confirm that Telegraf is sending data.
sudo systemctl status telegraf
Use Data Explorer in InfluxDB to validate whether data is arriving in the bucket.
✘ Grafana UI is slow
Avoid overloading dashboards with high-refresh intervals.
Reduce panel count or increase dashboard refresh time (e.g., from 5s to 30s).
Conclusion
Setting up Raspberry Pi Grafana is a cost-effective and powerful way to monitor systems, visualize IoT data, and gain real-time insights — all from a compact, energy-efficient device. By pairing Grafana with tools like InfluxDB, Telegraf, and MQTT, you can create dynamic dashboards that transform raw sensor readings into actionable information. Whether you’re tracking environmental conditions, monitoring server performance, or managing smart home projects, This combination offers flexibility, scalability, and full control over your data, making it ideal for Grafana monitoring Raspberry Pi projects.With proper maintenance, backups, and security measures, your Raspberry Pi Grafana setup can serve as a reliable, long-term visualization solution for personal or professional use.