# Help Needed for local setup of the project using docker 

**URL:** <https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900>\
**Category:** Technical Support\
**Created:** [April 23, 2025, 10:08pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900 "2025-04-23T22:08:22Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 23, 2025, 10:08pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/1 "2025-04-23T22:08:22Z")

</div>

Hello everyone I am trying to locally setup the project in windows WSL +docker i have now set up the cht-layout project (dev container) (ig this this a temple of a real application) . After that what i understood from the ( [App Developer Hosting in CHT 4.x | Community Health Toolkit](https://docs.communityhealthtoolkit.org/hosting/4.x/app-developer/)) that I have:

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/4/4de1771b850df79ad71d9fd6056a55533104e908.png)

to clone the cht-core repo and run the docker command `./cht-docker-compose.sh` (in the dev conainer ?)  
but facing this error can some one please help me guide what i need to do to resolve this

```auto
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core/scripts$ cd ..
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core$ ./cht-docker-compose.sh up -d
bash: ./cht-docker-compose.sh: No such file or directory
node@dcb0810ab35f:/workspaces/cht-project/cht-core/cht-core$ ///

```

thank you in advance

---

<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:** [April 23, 2025, 11:03pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/2 "2025-04-23T23:03:43Z")

</div>

hi @Shubhank - thanks so much for your question and welcome to the forum! This is exactly the right place to ask your question. Let’s try and solve your issue!

It looks like your WSL2 VM has the [CHT Core repo](http://github.com/medic/cht-core) cloned, but let’s be sure you’re up to date first. I’m assuming that `/workspaces/cht-project/cht-core/cht-core` is where the CHT Core repo is cloned to. To update it:

1. launch your wsl2 terminal
2. Change directories into the CHT Core: `cd /workspaces/cht-project/cht-core/cht-core`
3. Tell `git` to fetch and meta data and then to pull down any updates: `git fetch ; git pull origin`

Report back if you get an errors from that. It’s best if you can copy and past from the WSL2 terminal instead of taking a screenshot. Here’s what it looked like for me as user `mrjones` on my WSL2 host named `wsl2` with a directory structure that matches yours:

```auto
mrjones@wsl2:~$ cd /workspaces/cht-project/cht-core/cht-core/ mrjones@wsl2:/workspaces/cht-project/cht-core/cht-core$ git fetch ; git pull origin Already up to date. 

```

Now that we’re sure the code is up to date, let’s see if you can run the Docker Helper:

1. launch your wsl2 terminal
2. Change directories into the CHT Core’s Docker Helper directory: `cd cd /workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x/ `
3. Try calling docker helper: `./cht-docker-compose.sh`

If everything is working, and you have docker desktop already installed, you should see it start to download the upgrade service container:

```auto
mrjones@wsl2:~$ cd /workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x/
mrjones@wsl2:/workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x$ ./cht-docker-compose.sh
No project found, follow the prompts to create a project .env file.

Would you like to initialize a new project [y/N]? y

Do you want to run the latest CHT Core version (4.18.0) [Y/n]?

How do you want to name the project? first post FTW

Downloading compose files ... done
homedir: /home/mrjones/.medic/cht-docker/first_post_ftw-dir
[+] Running 5/8                                                                                                          
⠙ cht-upgrade-service [⣿⣿⣤⣤⣿⣿⣿] 73.93MB / 127.5MB Pulling 13.1s ✔                       

```

And then, depending on the speed of your computer and your internet connection, you should eventually get the URL of your local CHT instance:

```auto
 --------------------------------------------------------
Success! "first_post_ftw" is set up:

	https://172-24-54-83.local-ip.medicmobile.org:10443/ (CHT)
	https://172-24-54-83.local-ip.medicmobile.org:10443/_utils (Fauxton)

	Login: medic
	Password: password

--------------------------------------------------------
Start existing project
   ./cht-docker-compose.sh ENV-FILE.env
Stop and keep project:
	./cht-docker-compose.sh ENV-FILE.env stop
Stop and destroy all project data:
	./cht-docker-compose.sh ENV-FILE.env destroy

https://docs.communityhealthtoolkit.org/hosting/4.x/app-developer/

  Have a great day!

```

Here is a screen shot showing:

1. upper left side: the WSL2 terminal having run the Docker Helper and showing the URL
2. right site: Docker Desktop in Windows showing all the CHT services running
3. lower left side: a browser showing the CHT login being served from my local instance

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/6/6b925c4546057ffb8a98846bfbb5c24ce2e3a059.jpeg)

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 23, 2025, 11:55pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/3 "2025-04-23T23:55:59Z")

</div>

Thank you very much for such detailed explanation what I understood I need to navigate to exact location to run command but now I ran into issue that I dont have docker

node@bfb150a064ec:/workspaces/cht-project/cht-core/cht-core/scripts/docker-helper-4.x$ ./cht-docker-compose.sh

“docker” or “docker compose” is not installed or could not be found. Please install and try again!

but i have docker in my machine

```auto
C:\Users\Shubhank>docker --version
Docker version 27.3.1, build ce12230 

```

how do i give access from dev container to host docker

I modified the `.devcontaier.json` file as ChatGPT said but it still failed

```json
{
  "name": "CHT Dev",
  "image": "medicmobile/cht-app-ide:latest",

  // Required for Puppeteer (browser automation in testing)
  "capAdd": ["SYS_ADMIN"],

  // Allow the DevContainer to use host Docker
  "mounts": [
    "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
  ]

  // (Optional but recommended) Install VS Code extensions
  
}

```

Can you please help

---

<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:** [April 24, 2025, 4:38am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/4 "2025-04-24T04:38:22Z")

</div>

@Shubhank - to enable Docker Desktop inside WSL2, checkout [this guide from Docker](https://docs.docker.com/desktop/features/wsl/).

Let us know how it goes!

---

<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:** [April 24, 2025, 4:39am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/5 "2025-04-24T04:39:51Z")

</div>

Also - I’d revert any changes to `.devcontaier.json` to ensure there’s no conflicts with what Docker Desktop expects.

Also 2x - If you get this dialog message when installing docker and then launching WSL2, you want to choose “Allow access”:

 ![firewall](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/ef545249781005c1e50e2ac14669bc5dc0677378.png)

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 27, 2025, 7:19pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/6 "2025-04-27T19:19:19Z")

</div>

Hi @mrjones sorry for bugging you again but I still can’t set up the repo like i i have the dev container up running and i have selected the wsl 2 engine in docker still when i run the command inside the container its says:

```auto
bash node@bfb150a064ec:/workspaces/cht-project$ docker ps  
bash: docker: command not found 

```

Can you tell me what I need to learn or do to resolve such an issue?

Thank you

 ![Screenshot 2025-04-28 004343](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/729da267b4c652e6283aef16f31c092af053070c.png)

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 28, 2025, 6:53pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/7 "2025-04-28T18:53:53Z")

</div>

hello @diana if possible can you help me with this issue

---

<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:** [April 28, 2025, 7:07pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/8 "2025-04-28T19:07:25Z")

</div>

Oh no - I’m sorry to hear that @Shubhank - that sounds really frustrating!

What version of windows are you running (eg 10 “Home” vs “11 Pro” etc)? What version of WSL are you running?

I was able to get the latter with `wsl --version` like this:

```auto
C:\Users\mrjones>wsl --version
WSL version: 2.4.13.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5716
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.19045.5737

```

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 28, 2025, 7:17pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/9 "2025-04-28T19:17:51Z")

</div>

oh thank you this is WSL version: 2.1.5.0  
Kernel version: 5.15.146.1-2  
WSLg version: 1.0.60  
MSRDC version: 1.2.5105  
Direct3D version: 1.611.1-81528511  
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp  
Windows version: 10.0.22631.5189 version I’m using

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 28, 2025, 7:25pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/10 "2025-04-28T19:25:26Z")

</div>

this is how my .devcontainer file looks like rn I have modified it a bit {  
“name”: “CHT Dev”,  
“image”: “medicmobile/cht-app-ide:latest”,

// Required for Puppeteer (browser automation in testing)  
“capAdd”: [“SYS\_ADMIN”],

// Allow the DevContainer to use host Docker  
“mounts”: [  
“source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind”  
]

// (Optional but recommended) Install VS Code extensions  
}

---

<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:** [April 28, 2025, 8:35pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/11 "2025-04-28T20:35:05Z")

</div>

Thanks for the info @Shubhank . Since there’s a newer release of WSL2 AND you’re having issues with your release, I think it’d be good to re-install WSL2.

