From PostGIS to Pixels: Publishing Spatial Data with GeoServer
PostGIS is excellent for spatial analysis, but getting those results in front of users typically means publishing them as maps. GeoServer fills this role as an open-source mapping server that exposes spatial data through standardized web services. At its core, it implements a set of OGC (Open GIS Consortium) standards — most notably WMS (Web Mapping Service) for map images and WFS (Web Feature Service) for vector data — that any standards-compliant client can consume.
A Quick Start with Docker
Getting a GeoServer instance running for evaluation is straightforward using a container image. The following commands pull the image and start a single non-clustered instance, mapping the container's port 8080 to your host. Running it within a tmux session lets you watch the Tomcat logs in real time.
docker pull kartoza/geoserver:2.18.2
tmux
docker run -it --name geoserver -p 8080:8080 -p 8600:8080 kartoza/geoserver:2.18.2
A successful startup is confirmed by Tomcat's log message:
org.apache.catalina.startup.Catalina.start Server startup in XX ms
You can then navigate to the GeoServer web interface (typically at http://localhost:8080/geoserver) and log in with the default geoserver/admin credentials.
Registering a PostGIS Data Store
GeoServer organizes its resources — data stores, layers, and services — into logical containers called workspaces. Before you can publish the airport dataset (from https://ourairports.com/data/airports.csv) stored in a PostGIS table, you need a workspace. Its configuration controls the accessibility of the resources within it.

With a workspace defined, the next step is registering your PostGIS database as a vector data source.
- Navigate to the Store section and select PostGIS as the type of vector data source.

- In the configuration form, assign the store to your chosen workspace and provide the database connection parameters.

Saving the new data source should present a list of available spatial tables from the database. Selecting the airports table proceeds to the layer publication step.

Layer Configuration Essentials
Publishing a layer isn't just about pointing GeoServer at the table. You must define the Coordinate Reference System (CRS) and the layer's bounding box. GeoServer attempts to read the CRS from the database's metadata, which is usually sufficient if it was registered correctly. It can derive the layer's extent from data of that CRS, and you can manually override it. Either way, GeoServer enforces these mandatory fields, and once correctly filled in, the airports layer appears under the Layers section with full configuration status.

WMS Service and Layer Preview
GeoServer is "full-fledged" because of two things: its broad support for spatial data sources and its implementation of numerous OGC services. In a default installation, this includes TMS, WMS-C, WMTS, CSW, WCS, WFS, WMS, and WPS.
WMS is the core service for producing map images. It renders maps on demand, allowing clients to control the output's extent, projection, and styling. Since WMS is enabled globally by default, no further setup is required to test the published layer. GeoServer's built-in Layer preview functionality makes this easy:
Open the Layer preview from the navigation pane, select the airports layer, and choose a format such as WMS/JPEG.

This generates a GetMap request to the WMS endpoint, similar to:
http://10.0.0.216:8090/geoserver/cybertec/wms?service=WMS&version=1.1.0&request=GetMap&layers=cybertec%3Aairports&bbox=-179.8769989013672%2C-90.0%2C179.9757080078125%2C82.75&width=768&height=368&srs=EPSG%3A4326&styles=&format=image%2Fjpeg
The response is a JPEG image of your data, though likely lacking visual flair

as no specific styling has been applied; GeoServer defaults to a generic rendering in that case.
Viewing Your WMS in a GIS Client
Publishing is only half the story; you probably want to use the map in a desktop GIS. QGIS, as a mature open-source client, supports standard WMS connections. From the navigation pane, add a new WMS connection and paste in the endpoint URL you saw in the preview's request:
http://10.0.0.216:8090/geoserver/cybertec/wms

Behind the scenes, QGIS first sends a request to that endpoint with the request=GetCapabilities parameter, as seen here:
http://10.0.0.216:8090/geoserver/cybertec/wms?service=WMS&version=1.1.0&request=GetCapabilities
GeoServer responds with an XML document that lists available layers, projections, and formats. QGIS parses this and incorporates your airports layer into its layer tree. Combined with a base map, such as OpenStreetMap, the results render a useful visual representation of your spatial dataset.

A Foundation for Spatial Infrastructure
This workflow demonstrates a core pattern: a PostGIS-backed GeoServer providing standardized map services. The out-of-the-box support for different data sources and services makes it a capable mapping server, and the architecture gives you a solid model for building a spatial data infrastructure. That said, scaling this to a production environment introduces considerations — including performance tuning and security hardening — that go beyond this basic setup.



