RESOLVED! "How to install Postgis on PostgreSQL12?"

I need help with respect to the above.

The DHIS2 Implementation Guide is not current.

Thank you in advance.

Are you using Linux or windows?
in Windows, you could use the application Stack Builder to install postgis.


If you are using Ubuntu Linux:

wget --quiet -O - | sudo apt-key add -

After importing GPG key, add PostgreSQL APT repository.

echo “deb lsb_release -cs-pgdg main” |sudo tee /etc/apt/sources.list.d/pgdg.list

postgis for PostgreSQL 12:

sudo apt install postgis postgresql-12-postgis-3


Hi Hamza,

First of all thank you.

Secondly, I am using Ubuntu Desktop 20.04 LTS
Third, so far I have successfully installed PostgresSQL 12

What I have not been able to install is PostGIS, so shall I run the command below to get that over and done with?

Thanks once again for stepping in to help!

sudo apt install postgis postgresql-12-postgis-3

yes, it will install PostGIS for the postgresql-12 on your Ubuntu 20.04.
after installing postgis don’t forget to create extension postgis to dhis database.

And I presume this will do the trick:

sudo -u postgres psql -c “create extension postgis;” dhis2

Thanks again