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.

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

I installed DHIS2 41.8.1, Apache Tomcat 9, OpenJDK 17, and PostgreSQL 14, and configured it using the installation manual. After configuration, the login page did not appear; instead, only a white screen was shown. How can I fix it?

Hi @Tamrat_Mequanint

Welcome to the DHIS2 Community of Practice! Please which manual did you follow? Also, are you sure you are entering the correct url and the port number? This depends on what you entered in dhis.conf… what is the value for the server.base.url in your dhis.conffile?

Hello @Gassim
Thank you for reaching out. I followed a manual from the ResearchGate publication site because I couldn’t find the latest installation manual on the DHIS2 website. As you can see in the attached screenshot, the value in the dhis.conf file and the URL are the same, but the login screen appears blank (white).

@Tamrat_Mequanint : you may also want to try:
http://localhost:8080/dhis-web-commons/security/login.action ?

I think this is a general setup/configuration issue, but if you try the alternative login page (url above), we can rule out that it is not related specifically to the login page before troubleshooting more.

@tzemp: Thank you. I am now able to access the login page; however, I am still experiencing issues with the login credentials. I am experiencing an issue with the directory at http://localhost:8080/dhis/dhis-web-login/. Since your directory appears to be different, the user credentials are not working as expected in my understanding. Should I have to reinstall it?

Great to see you’ve moved forward… :+1:

Does it say incorrect username/password? Do you see any errors in the Console (F12 - DevTools)?

@Gassim
Based on @tzemp’s suggestion, I tried accessing the system using: http://localhost:8080/dhis/dhis-web-commons/security/login.action

However, I encountered issues with my user credentials. In my understanding, the directory in the above link does not match the one causing the white screen problem.

When I use: http://localhost:8080/dhis/dhis-web-login/ the page only displays a white screen. With the previous web address, I can access the login page, but I am unable to log in using my credentials.