Grafana container setup
Introduction
Using Grafana, you can craft stunning dashboards. For instance, I leverage it to visualize data from Home Assistant sensors. In my setup, I’ve configured data sources for both MariaDB and InfluxDB.
Setup
- 
Create the folders needed by the container
Run the following commands inside your home folder:
# Open your terminal applicationcd ~mkdir -p grafana/datacd grafana - 
Create the script needed to run the container
Save the following script as
grafana_run.sh:grafana_run.sh # To create this script use your text editor application, for example NanoIDu=$(id -u $(logname)) # Saves the logged in user id in the IDu variabledocker run -d \--user $IDu \--name=grafana \--hostname=grafana \-p 3000:3000 \-v $PWD/data:/var/lib/grafana \-e GF_ANALYTICS_REPORTING_ENABLED=false \-e GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,grafana-googlesheets-datasource \-e TZ=Europe/Amsterdam \--restart unless-stopped \grafana/grafana# IMPORTANT: Please read the instructions belowInstructions:
- Optional  Replace 
dockerwithpodmanif needed - Required  Replace port number 
3000(on the left side of:) with a port number that is available if needed. - Optional  Replace 
$PWD/datawith the location of your data if needed. This can be a fileserver mount - Optional  Remove 
-e GF_ANALYTICS_REPORTING_ENABLED=falseif you want to enable analytics - Optional  Change 
-e GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,grafana-googlesheets-datasourceto add or remove plugins you want to install - Required  Replace 
Europe/Amsterdamwith your own timezone 
 - Optional  Replace 
 - 
Run the script to create the container
Run the following command:
# Open your terminal applicationsudo sh grafana_run.shThe image
grafana/grafanais automatically pulled and the container is created. - 
Check the results
If needed you can check if the container is running properly.
Now you can log into Grafana with username
adminand passwordadminby opening a web browser and going to:http://localhost:3000. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.The next steps would be:
- Change the password
 - Configure your data sources
 
 
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.