Introduction

GeoServer is an open-source software server written in Java that allows users to share and edit geospatial data. Built on top of the MapServer project and the Geotools library, GeoServer publishes data from any major data source using open standards defined by the Open Geospatial Consortium (OGC).

Whether you're building interactive web maps, integrating spatial data into existing applications, or exposing geographic data through standard protocols, GeoServer provides a robust foundation for your geospatial infrastructure.

💡

Who is this guide for?

This guide assumes you have basic familiarity with web technologies and geographic concepts. No prior GeoServer experience is required.

What GeoServer Can Do

  • Serve vector data — Points, lines, and polygons via WFS (Web Feature Service)
  • Render map images — Tile or dynamic map images via WMS (Web Map Service)
  • Expose coverage data — Raster imagery and elevation data via WCS (Web Coverage Service)
  • Manage styles — Define how data appears using SLD (Styled Layer Descriptor)
  • Support multiple formats — Shapefiles, PostGIS, GeoTIFF, KML, GeoJSON, and more

Prerequisites

Before installing GeoServer, make sure your environment meets the following requirements:

1

Java Runtime Environment (JRE)

GeoServer requires Java 11 or later (Java 17 LTS recommended). Verify your installation:

Terminal
$ java -version openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-122.04) OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-122.04, mixed mode)
2

Memory & Disk Space

GeoServer runs comfortably with 1GB RAM allocated (2GB+ recommended for production). Ensure at least 500MB of free disk space for the application and data.

3

Web Server or Jetty

GeoServer is a Java web application (.war) that runs on any servlet container. The standalone distribution bundles Jetty, making it the easiest option for beginners.

Installation

The simplest way to get started is with the GeoServer Standalone distribution. It includes Jetty, the GeoServer web application, and everything needed to run out of the box.

Step-by-Step Installation

1

Download GeoServer

Visit the GeoServer download page and grab the latest binary release. For this guide, we use version 2.26.1.

Terminal
$ wget https://sourceforge.net/projects/geoserver/files/GeoServer/2.26.1/geoserver-2.26.1-bin.zip $ unzip geoserver-2.26.1-bin.zip $ cd geoserver-2.26.1
2

Start the Server

Navigate to the bin directory and run the startup script:

Terminal — Linux / macOS
$ cd bin $ ./startup.sh GeoServer 2.26.1 started.

On Windows, run startup.bat instead.

3

Verify the Installation

Open your browser and navigate to:

Browser URL
http://localhost:8080/geoserver/web

You should see the GeoServer welcome page with the demo map.

Default Login Credentials

Username: admin | Password: geoserver
Change these immediately after your first login!

⚠️

Production Warning

The standalone Jetty distribution is intended for development and testing. For production deployments, use Tomcat, Jetty standalone, or your preferred servlet container with proper security hardening.

Publishing Your First Layer

Now that GeoServer is running, let's publish a dataset. We'll walk through adding a data store and publishing a layer using the web administration interface.

1. Create a Workspace

Workspaces organize your data. Think of them as namespaces for your layers.

  1. Log in to the GeoServer web UI
  2. Navigate to Workspaces in the left sidebar
  3. Click Add new workspace
  4. Enter a name (e.g., myproject) and an optional namespace URI
  5. Click Save

2. Add a Data Store

A data store connects GeoServer to your source data. For this example, we'll use a PostgreSQL/PostGIS database:

  1. Go to Data → Stores
  2. Click Add new store
  3. Select PostGIS Database (requires the PostGIS plugin)
  4. Configure the connection parameters:
Data Store Configuration
# PostGIS Connection Parameters Host: localhost Port: 5432 Database: my_geodata Schema: public User: geoserver_user Password: **** DB Type: PostgreSQL / PostGIS

3. Publish a Layer

Once your data store is connected, you can publish individual layers:

  1. Under Layers, find your new store and click Add a published layer from new data store
  2. Select the table/view you want to publish (e.g., roads)
  3. GeoServer will auto-detect the bounding box and native format
  4. Click Save
💡

Quick Preview

After publishing, click the Layer Preview link to test your layer. GeoServer generates WMS, WFS, KML, and GeoJSON preview URLs automatically.

REST API Basics

GeoServer includes a powerful REST API that lets you manage your server configuration programmatically. Here are some essential endpoints:

Check Server Status

REST API — Status Check
GET http://localhost:8080/geoserver/rest/status/version.xml # Response: <status> <geo_version>2.26.1</geo_version> <build>2024-01-15 14:30</build> </status>

List All Workspaces

REST API — List Workspaces
GET http://localhost:8080/geoserver/rest/workspaces.xml # Create a workspace via cURL: $ curl -u admin:geoserver -XPOST \ -H "Content-Type: text/xml" \ -d '<workspace><name>newproject</name></workspace>' \ http://localhost:8080/geoserver/rest/workspaces

Publish a Shapefile via REST

REST API — Publish Shapefile
$ curl -u admin:geoserver -XPUT \ -H "Content-Type: application/zip" \ --data-binary @shapefile.zip \ http://localhost:8080/geoserver/rest/workspaces/myproject/\ datastores/mydata/file.shp # Create the layer resource: $ curl -u admin:geoserver -XPOST \ -H "Content-Type: text/xml" \ -d '<featureType> <name>myshapefile</name> <srs>EPSG:4326</srs> </featureType>' \ http://localhost:8080/geoserver/rest/workspaces/myproject/\ datastores/mydata/featuretypes
🔗

REST API Explorer

GeoServer includes a built-in REST API Explorer. Access it at http://localhost:8080/geoserver/rest/api/ to discover all available endpoints.