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.
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
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 / Path | Purpose | Format |
|---|---|---|
global.xml | Server-wide settings, contact info, default CRS, proxy settings | XML |
security.xml | Authentication providers, authorization rules, role managers | XML |
workspace/ | Logical grouping of data sources, layers, and services | Directory |
styles/ | SLD, CSS, and Symbolizer Engine styling definitions | XML/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
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 ofworkspace:layernameBBOX: 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)
{
"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
http://localhost:8080/geoserver/rest
Common Operations
| Method | Path | Description |
|---|---|---|
GET | /workspaces.json | List all configured workspaces |
POST | /workspaces | Create new workspace (body: XML/JSON) |
PUT | /layers/{name}.json | Update layer metadata & visibility |
DELETE | /stores/{name}.xml | Remove data store & associated layers |
GET | /status | Server 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
<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.xmlMAX_THREADSbased on CPU cores and concurrent load. - Database Indexing: Ensure spatial indices (GiST/SP-GiST) exist on PostGIS tables.
Troubleshooting
-Xmx or enable tile caching to reduce on-the-fly rendering load.
Error Resolution Matrix
| Error | Likely Cause | Resolution |
|---|---|---|
401 Unauthorized | Missing/invalid credentials or role mismatch | Verify REST basic auth or web UI session |
500 Internal Server | Corrupt data store or malformed SLD | Check geoserver.log stack trace |
WFS:500 | Transaction not enabled or schema mismatch | Enable "Transactional" in layer config |
| Slow rendering | Missing spatial index or large bounding boxes | Optimize DB, reduce request extent, use WMS |