I am using Grafana in a Docker on a Raspberry Pi but I forgot my password. The ‘forgot password’ option doesn’t work because Grafana is not able to send emails.
Is there any change to reset my password? Otherwise, is it possible to change the SMTP settings in grafana.ini when using Docker?
You can use
grafana-cli
to change the admin password (in versions >4.1). To do this you need to run the command inside of the container using
docker exec ...
.
Docs on resetting your password:
http://docs.grafana.org/administration/cli/#reset-admin-password
.
Example:
# run docker ps and find out the id of your grafana container
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
46590b4704b6 grafana/grafana "/run.sh" About an hour ago Up About an hour 0.0.0.0:3000->3000/tcp reverent_mcclintock
# switch out the id below for the one you got for your container
docker exec -ti 46590b4704b6 grafana-cli admin reset-admin-password --homepath /usr/share/grafana <your new admin password>
Grafana has migrations scripts beween different versions so as long as you have the database left it will try to upgrade it. With docker you will have to configure some kind of persistent storage otherwise your data disappears when you remove the container. If you have the old container still you could copy the database out of it using docker cp <cointainer id>:/var/lib/grafana/database.db grafana.db. The easiest way to use it with a new container would be to use a host binding to map it into the container.
There’s some instructions regarding Grafana and docker here and you should also look up the offical docker documentation to read up on volumes and host binds.
Thanks. Looks like clear for me to do a migration from 4 to 5 and storing the database outside of docker.
I’m using Docker on a Raspberry Pi 3, the official docker image is not compatible with the RPI. Any advice which one to use for Grafana 5 on a RPI?