# Reset Grafana password when running in Docker on Raspberry Pi

**URL:** <https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070>\
**Category:** Installation\
**Tags:** docker\
**Created:** [April 25, 2018, 6:20pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070 "2018-04-25T18:20:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbs](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jbs](https://community.grafana.com/u/jbs)\
**Post date:** [April 25, 2018, 6:20pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/1 "2018-04-25T18:20:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lgram](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/lgram/32/2599_2.png) [@lgram](https://community.grafana.com/u/lgram)\
**Post date:** [April 26, 2018, 8:30am UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/2 "2018-04-26T08:30:55Z")

</div>

Hi,

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](http://docs.grafana.org/administration/cli/#reset-admin-password).

Example:

```bash
# 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>

```

---

<div class="post-metadata">

**Author:** ![jbs](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jbs](https://community.grafana.com/u/jbs)\
**Post date:** [April 27, 2018, 12:46pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/3 "2018-04-27T12:46:44Z")

</div>

Thanks. Was using an old v3 version so I am not able to use the grafana-cli. Just removed v3 en started over again with v4.

---

<div class="post-metadata">

**Author:** ![lgram](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/lgram/32/2599_2.png) [@lgram](https://community.grafana.com/u/lgram)\
**Post date:** [May 1, 2018, 2:54pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/4 "2018-05-01T14:54:20Z")

</div>

Did you try upgrading to v4 with the same database? That should work and allow you to change the password using the cli. Also, I’d recommend upgrading to v5 while you’re at it 🙂

---

<div class="post-metadata">

**Author:** ![jbs](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jbs](https://community.grafana.com/u/jbs)\
**Post date:** [May 1, 2018, 6:07pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/5 "2018-05-01T18:07:53Z")

</div>

No, did not perform an upgrade, installed a new docker image ([https://hub.docker.com/r/fg2it/grafana-armhf/](https://hub.docker.com/r/fg2it/grafana-armhf/)) and removed the old one. I’m quite new with docker, is it possible to upgrade with the same database? Even from 4 to 5?

---

<div class="post-metadata">

**Author:** ![lgram](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/lgram/32/2599_2.png) [@lgram](https://community.grafana.com/u/lgram)\
**Post date:** [May 2, 2018, 7:28am UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/6 "2018-05-02T07:28:00Z")

</div>

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](http://docs.grafana.org/installation/docker/) and you should also look up the offical docker documentation to read up on volumes and host binds.

---

<div class="post-metadata">

**Author:** ![jbs](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jbs](https://community.grafana.com/u/jbs)\
**Post date:** [May 2, 2018, 6:37pm UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/7 "2018-05-02T18:37:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lgram](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/lgram/32/2599_2.png) [@lgram](https://community.grafana.com/u/lgram)\
**Post date:** [May 3, 2018, 7:48am UTC](https://community.grafana.com/t/reset-grafana-password-when-running-in-docker-on-raspberry-pi/7070/8 "2018-05-03T07:48:06Z")

</div>

There will be an official container eventually, but in the meantime I would suggest using the docker images supplied by our community member fg2it [https://github.com/fg2it/grafana-on-raspberry](https://github.com/fg2it/grafana-on-raspberry)
