Step 4 of 5

Basics 4: Publishing Map Services

Learn how to expose your geospatial data using standard web services like WMS, WFS, and WCS. This is the core of GeoServer's power.

Now that you have data loaded and styled (covered in Basics 2 & 3), it's time to publish your data. Publishing creates a web service endpoint that applications, dashboards, and other users can consume to view and interact with your maps.

GeoServer implements several Open Geospatial Consortium (OGC) standards. In this guide, we focus on the most common ones:

How Publishing Works

Unlike other servers, GeoServer doesn't require a manual "Publish" button for every layer. By default, all data in your workspaces is immediately available via WMS and WFS as soon as it is added.

๐Ÿ’ก Security Note

Because data is published automatically, ensure you have configured Security Roles (covered in Basics 5) if your data contains sensitive information.

Step 1: Verify Your Layer is Published

1
Check the Data Page
  1. Navigate to /web/data/layers/ in the GeoServer Web UI.
  2. Locate your layer in the list.
  3. Ensure the Enabled checkbox is ticked.
  4. Click Save at the bottom of the page.

If enabled, your layer is now live at the standard WMS/WFS endpoints.

Step 2: Constructing Service URLs

You can access your services by constructing URLs. GeoServer provides a demo module that helps test these, but direct URLs look like this:

WMS GetMap Request

Request a map image for a specific bounding box.

URL
http://localhost:8080/geoserver/workspaces/ows?
SERVICE=WMS
&VERSION=1.1.1
&REQUEST=GetMap
&LAYERS=workspaces:my_layer
&STYLES=
&BBOX=-180,-90,180,90
&WIDTH=800
&HEIGHT=600
&FORMAT=image/png

WFS GetFeature Request

Request raw vector data in GeoJSON format.

URL
http://localhost:8080/geoserver/workspaces/wfs?
SERVICE=WFS
&VERSION=2.0.0
&REQUEST=GetFeature
&TYPENAMES=workspaces:my_layer
&OUTPUTFORMAT=application/json
๐Ÿงช Pro Tip

Enable the "Demo" module in GeoServer to get an interactive form that builds these URLs for you automatically.

Step 3: Configuring WMS Layer Details

You can customize how a layer behaves when requested via WMS. Go to /web/data/layers/ and click your layer name.

Step 4: Testing in an External Client

The best way to verify your service is to load it into a GIS client like QGIS, Leaflet, or OpenLayers.

QGIS Example

  1. Open QGIS.
  2. Go to Layer > Add Layer > Add WMS/WMTS Layer.
  3. Click New and name it "GeoServer".
  4. Enter URL: http://localhost:8080/geoserver/workspaces/wms.
  5. Click Connect. Your layers should appear in the list.
  6. Check your layer and click Add.

Leaflet Example (JavaScript)

Here's a minimal snippet to add your WMS layer to a Leaflet map:

JavaScript
var map = L.map('map').setView([0, 0], 2);

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '© OpenStreetMap'
}).addTo(map);

L.tileLayer.wms('http://localhost:8080/geoserver/workspaces/wms', {
    layers: 'workspaces:my_layer',
    format: 'image/png',
    transparent: true,
    attribution: 'GeoServer'
}).addTo(map);

Troubleshooting

Next Steps

Now that your data is published, you need to secure it. In the next chapter, we'll cover Security & Access Control, including role-based permissions, authentication providers, and fine-tuning service-level security.