{"id":13587244,"url":"https://github.com/geoserver/docker","last_synced_at":"2025-05-16T05:00:18.337Z","repository":{"id":38353058,"uuid":"209116917","full_name":"geoserver/docker","owner":"geoserver","description":"GeoServer docker image","archived":false,"fork":false,"pushed_at":"2025-05-06T06:55:39.000Z","size":944,"stargazers_count":229,"open_issues_count":6,"forks_count":123,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-10T00:33:44.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geoserver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-17T17:30:11.000Z","updated_at":"2025-05-07T02:12:15.000Z","dependencies_parsed_at":"2023-11-13T16:28:22.375Z","dependency_job_id":"5c299d14-a5e5-4adf-b070-2466df4769f4","html_url":"https://github.com/geoserver/docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoserver%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoserver%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoserver%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoserver%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoserver","download_url":"https://codeload.github.com/geoserver/docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:06:07.200Z","updated_at":"2025-05-16T05:00:18.210Z","avatar_url":"https://github.com/geoserver.png","language":"Shell","readme":"# A GeoServer docker image\n\nThis Dockerfile can be used to create images for all geoserver versions since 2.5.\n\n* Based on the official [`tomcat` docker image](https://hub.docker.com/_/tomcat), in particular:\n  * Tomcat 9\n  * JDK17 (eclipse temurin)\n  * Ubuntu Jammy (22.04 LTS)\n* GeoServer installation is configurable and supports\n  * Dynamic installation of extensions\n  * Custom fonts (e.g. for SLD styling)\n  * CORS\n  * Additional libraries\n  * PostgreSQL JNDI\n  * HTTPS\n  * GDAL with Java Bindings\n\nThis README.md file covers use of official docker image, additional [build](BUILD.md) and [release](RELEASE.md) instructions are available.\n\n## How to run official release?\n\nTo pull an official image use ``docker.osgeo.org/geoserver:{{VERSION}}``, e.g.:\n\n```shell\ndocker pull docker.osgeo.org/geoserver:2.27.0\n```\nAll the images can be found at: [https://repo.osgeo.org](https://repo.osgeo.org/#browse/browse:geoserver-docker:v2/geoserver/tags) and the latest stable and maintenance version numbers can be obtained from [https://geoserver.org/download/](https://geoserver.org/download/)\n\nAfterwards you can run the pulled image locally with:\n\n```shell\ndocker run -it -p 80:8080 docker.osgeo.org/geoserver:2.27.0\n```\n\nOr if you want to start the container daemonized, use e.g.:\n\n```shell\ndocker run -d -p 80:8080 docker.osgeo.org/geoserver:2.27.0\n```\n\nCheck \u003chttp://localhost/geoserver\u003e to see the geoserver page,\nand login with geoserver default `admin:geoserver` credentials.\n\n**IMPORTANT NOTE:** Please change the default ``geoserver`` and ``master`` passwords.\n\nFor more information see the user-guide [docker installation instructions](https://docs.geoserver.org/latest/en/user/installation/docker.html).\n\n## How to mount an external folder for use as a data directory\n\nTo use an external folder as your geoserver data directory.\n\n```shell\ndocker run -it -p 80:8080 \\\n  --mount src=\"/absolute/path/on/host\",target=/opt/geoserver_data/,type=bind \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\nAn empty data directory will be populated on first use. You can easily update GeoServer while\nusing the same data directory.\n\n## How to start a GeoServer without sample data?\n\nThis image populates ``/opt/geoserver_data/`` with demo data by default. For production scenarios this is typically not desired.\n\nThe environment variable `SKIP_DEMO_DATA` can be set to `true` to create an empty data directory.\n\n```shell\ndocker run -it -p 80:8080 \\\n  --env SKIP_DEMO_DATA=true \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\n## How to set the application context path?\n\nBy default, GeoServer is served from \u003chttp://localhost/geoserver\u003e. Use the environment variable `WEBAPP_CONTEXT` to change the context path.\n\nexamples:\n\nThe following will serve GeoServer from the root (\u003chttp://localhost/\u003e):\n```shell\ndocker run -it -p 80:8080 \\\n  --env WEBAPP_CONTEXT=\"\" \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\nThe following will serve GeoServer from \u003chttp://localhost/my_context_path\u003e:\n```shell\ndocker run -it -p 80:8080 \\\n  --env WEBAPP_CONTEXT=\"my_context_path\" \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\n## How to issue a redirect from the root (\"/\") to GeoServer web interface (\"/geoserver/web\")?\n\nBy default, the ROOT webapp is not available which makes requests to the root endpoint \"/\" return a 404 error.\nThe environment variable `ROOT_WEBAPP_REDIRECT` can be set to `true` to issue a permanent redirect to the web interface.\n\n## How to download and install additional extensions on startup?\n\nThe ``startup.sh`` script allows some customization on startup:\n\n* ``INSTALL_EXTENSIONS`` to ``true`` to download and install extensions\n* ``STABLE_EXTENSIONS`` list of extensions to download and install\n* ``CORS_ENABLED`` to ``true`` to enable CORS support. The following environment variables can be used to customize the CORS configuration.\n  * ``CORS_ALLOWED_ORIGINS`` (default ``*``)\n  * ``CORS_ALLOWED_METHODS`` (default ``GET,POST,PUT,DELETE,HEAD,OPTIONS``)\n  * ``CORS_ALLOWED_HEADERS`` (default ``Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers``)\n  * ``CORS_ALLOW_CREDENTIALS`` (default ``false``) **Setting this to ``true`` will only have the desired effect if ``CORS_ALLOWED_ORIGINS`` defines explicit origins (not ``*``)**\n* ``PROXY_BASE_URL`` to the base URL of the GeoServer web app if GeoServer is behind a proxy. Example: ``https://example.com/geoserver``.\n\nThe CORS variables customize tomcat's `web.xml` file. If you need more customization,\nyou can provide your own customized `web.xml` file to tomcat by mounting it into the container\nat `/opt/config_overrides/web.xml`.\n\nExample installing wps and ysld extensions:\n\n```shell\ndocker run -it -p 80:8080 \\\n  --env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS=\"wps,ysld\" \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\nThe list of extensions (taken from SourceForge download page):\n\n```shell\napp-schema   gdal            jp2k          ogr-wps          web-resource\nauthkey      geofence        libjpeg-turbo oracle           wmts-multi-dimensional\ncas          geofence-server mapml         params-extractor wps-cluster-hazelcast\ncharts       geopkg-output   mbstyle       printing         wps-cluster-hazelcast\ncontrol-flow grib            mongodb       pyramid          wps-download\ncss          gwc-s3          monitor       querylayer       wps-jdbc\ncsw          h2              mysql         sldservice       wps\ndb2          imagemap        netcdf-out    sqlserver        xslt\ndxf          importer        netcdf        vectortiles      ysld\nexcel        inspire         ogr-wfs       wcs2_0-eo\n```\n\n## How to install additional extensions from local folder?\n\nIf you want to add geoserver extensions/libs, place the respective jar files in a directory and mount it like\n\n```shell\ndocker run -it -p 80:8080 \\\n  --mount src=\"/dir/with/libs/on/host\",target=/opt/additional_libs,type=bind \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\n## How to add additional fonts to the docker image (e.g. for SLD styling)?\n\nIf you want to add custom fonts (the base image only contains 26 fonts) by using a mount:\n\n```shell\ndocker run -it -p 80:8080 \\\n  --mount src=\"/dir/with/fonts/on/host\",target=/opt/additional_fonts,type=bind \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\n**Note:** Do not change the target value!\n\n\n## How to enable a PostgreSQL JNDI resource?\n\nTo enable a PostgreSQL JNDI resource, provide the following environment variables:\n\n* ``POSTGRES_JNDI_ENABLED`` to ``true``\n* ``POSTGRES_HOST``\n* ``POSTGRES_PORT`` (optional; defaults to 5432)\n* ``POSTGRES_DB``\n* ``POSTGRES_USERNAME``\n* ``POSTGRES_PASSWORD``\n* ``POSTGRES_JNDI_RESOURCE_NAME`` (optional; defaults to ``jdbc/postgres``)\n\nIn geoserver, you can then reference this JNDI resource using the name `java:comp/env/jdbc/postgres` (if using default).\n\nNote: previously you could tweak the JNDI settings in a custom `context.xml` (see below), but its contents are now included in `server.xml`.\n\n\n## How to use custom (tomcat) configuration files\n\nThis image provides default (tomcat) configurations that are located in the `./config/` subdir.\n\n* `server.xml` (security hardened version by default)\n* ~context.xml~ (now included into `server.xml`, previously used for JNDI settings)\n\nIn case you want to fully overwrite such a config file, you can do so by mounting it to the `/opt/config_overrides/` directory of a container.\nThe `startup.sh` script will then copy (and overwrite) these files to the catalina conf directory before starting tomcat.\n\nExample:\n\n```shell\ndocker run -it -p 80:8080 \\\n  --mount src=\"/path/to/my/server.xml\",target=/opt/config_overrides/server.xml,type=bind \\\n  docker.osgeo.org/geoserver:2.27.0\n```\n\n## How to enable HTTPS?\n\nTo enable HTTPS, mount a JKS file to the container (ex. `/opt/keystore.jks`) and provide the following environment\nvariables:\n\n* ``HTTPS_ENABLED`` to `true`\n* ``HTTPS_KEYSTORE_FILE`` (defaults to `/opt/keystore.jks`)\n* ``HTTPS_KEYSTORE_PASSWORD`` (defaults to `changeit`)\n* ``HTTPS_KEY_ALIAS`` (defaults to `server`)\n\n## How to run it as a non-privileged user ?\n\nIt is usually considered a good practice to run the containers as a non-privileged user (not `root`).\nWhile it runs by default as root, for backwards compatibility reasons, several environment variables allow you to change this behaviour:\n- `RUN_UNPRIVILEGED=true`: run as unprivileged user `tomcat`. Default uid:gid are 999:999\n- `RUN_WITH_USER_UID` allows you to set `tomcat`'s uid. By default this is 999.\n- `RUN_WITH_USER_GID` allows you to set `tomcat`'s gid. By default this is the same as the uid.\n- `CHANGE_OWNERSHIP_ON_FOLDERS` sets a space-separated list of folders on which a `chmod -R` will be run, changing the ownership of those folders to the `tomcat` user (defaults to `\"/opt $GEOSERVER_DATA_DIR\"`).\n\n## How to use the docker-compose demo?\n\nThe ``docker-compose-demo.yml`` to build with your own data directory and extensions.\n\nStage geoserver data directory contents into ``geoserver_data``, and any extensions into ``additional_libs`` folder.\n\nRun ``docker-compose``:\n\n```shell\ndocker-compose -f docker-compose-demo.yml up --build\n```\n## Environment Variables\n\nFollowing is the list of the all the environment variables that can be passed down to the geoserver docker image, you can check the default values for an image using `docker inspect [IMAGE_NAME]`\n| VAR NAME | DESCRIPTION | SAMPLE VALUE |\n|--------------|-----------|------------|\n| PATH | Used by geoserver internally to find all the libs | `/usr/local/sbin:/usr/local/bin:` |\n| CATALINA_HOME | CATALINA home path | `/usr/local/tomcat` (see also [here](https://github.com/docker-library/tomcat/blob/master/9.0/jdk11/temurin-jammy/Dockerfile)) |\n| EXTRA_JAVA_OPTS | Used to pass params to the JAVA environment. Check [ref](https://docs.oracle.com/en/java/javase/11/tools/java.html) | `-Xms256m -Xmx1g` |\n| CORS_ENABLED | CORS enabled configuration | `false` |\n| CORS_ALLOWED_ORIGINS | CORS origins configuration | `*` |\n| CORS_ALLOWED_METHODS | CORS method configuration | `GET,POST,PUT,DELETE,HEAD,OPTIONS` |\n| CORS_ALLOWED_HEADERS | CORS headers configuration | `Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers` |\n| DEBIAN_FRONTEND | Configures the Debian package manager frontend | `noninteractive`|\n| CATALINA_OPTS | Catalina options. Check [ref](https://www.baeldung.com/tomcat-catalina_opts-vs-java_opts) | `-Djava.awt.headless=true` |\n| GEOSERVER_DATA_DIR | Geoserver data directory location | `/opt/geoserver_data/` |\n| GEOSERVER_REQUIRE_FILE | Path to a file that will be passed to GeoServer. If this file does not exist, GeoServer won't start. |  |\n| SET_GEOSERVER_REQUIRE_FILE | If set to true, the GEOSERVER_REQUIRE_FILE will be automatically set to `$GEOSERVER_DATA_DIR/global.xml` on startup. If GEOSERVER_REQUIRE_FILE is set it will take precedence. | `true` |\n| INSTALL_EXTENSIONS | Indicates whether additional GeoServer extensions should be installed | `false` |\n| WAR_ZIP_URL | Specifies the URL for a GeoServer Web Archive (WAR) file | |\n| STABLE_EXTENSIONS | Specifies stable GeoServer extensions | |\n| STABLE_PLUGIN_URL | Specifies the URL for downloading the latest stable GeoServer plugins | `https://build.geoserver.org/geoserver/2.26.x/ext-latest` |\n| COMMUNITY_EXTENSIONS | Specifies community-contributed GeoServer extensions | |\n| COMMUNITY_PLUGIN_URL | Specifies the URL for downloading the latest community-contributed GeoServer plugins | `https://build.geoserver.org/geoserver/2.26.x/community-latest` |\n| ADDITIONAL_LIBS_DIR | Sets the directory for additional libraries used by GeoServer | `/opt/additional_libs/` |\n| ADDITIONAL_FONTS_DIR | Sets the directory for additional fonts used by GeoServer | `/opt/additional_fonts/` |\n| SKIP_DEMO_DATA | Indicates whether to skip the installation of demo data provided by GeoServer. GEOSERVER_REQUIRE_FILE will be ignored if set to true. | `false` |\n| ROOT_WEBAPP_REDIRECT | Indicates whether to issue a permanent redirect to the web interface | `false` |\n| HEALTHCHECK_URL | URL to the resource / endpoint used for `docker` health checks | `http://localhost:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/img/logo.png` |\n| GEOSERVER_ADMIN_USER | Admin username |   |\n| GEOSERVER_ADMIN_PASSWORD | Admin password |  |\n| RUN_UNPRIVILEGED | If set to `true`, runs as an unprivileged user `tomcat` instead of `root`. | `true` |\n| RUN_WITH_USER_UID | When running as unprivileged user, sets the uid of this user. Defaults to `999` | `999` |\n| RUN_WITH_USER_GID | When running as unprivileged user, sets the gid of this user. Defaults to the same as the uid | `999` |\n| CHANGE_OWNERSHIP_ON_FOLDERS | When running as unprivileged user, changes the ownership to this user to these folders | `\"/opt /opt/geoserver_data/ /mnt/geoserver_geodata\"` |\n\nAfter the initial setup, it's recommended to remove the `GEOSERVER_ADMIN_USER` and `GEOSERVER_ADMIN_PASSWORD` variable. Otherwise, newly added roles and users may be overwritten by the next time the container is restarted.\n\nThe following values cannot really be safely changed (as they are used to download extensions and community modules as the docker image first starts up).\n| VAR NAME | DESCRIPTION | SAMPLE VALUE |\n|--------------|-----------|------------|\n| GEOSERVER_VERSION | Geoserver version (used internally) | `2.24-SNAPSHOT`|\n| GEOSERVER_BUILD | Geoserver build (used internally) | `1628` |\n\n## Troubleshooting\n\n### How to watch geoserver.log from host?\n\nTo watch ``geoserver.log`` of a running container:\n\n```shell\ndocker exec -it {CONTAINER_ID} tail -f /opt/geoserver_data/logs/geoserver.log\n```\n","funding_links":[],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoserver%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoserver%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoserver%2Fdocker/lists"}