Setup GeoServer for Oskari

This document describes how to setup a GeoServer environment for Oskari. Geoserver is needed for these functionalities:

  • myplaces
  • analysis
  • userlayers

Note! A prepopulated GeoServer configuration/datadir is available under {jetty.base}/geoserver_data in the Jetty bundle. This however uses preconfigured credentials for geoserver and database which you don't want to use for production. The provided datadir uses EPSG:3857. You can change these by running the setup webapp.


  • Jetty bundle installed
  • Optionally an external GeoServer (tested with the version mentioned on download page)

Using the setup webapp

The Jetty Bundle includes a webapp to help configuring a GeoServer for Oskari using GeoServer REST API. The webapp can be found in {jetty.base}/setup.war. It can be deployed by moving the war-file in to {jetty.bse}/webapps and once deployed it can be accessed with http://localhost:8080/setup. The setup asks for the native projection you want to use for saving the user content.

When using single GeoServer, you can use these properties for the setup-webapp:

# geoserver params for setup

If you want to use multiple GeoServers and/or different credentials per functionality, you can configure with "module" prefixes:

# geoserver params for myplaces

# geoserver params for analysis

# geoserver params for userlayers

Any missing properties will fallback to one without the module part in the property key.

Note! The setup webapp is accessible to anyone once deployed so remove it from {jetty.base}/webapps after doing the configuration.

Details for configuring manually/debug purposes

The code for configuring geoserver can be found here:

  1. Create workspace
  1. Create store for the functionality (for oskari workspace):
  • url: key db.url (Tries module specific config first: db.[myplaces|analysis|userlayer].url)
  • user: key db.username (Tries module specific config first: db.[myplaces|analysis|userlayer].username)
  • password: key db.password (Tries module specific config first: db.[myplaces|analysis|userlayer].password)
  • namespace:
  • Loose bbox: true

For userlayer functionality defines also Primary key metadata table: gt_pk_metadata_table

  1. Creates layers for the functionalities

Using the store created in step 2.


a) Data for layers (WFS)

  • name: categories

b) Data for places (WFS)

  • name: my_places

c) Rendering for WMS

  • name: my_places_categories


a) Data for WFS

  • name: analysis_data

b) Rendering for WMS

  • name: analysis_data_style


a) Data for WFS

  • name: vuser_layer_data

b) Rendering for WMS

  • name: user_layer_data_style
  1. Uploads style specific to the functionality

SLD files can be seen here:

  1. Updates layers in database with geoserver info

Updates database table oskari_maplayer with url/username/password that were used when configuring the Geoserver for "base layers" used for these functionalities. Creates the layers if not present and gives output how to configure them in by modifying if they aren't configured properly:[layer id for myplaces][layer id for analysis][layer id for userlayer]

Last modified: Fri Mar 15 2024 14:11:33 GMT+0200 (Eastern European Standard Time)