DHIS2 Custom Login Page

I would like to inquire about the possibility of implementing a fully customized login page in DHIS2.

Specifically, I want to use my own custom login.html file instead of the default DHIS2 login interface.

Could you please guide me on the following points:

  • Is it possible to replace or override the default DHIS2 login page with a custom one?
  • Where should the custom login file be placed (e.g., dhis2/custom directory, /opt/dhis2 , or another location)?
  • What is the recommended or supported method for implementing this customization?
  • Are there any best practices or limitations I should be aware of?

I would appreciate your guidance on how to properly implement this.

Regards,
Tahir

I have Successfully changed the login page by changing the index file in webapps folder in dhis-web-login folder.
there we can can find folder for assets and can also change or alter the index.html file for the login page.

Hi @Tahir_Zaman

There’s an option to have custom login page from the Settings app as explained in the docs: Settings and configuration - DHIS2 Documentation

I think you need to be in version 41, so I assume your workaround is for earlier versions? Thanks for sharing it! :slight_smile:

Yeah I was Working on the version 2.40.5

Thank you Tahir! This looks pretty. What about the built-in feature from the settings app, wouldn’t that also work?

Yes that is also well and good practice but as I was exploring on the files and structure .. I was interested in changing it from the files directly and also wanted to know the mechanism on how can we achieve this..

I see your perspective on this. What are the advantages to changing it from the files directly? :smile:

Thanks!

:grin: I was check how the login page is linked to assets and maps icon and other files and by doing this I understood and gained knowledge about the links how the assets are loaded where are the stored. you know stuff like that.
well In short I was interested in it so that why i changed it directly from the files.

I like your learn by doing approach… :grin:

That’s interesting! For instance, I don’t know where the logo image in the login page is stored, is it in a folder managed by Tomcat?

I believe that knowledge about this would help you not only when developing apps but also when considering ‘asset management’ and file storage.

Thanks!