How to install PostGIS extension in PostgreSQL

Srikanth Devanaboina
2 min readJul 8, 2021

PostgreSQL is already the second most loved database according to the 2018 StackOverflow survey and it’s the fastest-growing in popularity. It’s billed as the “world’s most advanced open-source relational database”, But when you add the spatial SQL support that comes with the PostGIS extension, there truly is nothing else out there like it (at least not for free).

To install the PostGIS we need to follow the below process.

PostgreSQL 13

use the following command:

sudo apt install postgis postgresql-13-postgis-3-scripts

PostgreSQL 12

sudo apt install postgis postgresql-12-postgis-3-scripts

Based on your version of PostgreSQL change the version in command.

Go to your pgadmin, log in with credentials and click on query tool by giving right-click on the database.

Run this command in the query section

CREATE EXTENSION postgis;

Now check in the extensions folder in the database whether PostGIS is created or not.

Now, the extension is created successfully!

Thanks.

--

--