# Recover COUCHDB\_ADMIN\_PASSWORD

**URL:** <https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809>\
**Category:** Development\
**Created:** [March 31, 2022, 5:05pm UTC](https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809 "2022-03-31T17:05:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babacar\_Gueye](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/babacar_gueye/32/1276_2.png) [@Babacar\_Gueye](https://forum.communityhealthtoolkit.org/u/Babacar_Gueye)\
**Post date:** [March 31, 2022, 5:05pm UTC](https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809/1 "2022-03-31T17:05:18Z")

</div>

Hi everyone,  
Is there a solution to recover `COUCHDB\_ADMIN\_PASSWORD ?  
Thanks

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [March 31, 2022, 6:20pm UTC](https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809/2 "2022-03-31T18:20:29Z")

</div>

@Babacar_Gueye - welcome to to forum! I see this is your first post. Thanks so much for asking your question. Every time the community engages here, the more we we’re able to solve your problem as well as help those who follow with the same problem later.

I assume you’re in a [self hosted](https://docs.communityhealthtoolkit.org/apps/guides/hosting/self-hosting/) or [local set](https://docs.communityhealthtoolkit.org/apps/tutorials/local-setup/) up situation, and you don’t know the password to be able to log in to the CHT web GUI as an admin. Please let me know if this isn’t correct!

If you haven’t done any customizations, then the password may simply be `password`, which is the default in our [docker-compose file](https://github.com/medic/cht-core/blob/master/docker-compose.yml#L22).

Alternately, you can check the `COUCH_URL` environment variable with an `echo` call:

```shell
echo $COUCH_URL                                                     
http://admin:password@localhost:5984/medic

```

In this case, it is simply `password` for me in my development setup.

Finally, if you’re really stuck, there’s a more involved process to forcefully reset the password. Use this method with caution as any other services that are dependent on the old password will need to be updated as well.

Let’s update the `medic` user’s password to `changeme`.

1. List your containers to find the right one:

```shell
docker ps --format="{{.Names}}"|grep medic
medic-os
helper_test_medic-os_1

```

2. In this case we want the default `medic-os` container, so let’s get shell on it:

```shell
docker exec -it medic-os bash

```

3. Edit the CouchDB `local.ini` file. I like `vim`:

```bash
vim /srv/settings/medic-core/couchdb/local.ini

```

4. Remove the pbkdf2 hash for the `medic` user and replace it with the plaintext password. When CouchDB reboots, it will re-hash this for you. Change this:

```shell
medic = -pbkdf2-8333fed3be2f6d733724bd7e16b50018d31b26f5,54b5a496afb8cc950ea4d5e9d49532ae,10

```

To this:

```auto
medic = changeme

```

5. Finally, restart CouchDB:

```bash
/boot/svc-restart medic-core couchdb

```

Please let us know if I made the wrong assumption, if you’re still stuck or if this solved your problem!

---

<div class="post-metadata">

**Author:** ![Babacar\_Gueye](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/babacar_gueye/32/1276_2.png) [@Babacar\_Gueye](https://forum.communityhealthtoolkit.org/u/Babacar_Gueye)\
**Post date:** [April 1, 2022, 9:08am UTC](https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809/3 "2022-04-01T09:08:41Z")

</div>

Hi MrJones  
Thank you for the Welcome message and your reply  
These procedures are very helpul and will serve in the future. i deployed CHT in AWS and i was able to find the paswword in the medic-os container at this location /srv/storage/medic-core/passwd.  
Thank you

---

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [November 20, 2022, 6:33am UTC](https://forum.communityhealthtoolkit.org/t/recover-couchdb-admin-password/1809/4 "2022-11-20T06:33:32Z")

</div>

@mrjones  
I am suspecting interference with an instance using the default password, password and would wish to change. I have changed the same from the admin console user settings tab, but would wish to change the same in couchDB so that pushing changes to the app becomes easy. Picking from your statement above, _ **any other services that are dependent on the old password need to be changed** _, thinking of the docker-compose, couchDb, /srv/storage/medic-core/passwd etc

Undoing to the old password from the app brings the error, “_The password is too easy to guess. Include a range of characters to make it more complex._”
