This short tutorial will guide you how to install PostGIS on Debian 13. If you need to store and manage location data in your PostgreSQL database on Debian Linux, you’ll want to install PostGIS. PostGIS is a powerful extension that adds full support for geographic objects, turning your database into a spatial database. This guide will show you exactly how to install PostGIS on your Debian system. We’ll walk through the entire process step-by-step, making it simple to get your geospatial database up and running quickly.
I assume you have Debian 13 installed in your PC or Virtual Machine. You can download Debian 13 ISO from this link.
Step to Install PostGIS on Debian 13
Before we begin, make sure you have the following:
- A running Debian Linux system.
- sudo or root privileges.
- PostgreSQL already installed on your system. This guide assumes you have a working PostgreSQL server. Please read my previous tutorial to install PostgreSQL on Debian 13.
Step 1. Update Your System
First, it’s always a good practice to update your system’s package lists to ensure you get the latest versions and security patches.
Open your terminal and run:
sudo apt update
sudo apt upgrade -yStep 2. Install PostGIS Package
Now we are ready to install postgis package in Debian 13. Use this single command as root.
apt install postgis
Wait until the installation process completes. FYI, postgis has to be enabled on the database level. Next we need to enable this extension in our database.
Create a New Database and User and Enable PostGIS
Skip this step if you have the Database already. If not, let’s create a new database with this command in psql window.
#Create a new database called equatordb
CREATE DATABASE equatordb;
#Create a new user equator
CREATE NEW USER equator WITH PASSWORD 'YourPassword.2025';
#Grant privileges to equator user
GRANT ALL PRIVILEGES ON DATABASE equatordb TO equator;Now let’s switch to our new database and then enable postgis extension from psql window
#Switch to the database
\c equatordb;
#Enable postgis
CREATE EXTENSION postgis;Verify the PostGIS installation
Run this command to verify the PostGIS installation while still in psql prompt for your database
SELECT PostGIS_version();Output:
postgis_version
---------------------------------------
3.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)Ok, now we have successfully installed PostGIS on Debian 13. Now we can use this PostGIS to store our spatial dataset.


Pingback: Export Spatial Dataset to PostGIS Using QGIS - geodatainsights.com