I found a [great guide online](https://gist.github.com/4wk-/889b26043f519259ab60386ca13ba91b) which I’ve copied here with just the parts you need:

1. **In powershell (as admin)**

2. **In Settings \> Apps \> Apps & Features**

- search for `Ubuntu` (then `Debian`, etc), and if something is found, click on **uninstall**
- search for `Linux`, and if something is found, click on **uninstall** on all results

1. **In Start Menu \> Turn Windows Features on or off**

- Untick `Virtual Machine Platform` checkbox
- Untick `Windows Subsystem for Linux` checkbox

1. **Reboot**

2. **Installing wsl - In powershell (as admin)**

1. **Reboot** and **wait for the Ubundu installation to complete** and ask for username (it might takes some time).

---

<div class="post-metadata">

**Author:** ![shashi\_sah](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/shashi_sah/32/3915_2.png) [@shashi\_sah](https://forum.communityhealthtoolkit.org/u/shashi_sah)\
**Post date:** [April 29, 2025, 5:35am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/12 "2025-04-29T05:35:20Z")

</div>

Hey @Shubhank it will be much easier to work with GitHub codespaces setting up this project, it offers reasonable amount of time even for free users, just setup a github codespace for this project and follow this [LOCAL SETUP](https://docs.communityhealthtoolkit.org/community/contributing/code/core/dev-environment/#install-nodejs-npm-and-docker).

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [April 29, 2025, 5:40am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/13 "2025-04-29T05:40:53Z")

</div>

> [@Shubhank](#):
>
> ```auto
> bash node@bfb150a064ec:/workspaces/cht-project$ docker ps  
> bash: docker: command not found 
> 
> ```

When I get this error in WSL, it’s usually when Docker Desktop is not running on Windows, or the WSL integration is disabled.

Please make sure that the WSL integration is enabled for your default and any additional Linux distros:

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/2/2dbda1eb8984fc4301dacc5281ec7cb09fd8824c.png)

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 29, 2025, 10:11am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/14 "2025-04-29T10:11:28Z")

</div>

Thank you @binod but I guess I have my docker desktop up and running this is what i get when i do docker ps in command prompt

```auto
C:\Users\Shubhank>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bfb150a064ec medicmobile/cht-app-ide:latest "/bin/sh -c 'echo Co…" 5 days ago Up 12 hours vibrant_leakey

```

and I have the wsl 2 integration selected  
Is there anything I could have done wrong while cloning/or setting up the docker container I followed this [Getting started building a CHT app | Community Health Toolkit](https://docs.communityhealthtoolkit.org/building/local-setup/#developing-with-vs-code-dev-container)

---

<div class="post-metadata">

**Author:** ![Shubhank](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Shubhank](https://forum.communityhealthtoolkit.org/u/Shubhank)\
**Post date:** [April 29, 2025, 10:12am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/15 "2025-04-29T10:12:34Z")

</div>

Oh Thank you @shashi_sah will try this if I still does not work :))

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [April 29, 2025, 2:19pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/16 "2025-04-29T14:19:07Z")

</div>

> [@Shubhank](#):
>
> Is there anything I could have done wrong while cloning/or setting up the docker container

If you are still willing to try running `docker` in a WSL distro, here are some troubleshooting steps that I sourced from [here](https://github.com/docker/for-win/issues/13088#issuecomment-1409857049) and [here](https://github.com/docker/for-win/issues/13088#issuecomment-1464490504):

1. Check the output of `wsl -l` (from Windows CMD or PowerShell)
2. If `docker-desktop` is missing in the list, uninstall and reinstall Docker Desktop (latest version)
3. Check `wsl -l` again
4. If `docker-desktop` is now available, check if `docker` command is recognized in WSL
5. Restart and try the above step #4

Please check [this comment](https://github.com/docker/for-win/issues/13088#issuecomment-1536365076) too.

---

<div class="post-metadata">

**Author:** ![apoorvapendse](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/apoorvapendse/32/3893_2.png) [@apoorvapendse](https://forum.communityhealthtoolkit.org/u/apoorvapendse)\
**Post date:** [April 29, 2025, 5:11pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/17 "2025-04-29T17:11:38Z")

</div>

Thanks a lot @binod for this [this](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/13) pointer, I was finally able to setup `cht-core` on my Windows machine because of this!

A mistake I made was exporting the COUCH variables in `~/.profile`, which is sourced **only** by _login_ shells.  
(I use `bash` as my default shell)

Some notes which might be useful for future contributors:

When you enter the shell using:

```auto
wsl -d <distro>

```

WSL launches a **non-login shell** , so `~/.profile` is skipped.

- If you’re using **bash** , put the variables in `~/.bashrc`.
- If you’re on **zsh** , note that zsh defaults to a login shell when launched using the command above, so `~/.zprofile` is sourced automatically.

After moving the exports to the appropriate startup file (~/.bashrc in my case), everything works as expected.

I found this [thread](https://unix.stackexchange.com/questions/38175/difference-between-login-shell-and-non-login-shell) quite insightful while debugging this.  
[See this](https://unix.stackexchange.com/a/760672) to check whether the current shell is a login shell.

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:** [April 29, 2025, 6:43pm UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/18 "2025-04-29T18:43:20Z")

</div>

@apoorvapendse - yay - so glad to hear you’re unblocked! Thanks for posting great follow up message summarizing the tips you followed. Very much appreciated!

---

<div class="post-metadata">

**Author:** ![hareet](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/hareet/32/3676_2.png) [@hareet](https://forum.communityhealthtoolkit.org/u/hareet)\
**Post date:** [August 12, 2025, 6:05am UTC](https://forum.communityhealthtoolkit.org/t/help-needed-for-local-setup-of-the-project-using-docker/4900/19 "2025-08-12T06:05:09Z")

</div>

A couple notes from my first WSL2 setup:

- Installed docker engine directly on wsl and avoided Docker Desktop for the pros listed in our Linux setup docs
- Had to manually install bzip2 to execute `tar jxf phantomjs.tar.bz2`package, I guess it wasn’t included in `24.04.3 LTS` WSL2 subshell installation. PhantomJS was trying to be installed during the dev setup running `npm build-dev`
- When switching to zsh or oh-my-zsh, had to add NVM path to .zshrc to find node && npm
- Ran CouchDB as a docker container
- When deploying sample data from test-data-generator in a container, had to add it to the same network as couchdb container → cht-net

It has been 10+ years since I’ve used Windows and I am impressed with WSL2. 😎
