← Back to Blog

Introduction to GeoServer: Serve Geospatial Data

GeoServer guide — learn to install, configure WMS/WFS services, and publish geospatial data from PostGIS and Shapefiles. Convert output with GeoDataTools.

If you need to serve geospatial data over the web using open standards, GeoServer is the most widely deployed open-source solution. This GeoServer tutorial walks through what GeoServer is, how to install it, how to publish data as WMS and WFS services, the data sources it supports, how to style layers with SLD, and how to automate administration through its REST API. Whether you are setting up your first spatial data infrastructure or evaluating GeoServer for an enterprise deployment, this guide provides the foundation you need.

What Is GeoServer?

GeoServer is a Java-based, open-source server that publishes geospatial data from a variety of sources as standards-compliant web services. It implements the OGC specifications for WMS, WFS, WCS (Web Coverage Service), and WMTS (Web Map Tile Service), making it interoperable with virtually any GIS client — QGIS, ArcGIS, OpenLayers, Leaflet, and mobile SDKs. GeoServer is a project of the Open Source Geospatial Foundation (OSGeo) and is released under the GNU General Public License (GPL).

At its core, GeoServer acts as a bridge between your spatial data stores and the applications that consume them. You point GeoServer at a PostGIS database, a directory of Shapefiles, or a collection of GeoTIFF rasters, and it immediately exposes those datasets as web-accessible map images, vector features, or coverage data — no custom API code required.

Installation

GeoServer runs on any platform with a Java Runtime Environment (JRE 11 or later). The three most common installation methods are:

  • Standalone installer — Download the platform-independent binary from geoserver.org, unzip, and run startup.sh (Linux/macOS) or startup.bat (Windows). GeoServer starts an embedded Jetty server on port 8080.
  • WAR deployment — Deploy the .war file to an existing servlet container like Apache Tomcat or Jetty, which is the preferred approach for production environments that need integration with other web applications.
  • Docker — Use the official Docker image for containerized deployments: docker run -p 8080:8080 kartoza/geoserver. Docker is the fastest way to get a disposable test instance running.
# Quick start with the standalone installer
wget https://sourceforge.net/projects/geoserver/files/GeoServer/2.26.0/geoserver-2.26.0-bin.zip
unzip geoserver-2.26.0-bin.zip
cd geoserver-2.26.0/bin
./startup.sh

After startup, open http://localhost:8080/geoserver in your browser. The default credentials are admin / geoserver. Change these immediately in any non-local deployment.

Core Concepts: Workspaces, Stores, and Layers

GeoServer organizes data through a three-level hierarchy. A Workspace is a namespace that groups related data — for example, one workspace per department or project. A Store defines a connection to a data source within a workspace (a PostGIS database connection, a Shapefile directory, or a GeoTIFF file). A Layer publishes a specific dataset from a store as a web service. This hierarchy keeps large deployments organized and allows fine-grained access control.

Publishing WMS and WFS Services

Once you have created a workspace and connected a data store, publishing a layer takes a few clicks in the web administration interface:

  • Navigate to Layers → Add a new resource
  • Select your store and choose the table or file to publish
  • GeoServer auto-detects the coordinate reference system and bounding box
  • Click Save — the layer is immediately available as both WMS and WFS

Your layer is now accessible at URLs like these:

# WMS GetMap (returns a PNG image)
http://localhost:8080/geoserver/wms?
  SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&
  LAYERS=workspace:layer_name&
  BBOX=-180,-90,180,90&WIDTH=800&HEIGHT=400&
  SRS=EPSG:4326&FORMAT=image/png

# WFS GetFeature (returns GeoJSON)
http://localhost:8080/geoserver/wfs?
  SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&
  TYPENAMES=workspace:layer_name&
  OUTPUTFORMAT=application/json&COUNT=100

For a detailed comparison of these two service types, see our guide on WFS vs WMS. Both endpoints support the full range of OGC operations including GetCapabilities, filtering, and CRS reprojection.

Supported Data Sources

Data SourceTypeUse Case
PostGISVectorProduction databases, large datasets, spatial queries
ShapefileVectorLegacy data, simple file-based sharing
GeoPackageVector/RasterPortable SQLite-based format, offline use
GeoTIFFRasterSatellite imagery, elevation models, classified rasters
GeoJSONVectorQuick prototyping, small datasets
Oracle SpatialVectorEnterprise Oracle databases
SQL ServerVectorMicrosoft SQL Server spatial data
ImageMosaicRasterLarge collections of tiled raster images

