Overview

GeoServer is an open-source software server written in Java that allows users to share and edit geospatial data. It is designed for interoperability and publishes data from any major spatial data source using Open Geospatial Consortium (OGC) standards.

📋 Note This documentation covers GeoServer 3.1.x. For legacy versions or migration guides, refer to the version archive or release notes.

Installation

GeoServer can be deployed as a standalone Java application, within a servlet container (Apache Tomcat, Jetty), or via containerized environments. Binary distributions and Docker images are maintained by the OSGeo project.

System Requirements

  • Java SE 11 or 17 (LTS versions recommended)
  • Minimum 2GB RAM (4GB+ recommended for production workloads)
  • Supported data sources: PostgreSQL/PostGIS, Oracle Spatial, GeoTIFF, Shapefile, WFS-C
  • Sufficient disk I/O for tile caching and data directory operations

Docker Deployment

bash
docker run -d --name geoserver \
  -p 8080:8080 \
  -v /opt/geoserver/data:/opt/geoserver/data_dir \
  -e GEOSERVER_ADMIN_PASSWORD="secure_admin_pass" \
  -e GEOSERVER_USER_PASSWORD="secure_user_pass" \
  -e GEOSERVER_CONTEXT="/geoserver" \
  osgeo/geoserver:3.1

Configuration

The primary configuration directory is data_dir. All workspace definitions, security realms, layer styling, and global settings are persisted here. Configuration can be modified via the Web UI, REST API, or directly editing XML files.

Key Configuration Files

File / PathPurposeFormat
global.xmlServer-wide settings, contact info, default CRS, proxy settingsXML
security.xmlAuthentication providers, authorization rules, role managersXML
workspace/Logical grouping of data sources, layers, and servicesDirectory
styles/SLD, CSS, and Symbolizer Engine styling definitionsXML/CSS

Data Model

GeoServer's architecture revolves around a hierarchical data model: Server → Workspace → Data Store → Layer Group → Layer. This structure enables multi-tenant deployments, granular security policies, and logical grouping of heterogeneous data sources.

Workspaces prevent namespace collisions and allow independent service configurations per organization or project.

Web Map Service (WMS)

WMS provides raster map images generated from spatial data on-the-fly. It supports multiple output formats including PNG, JPEG, and GeoTIFF. WMS is ideal for visualization and basemap services.

GetMap Request

http
GET /geoserver/world/wms?
   SERVICE=WMS
   &VERSION=1.3.0
   &REQUEST=GetMap
   &LAYERS=world:countries
   &STYLES=
   &BBOX=-180,-90,180,90
   &CRS=EPSG:4326
   &WIDTH=800
   &HEIGHT=600
   &FORMAT=image/png
   HTTP/1.1

Key Parameters:

  • LAYERS: Comma-separated list of workspace:layername
  • BBOX: Envelope in CRS coordinates (minX,minY,maxX,maxY)
  • CRS: Spatial reference system (EPSG code or WKT2)
  • TRANSPARENT: Boolean for alpha channel support (PNG)

Web Feature Service (WFS)

WFS enables the retrieval and manipulation of geospatial vector features. Unlike WMS, WFS returns raw feature data rather than rendered images. It supports transactional operations (Insert, Update, Delete) when the data store and layer security are configured appropriately.

GetFeature Request (JSON Output)

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "countries.1",
      "geometry": {
        "type": "Polygon",
        "coordinates": [[[-122.4, 37.7], [-122.3, 37.8], [-122.5, 37.9], [-122.4, 37.7]]]
      },
      "properties": {
        "NAME": "United States",
        "POPULATION": 331002651,
        "AREA_KM2": 9833517
      }
    }
  ]
}

REST API

GeoServer exposes a comprehensive RESTful API for administrative tasks, enabling automation and CI/CD pipelines. All endpoints require Basic Authentication or session cookies.

Base Endpoint

url
http://localhost:8080/geoserver/rest

Common Operations

MethodPathDescription
GET/workspaces.jsonList all configured workspaces
POST/workspacesCreate new workspace (body: XML/JSON)
PUT/layers/{name}.jsonUpdate layer metadata & visibility
DELETE/stores/{name}.xmlRemove data store & associated layers
GET/statusServer health & memory usage metrics

Logging & Debug

GeoServer uses Logback for logging. Default configuration resides in WEB-INF/classes/logback.xml. Logs are typically written to WEB-INF/logs/geoserver.log.

Adjusting Log Levels

xml
<logger name="org.geoserver" level="INFO"/>
<logger name="org.geoserver.wms" level="DEBUG"/>
<logger name="org.geotools.data" level="TRACE"/>

Enable verbose logging for specific modules to troubleshoot rendering, data access, or authentication issues. Use TRACE sparingly in production due to performance impact.

Performance Tuning

  • Tile Caching: Enable GeoWebCache (GWC) for frequently accessed layers. Configure seed ranges for optimal coverage.
  • Memory: Set GEOSERVER_JAVA_OPTS="-Xms1024m -Xmx4096m -XX:+UseG1GC" for large datasets.
  • Thread Pools: Adjust global.xml MAX_THREADS based on CPU cores and concurrent load.
  • Database Indexing: Ensure spatial indices (GiST/SP-GiST) exist on PostGIS tables.

Troubleshooting

⚠ Common Issue: OutOfMemoryError Large raster datasets or complex SLD styles can exhaust heap space. Increase -Xmx or enable tile caching to reduce on-the-fly rendering load.

Error Resolution Matrix

ErrorLikely CauseResolution
401 UnauthorizedMissing/invalid credentials or role mismatchVerify REST basic auth or web UI session
500 Internal ServerCorrupt data store or malformed SLDCheck geoserver.log stack trace
WFS:500Transaction not enabled or schema mismatchEnable "Transactional" in layer config
Slow renderingMissing spatial index or large bounding boxesOptimize DB, reduce request extent, use WMS