Where Does GeoServer Store Workspaces and Data?
GeoServer keeps all workspaces, stores, layers, and styles in its data directory (GEOSERVER_DATA_DIR), defaulting beside the install with security and logs inside.
Last updated
GeoServer separates code from data through one directory: the data dir. Workspaces, data stores, layers, styles, and security rules all live beneath it. Pointing GEOSERVER_DATA_DIR elsewhere is the standard move before the server ever starts.
Upgrades assume this split. New versions replace the application while the data directory carries forward untouched. Installs that left data inside the webapp folder learn this the hard way during the first major upgrade.
Where GeoServer stores this, by platform
/opt/geoserver/data_dir
Workspaces, stores, styles, and security in one tree. Set GEOSERVER_DATA_DIR outside the install. Back up whole with service stopped.
Frequently asked questions
How do I back up GeoServer?
Copy the whole data directory with GeoServer stopped, since workspaces reference styles and stores by relative paths. Restoring means pointing GEOSERVER_DATA_DIR at the copy. Database backed stores need their own dumps too.
Should the data dir live outside the install?
Set GEOSERVER_DATA_DIR to an outside folder before first start, or move it later with the service stopped. Upgrades then replace code without touching data. Never store the only copy inside the webapp folder.
Notice an outdated path? Let us know.