PostGIS Extension
PostGIS Extension to PostgreSQL for GeoServer Hosting
PostGIS extends PostgreSQL with support for geographic objects and spatial SQL queries. Combined with GeoServer, PostgreSQL can work as a backend spatial database for publishing, sharing, and managing geospatial datasets.
Create the Environment
Create an environment that contains both a Java application server and a PostgreSQL database. The source tutorial uses Tomcat 7 and PostgreSQL 9, with an example environment name of geoserver.


GeoServer Deployment
Download GeoServer
Download the latest stable GeoServer release as a web archive from the official GeoServer website.

Extract the downloaded archive.

Upload geoserver.war
Return to the platform dashboard and upload the geoserver.war file from the extracted archive.


Deploy GeoServer
Click Deploy to… beside the WAR file and select the environment created earlier.


PostGIS Configuration
Open phpPgAdmin for the PostgreSQL node, sign in with the PostgreSQL credentials received after environment creation, and create a new database.



The source example creates a database named nyc with UTF8 encoding.

Select the new database and open its SQL tab.

Run the following SQL statements:
CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION postgis_tiger_geocoder;
Paginate results
The source tutorial instructs you to tick Paginate results below the SQL form before executing the statements to avoid errors.

Dataset Import
The source example imports the nyc_buildings dataset. Download and extract nyc_buildings.zip to obtain nyc_buildings.sql.
Open the SQL tab for the PostGIS-enabled nyc database, browse to the extracted nyc_buildings.sql file on the local computer, upload it as an SQL script, tick Paginate results, and execute the script.

Connect GeoServer with PostgreSQL
Open the GeoServer application from the platform dashboard. The source tutorial uses the default GeoServer credentials admin / geoserver.


Go to Data > Stores, click Add new Store, and select PostGIS – PostGIS Database.


Configure the new vector data source.
nyc_buildings.nyc in the example.


Leave the remaining fields at their defaults unless changes are required. Ensure Validate connections is enabled and click Save.

After the connection is established, the uploaded nyc_buildings resource appears in GeoServer.
Publish and Preview the Dataset
The newly saved vector data source appears in the list of new layers. Click Publish beside nyc_buildings.

In the Edit Layer page, enter a Title and Abstract.

In the Bounding Boxes section, click Compute from data and Compute from native bounds.

Open the Publishing tab and ensure the polygon layer style is selected as the default style, then save the layer.

Go to Data > Layer Preview. Locate the published layer and open it with OpenLayers. Other preview or download formats can also be selected from the available list.


The source example displays an interactive map of New York City buildings. The preview supports zooming, panning, and viewing feature attributes.

Expected Result
PostgreSQL is extended with PostGIS, the geospatial SQL dataset is imported successfully, GeoServer connects to the PostGIS database through a configured data store, and the spatial layer can be published and previewed through OpenLayers.
Important Notes
- The source tutorial uses Tomcat 7 and PostgreSQL 9; these are source-specific example versions.
- The example PostGIS database is named
nycand uses UTF8 encoding. - The documented PostGIS setup enables
postgis,postgis_topology,fuzzystrmatch, andpostgis_tiger_geocoder. - The source instructs enabling Paginate results in phpPgAdmin when running the PostGIS statements and importing the SQL dataset.
- The example dataset is
nyc_buildings.sql. - The source tutorial uses default GeoServer credentials
admin/geoserver. - Use the PostgreSQL node host, database name, and PostgreSQL credentials when configuring the GeoServer PostGIS data source.
