You can start developing a DHIS2 app on OSX, Windows or Linux using Docker and the DHIS command line interface (CLI). In this guide, you will install the prerequisites, start up a local DHIS2 instance and create a new app. Your app will connect to the local DHIS2 instance.
If you are using Debian Linux,
- Follow the DHIS2 Docker guide to install the prerequisites
If you are using OSX or Windows,
yarn global add @dhis2/cli
Now that you have installed Docker and the CLI you are ready to start up a local DHIS2 instance.
Starting a local DHIS2 instance
- From the terminal, start up DHIS2 and seed the database
d2 cluster up 2.35.0 --db-version 2.35 --seed
- From the browser, navigate to http://localhost:8080. If DHIS2 is running, you should see the following page:
Sign in as
admin (username) and
district (password). If you can load DHIS2 in the browser, you are ready to create a new app.
Creating a new app
- From the terminal, create a new DHIS2 app called "my-app"
d2 app scripts init my-app
- Change directories to
/my-appand start the app
cd my-app && yarn start
Connecting your app to DHIS2
- From the browser, navigate to http://localhost:3000. You will see the following page:
- Enter your DHIS2 server URL and the username and password of the default admin user
- You will see the default admin user name and a welcome message
Congratulations! You are ready to start developing a DHIS2 app 🎊
Now that you have created a DHIS2 app and connected it to a local DHIS2 instance you can learn more about developing apps on DHIS2.