Configure GEOSERVER_DATA_DIRECTORY to point to an external folder.¶
The data directory where GeoServer stores the its data is configured by default to a folder within the installation webapps folder. For a production server, you must define a different folder located outside of that, in a different location within your file system.
The data directory is defined using an context parameters named GEOSERVER_DATA_DIRECTORY. Follow this steps to add it.
-
Under your GeoServer installation folder, find the
WEB-INF/web.xmlfile. -
Open it and add the following block to define the context parameter (replace
var/lib/geoserver_datawith your data folder path) -
Restart your GeoServer instance for the new configuration to take effect.