Clear local cht instance

Hallo, is there a way to completely clear my local CHT instance? I want to view a project on my local instance but I keep seeing old forms and users.I am also unable to create a health facility/area

hi @Esther_Moturi !

I would recommend deleting your CouchDB directory:

  1. stop all your related containers: docker stop CONTAINER1 CONTAINER2 CONTAINER3 (side note: I love to stop ALL my containers becaise I often forget to stop them , so I’ll use: docker kill $(docker ps --quiet))
  2. find your CouchDB directory and delete it (see below)
  3. restart your instance and it will rebuild your CouchDB databases

CouchDB data directory will need to be deleted with sudo rm -rf COUCHDB_DIRECTORY BE CAREFUL YOU CALL THIS CORRECTLY! Like, extra EXTRA careful ; ) .

To find your CouchDB directory:

  • If you’re using CHT Docker Helper 4.x, and have a project called cht_test it would be here: ~/.medic/cht-docker/cht_test-dir/couch/* so the call would be: sudo rm -rf ~/.medic/cht-docker/cht_test-dir/couch/*
  • if you’re using local setup it would be /home/USERNAME/cht-local-setup/data/couch-data . So for me the call would be: sudo rm -rf /home/mrjones/cht-local-setup/data/couch-data

Note that I always pass a full path into the rm -rf command because it can be so destructive when coupled with the sudo command. I always want to be sure I get it correct path!

Thank you @mrjones . Quick follow up questions ; When should I use CHT Docker Helper and when do I use the local setup? Is it okay if I have them both in my machine?

Yay! glad it worked.

When should I use CHT Docker Helper and when do I use the local setup?

After you have have learned how to set up the CHT the first time with Local Setup, it’s likely easiest to use the Docker Helper after that.

Docker Helper allows you to save many configurations as well as run them concurrently if so desired. As well, it automatically adds a valid TLS script which works with mobile devices for easy testing. The local setup doesn’t do this.

Is it okay if I have them both in my machine?

CHT Docker Helper and Local Setup can safely both be used on your machine.


Hey @mrjones , I am still following the documentation on Docker helper 4.A few clarifications:

  1. I am running ./ inside my cht-core folder. Should I copy the .sh file into my specific project folder/create the .env file manually in those folders?

  2. Which url can access my local instance after running the docker helper? I am trying to use the provided link ‘https://MY (CHT)’ but I am getting an error.