Local instance of DHIS2 login not working

Hello Community,

I just installed a local instance of DHIS 2 on my computer. I used the DHIS2 CLI to set up on mac.

The App opens at http://localhost:3000/. This opens the login page.
When I enter the username (admin) and password(district) it only refreshes the page.

Can anyone help?

Hi @prime. Thanks for the question.

Can you check that port 3000 is properly white-listed for your DHIS2 local instance?

In your local instance, you can open the Settings App and then click on the Access tab (from the lefthand sidebar).

You should see a section title cors whitelist, and you need to make sure that http://localhost:3000 is listed there.

Hello @tzemp unfortunately, I am unable to log into the system I cannot access the settings.
This is the only page I see now

So basically after I input the credentials and hit the submit button, the login page just refreshes

Okay. Got you @prime. When you initialize an app with d2 app scripts, you will have a frontend DHIS2 app (running on port 3000). To run that frontend app, you need to connect that to a DHIS2 backend (this is the login you are seeing).

You can spin up your own DHIS2 instance to connect the app to using docker. Once that is in place, you would log in against that instance.

Our reference materials on app set up might provide a better explanation:

See particularly the link to setting up a DHIS2 instance in docker: How to spin up a DHIS2 local instance | DHIS2 Developer Portal

If you are not trying to develop a frontend app, but are wanting to set up a local DHIS2 instance for some other reason, let us know.

1 Like

Thanks Very much @tzemp . I am actually trying to develop a frontend up…I am checking the documentation out and when I succeed I will share. Thanks Again for the assistance. I appreciate it

2 Likes