# RESOLVED! "How to install Postgis on PostgreSQL12?"

**URL:** <https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308>\
**Category:** Support - Assistance technique\
**Created:** [22 May 2020 14:18 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308 "2020-05-22T14:18:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KKTH](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/kkth/32/29630_2.png) [@KKTH](https://community.dhis2.org/u/KKTH)\
**Post date:** [22 May 2020 14:18 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308/1 "2020-05-22T14:18:57Z")

</div>

I need help with respect to the above.

The DHIS2 Implementation Guide is not current.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![hamza](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/hamza/32/29339_2.png) [@hamza](https://community.dhis2.org/u/hamza)\
**Post date:** [23 May 2020 20:08 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308/2 "2020-05-23T20:08:25Z")

</div>

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

![000001](https://dhis2.b-cdn.net/uploads/default/original/3X/1/a/1ac8f816ebb271f35caedf5aaa20763b1e550af9.jpeg)

**If you are using Ubuntu Linux:**

> wget --quiet -O - [https://www.postgresql.org/media/keys/ACCC4CF8.asc](https://www.postgresql.org/media/keys/ACCC4CF8.asc) | sudo apt-key add -

After importing GPG key, add PostgreSQL APT repository.

> echo “deb [Index of /pub/repos/apt/](http://apt.postgresql.org/pub/repos/apt/) `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

---

<div class="post-metadata">

**Author:** ![KKTH](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/kkth/32/29630_2.png) [@KKTH](https://community.dhis2.org/u/KKTH)\
**Post date:** [24 May 2020 17:37 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308/3 "2020-05-24T17:37:38Z")

</div>

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?

> [@hamza](#):
>
> sudo apt install postgis postgresql-12-postgis-3

Thanks once again for stepping in to help!

---

<div class="post-metadata">

**Author:** ![hamza](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/hamza/32/29339_2.png) [@hamza](https://community.dhis2.org/u/hamza)\
**Post date:** [24 May 2020 18:35 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308/4 "2020-05-24T18:35:19Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![KKTH](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/kkth/32/29630_2.png) [@KKTH](https://community.dhis2.org/u/KKTH)\
**Post date:** [24 May 2020 18:49 UTC](https://community.dhis2.org/t/resolved-how-to-install-postgis-on-postgresql12/39308/5 "2020-05-24T18:49:32Z")

</div>

And I presume this will do the trick:

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

Thanks again
