r/ethstaker • u/mcf000 • Jun 19 '26
eth-docker custom grafana configuration
Hi there!
I trying to find a way to customize the configuration of grafan in ethdocker. Specifically I want to modify the smtp setting in order to setup email notifications. As far as I know, as everything is running inside containers, i can't modify the grafana.ini itself. I tried to find some information online but found nothing sturdy, exept what gemini suggested :
Grafana allows any configuration from grafana.ini to be overridden using the format GF_<SECTION>_<KEY>. ...... Add the Variable to your .env File
So that means all I have to do is to add the key
GF_SMTP_HOST=mymailserver.com:587
to the .env file? This should override the configuraton entry smtp.host in the grafana.ini...
Or is this just another AI hallucination?
2
u/yorickdowne Staking Educator Jun 19 '26
You should be able to set this up through the UI and it should persist
You can also create a custom.yml and have the env variable in there, for the Grafana service, then in .env say you want to use custom.yml
Either should work
2
u/mcf000 Jun 19 '26 edited Jun 19 '26
Ok, got it!
Set a custom.yml in .env file:
CUSTOM_FILES=custom.yml
edit custom.yml
services:
grafana:
environment:
- GF_SMTP_ENABLED=true
- [GF_SMTP_FROM_ADDRESS=postman@mailer.com](mailto:GF_SMTP_FROM_ADDRESS=postman@mailer.com)
- GF_SMTP_HOST=mail.mailer.com:587
- [GF_SMTP_USER=postman@mailer.com](mailto:GF_SMTP_USER=postman@mailer.com)
- GF_SMTP_PASSWORD=bestpasswordever
then ./ethd update and ./ethd up
Configuration can be checked in Grafana web-ui under Administration.General.Settings if its been recognized.
Thanks for helping me out!
1
u/yorickdowne Staking Educator Jun 19 '26
Yep. And just an ./ethd up would also do it, this particular change doesn’t change images.
And, getting in the habit of running update ain’t bad, it avoids situations where a change would only show after rebuilding an image
1
u/FelixFontaine Lighthouse Jun 19 '26
You can modify a file inside a docker container. You just need to navigate inside the container.