PostGIS is the most common production data store for GeoServer. The combination of PostgreSQL's reliability, PostGIS's spatial indexing, and GeoServer's OGC services forms the backbone of many open-source spatial data infrastructures. For quick prototyping, you can point GeoServer at a directory of GeoJSON or Shapefile data without setting up a database.

Styling with SLD

GeoServer uses Styled Layer Descriptor (SLD), an OGC XML standard, to control how layers are rendered in WMS responses. An SLD document defines rules that match features based on attribute filters and assign symbolizers for points, lines, polygons, text labels, and rasters.

<StyledLayerDescriptor version="1.0.0">
  <NamedLayer>
    <Name>roads</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>type</ogc:PropertyName>
              <ogc:Literal>highway</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#ff6600</CssParameter>
              <CssParameter name="stroke-width">4</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

GeoServer also supports CSS-like styling through the CSS extension, which provides a more readable syntax for developers familiar with web CSS. Additionally, GeoServer supports MBStyle (Mapbox Style) for vector tile styling. You can manage styles through the web UI, the REST API, or by uploading SLD files directly.

REST API

GeoServer provides a comprehensive REST API for automating administrative tasks. You can create workspaces, add data stores, publish layers, upload styles, and manage security — all without touching the web interface. This is essential for DevOps workflows, CI/CD pipelines, and programmatic data publishing.

# Create a new workspace
curl -u admin:geoserver -X POST   -H "Content-Type: application/json"   -d '{"workspace": {"name": "my_project"}}'   http://localhost:8080/geoserver/rest/workspaces

# List all layers
curl -u admin:geoserver   http://localhost:8080/geoserver/rest/layers.json

# Upload an SLD style
curl -u admin:geoserver -X POST   -H "Content-Type: application/vnd.ogc.sld+xml"   -d @roads_style.sld   http://localhost:8080/geoserver/rest/styles

The REST API follows predictable URL patterns and supports JSON and XML request/response formats. It integrates well with infrastructure-as-code tools like Ansible and Terraform for reproducible GIS server deployments.

Common Use Cases

  • Spatial data infrastructure (SDI) — Government agencies use GeoServer to publish authoritative datasets (parcels, roads, zoning) as OGC-compliant services for internal and public consumption.
  • Web mapping applications — GeoServer feeds WMS tiles and WFS features to Leaflet and OpenLayers applications, handling data serving while the frontend handles user interaction.
  • Data sharing and interoperability — Organizations share geospatial datasets with partners and the public through standardized WMS/WFS endpoints, ensuring compatibility with any OGC-compliant client.
  • Map tile generation — GeoServer's GeoWebCache integration pre-generates and caches map tiles for high-performance delivery of base layers and thematic overlays.

Getting Data into GeoServer

Before publishing, you often need to prepare and inspect your geospatial data. GeoDataTools lets you load GeoJSON and KML files in the browser, review attributes and geometries, filter features, and convert between formats. Once your data is clean, import it into PostGIS or save it as a Shapefile, then connect GeoServer to the data store for publishing.

FAQ

Is GeoServer free?

Yes. GeoServer is fully open source, released under the GNU General Public License (GPL). It is free to download, use, and deploy in both personal and commercial environments. There is no enterprise edition or feature gating — all functionality is available in the open-source release. Commercial support is available from companies like Camptocamp, Astun Technology, and GeoSolutions.

How does GeoServer compare to MapServer?

Both are open-source OGC-compliant map servers. GeoServer is Java-based with a web administration UI and REST API, making it easier to configure without touching config files. MapServer is C-based and configured through Mapfiles, offering potentially higher raw rendering performance for WMS. GeoServer has broader data source support and more straightforward WFS-T (transactional editing) capabilities. Most new projects choose GeoServer for its usability, though MapServer remains popular in high-throughput tile serving scenarios.

Can GeoServer handle large datasets?

Yes, when backed by a properly indexed PostGIS database, GeoServer can serve datasets with millions of features. Performance depends on database indexing, GeoWebCache tile caching, connection pooling, and JVM tuning. For raster data, the ImageMosaic plugin allows GeoServer to serve terabytes of imagery by indexing individual tiles and serving only the requested extent. Production deployments often use reverse proxies like Nginx and multiple GeoServer instances behind a load balancer for high availability.

Ready to work with your geospatial data?

Visualize, filter, and convert GeoJSON and KML files directly in your browser.

Try GeoDataTools