DHIS 2 PostgreSQL database instructions
Quick guide:
Download
latest version. PostgreSQL documentation
.
Download:
Download PostgreSQL from http://www.postgresql.org/download/
.
Install:
Windows:
- Start the installation by clicking the installer in your downloaded version
- Follow the instructions by the program
- Name your user dhis when asked
Mac:
Binary packages and instructions can be found at http://www.entropy.ch/software/macosx/postgresql/
Take a look at How to run the PostgreSQL server
If you wish to compile it yourself a guide can be found here
http://developer.apple.com/internet/opensource/postgres.html
Setup/Configuration:
How to run the PostgreSQL server
Windows:
Mac:
Install the StartupItem package from http://www.entropy.ch/software/macosx/postgresql/
Optional setup to make life easier:
Prepare PostgreSQL for DHIS 2
- Go to the start menu -> programs -> PostgreSQL 8.1 and click on pgAdmin III. pgAdmin is a nice and intuitive graphical administration tool for PostgreSQL. Documentation for pgAdmin can be found here: http://www.pgadmin.org/docs/1.4/using.html

- In pgAdmin connect to your database server, by default named PostgreSQL Database Server 8.1. You will be asked for a password which is the one you entered for the user at the installation of PostgreSQL.
- Right-click on databases -> New database. Name your database dhis2, and the owner of the database dhis. Now your PostgreSQL-settings should match your hibernate.properties file.
- Go to start menu -> programs -> PostgreSQL 8.1 and click on Start service. If you now run the application the database shell will be created for you. You must always remember to use Start service before you want to use your DHIS 2 with your PostgreSQL-database.
hibernate.properties
Create a file called "hibernate.properties" in USER_HOME/dhis/.
Content of "hibernate.properties":
Additional tools:
PgAdmin III
Graphical user interface to PostgreSQL database servers. Exists for all major operating systems.
Mac:
At the time of writing the newest version is 1.6.2 and can be found at http://www.postgresql.org/ftp/pgadmin3/release/v1.6.2/osx/
Documentation:
http://www.postgresql.org/docs/
Documentation for pgAdmin can be found here: http://www.pgadmin.org/docs/1.4/using.html