Setting up a local environment

OGC API modules are still developing. Various core specifications are now finalized, along with a few extra parts, but a number of API and parts are still in draft form and their behavior is likely to change in the next months/year. As a result, some OGC API modules are GeoServer extensions, while others are community modules.

This section explains how to get a GeoServer with OGC APIs ready for the workshop.

Using an online demo server

If you don’t feel like installing this on your machine, a demo server is available from GeoSolutions that ships with the OGC APIs, but mind, it may not be online at all times.

Docker setup

The quickest approach to start a GeoServer with OGC APIs is to run it as a docker image:

docker pull docker.osgeo.org/geoserver:2.27.x
docker run --name gs-ogcapi -it -p8083:8080 --env INSTALL_EXTENSIONS=true \
--env STABLE_EXTENSIONS="ogcapi-features,wps,vectortiles" \
--env COMMUNITY_EXTENSIONS="ogcapi-coverages,ogcapi-maps,ogcapi-styles,ogcapi-tiles,ogcapi-processes" \
docker.osgeo.org/geoserver:2.27.x

Manual installation

  1. Make sure you have a Java Runtime Environment (JRE) installed on your system. GeoServer requires a Java 11 environment (or optionally, a Java 17 or Java 21 one), as provided by the Adoptium open source project.
  2. Download the geoserver-2.27.x-latest-bin.zip. Unzip it in a directory of your choice.
  3. Download the geoserver-2.27-SNAPSHOT-ogcapi-features-plugin.zip.
  4. Download all the necessary geoserver-<version>-SNAPSHOT-ogcapi-<service>-plugin.zip.
  5. Unzip all their content in the webapps/geoserver/WEB-INF/lib folder of your GeoServer directory.
  6. In the GeoServer bin directory, locate the start.ini file, open it, and change the property jetty.http.port to 8083, so as not to conflict with other applications that might be running on 8080. The rest of this training assumes GeoServer is running on port 8083.

Setting environment variables

You will need to set the JAVA_HOME environment variable if it is not already set. This is the path to your JRE such that %JAVA_HOME%\bin\java.exe exists.

To set the JAVA_HOME in Linux/OSX run the following commands:

  1. export JAVA_HOME=/path/to/jre
  2. export PATH=$JAVA_HOME/bin:$PATH

To set the JAVA_HOME in Windows:

  1. Navigate to Control Panel ‣ System ‣ Advanced ‣ Environment Variables.
  2. Under System variables click New.
  3. For Variable name enter JAVA_HOME. For Variable value enter the path to your JDK/JRE.
  4. Click OK three times.

Running

To start GeoServer:

  • On Linux/OSX open the terminal, navigate to the root directory of you GeoServer installation and run bin/startup.sh.
  • On Windows run startup.bat inside the bin folder. A command-line window will appear and persist. This window contains diagnostic and troubleshooting information. This window must be left open, otherwise GeoServer will shut down.

Once GeoServer is running:

  1. Navigate to http://localhost:8083/geoserver to access the GeoServer home.
  2. Check that ogcapi modules are installed by looking on the left side of the GeoServer home page. Under the section Service Capabilities you should have the following links:
../_images/ogcapi-services.png

Stopping

To shut down GeoServer:

  • On Linux/OSX press CTRL-C on the terminal where GeoServer is running.
  • On Windows either close the persistent command-line window, or run the shutdown.bat file inside the bin directory.

Uninstallation

When you are done exploring OGC APIs, if you wish to, it’s possible to remove the GeoServer as follows:

  1. Stop GeoServer (if it is running).
  2. Delete the directory where GeoServer is installed.