PostGIS installation in Ubuntu 18.04 LTS “Bionic Beaver”

Published by Manan Patel on

Recently I have completed one project in Laravel and we have used PostgreSQL database with PostGIS extension and setup on Ubuntu 18.04 so I will guide you how to install PostGIS extension in your Ubuntu system.

PostGIS is open source software program that adds support for geographic objects to the PostgreSQL object-relational database.

Before we jump to the installation part I am assuming that you have already installed latest your system.

Step 1:

Before you can install PostGIS extension, update your list of available packages so the packages from the new repository are added to the list.

sudo apt-get update

Step 2:

Once your sources update, install PostGIS.

sudo apt-get install postgis

Enter Y when prompted to install PostGIS along with its necessary dependencies. Now we can now connect to PostgreSQL and integrate PostGIS.

Step 3:

Using the sudo command, switch to the postgres user:

sudo -i -u postgres

Step 4:

Connect to the PostGISDemo database:

psql -d PostGISDemo

Step 5:

Enable the PostGIS extension on the database:


Step 6:

Let’s verify that everything worked correctly. Execute the following command:

SELECT PostGIS_version();

You’ll get this output:

(1 row)

Step 7:

We’re all set. Type


to exit the SQL session and return to your terminal prompt.

Keep visiting for new stuff and give your feedback.

Happy Coding 😉

1 Comment

baldevp2 · February 1, 2019 at 10:16 am

Thank you so much, Manan Patel for this excellent tutorial. As always, you are rocking. Every bit of the information you present is valuable.

Leave a Reply

%d bloggers like this: