GeoServer Data Directory

GeoServer Tutorials > Change Data Directory Location

You should move the Data Directory from it's default location inside of the GeoSever webapp to a location outside of GeoServer.

Below applies to both GeoServer cPanel and GeoServer Dedicated.

 

Be sure to substitute your own paths and file names for below.

 

1. Stop Tomcat

 

2. Connect via SSH and copy the data directory as below: (Important: the target directory - 'geodata' below - should not exist.)
cp -a /home/tomcat/apache-tomcat-9.0.70/webapps/geoserver/data/ /var/lib/geodata/

 

3. The above command should maintain ownership and permissions. If it does not for any reasons, issue below
chown -R tomcat:tomcat /var/lib/geodata/

 

4. Add the following to your GeoServer web.xml file:
<context-param>
<param-name>GEOSERVER_DATA_DIR</param-name>
<param-value>/var/lib/geodata</param-value>
</context-param> <context-param>
<param-name>GEOSERVER_REQUIRE_FILE</param-name>
<param-value>/var/lib/geodata/global.xml</param-value>
</context-param>

 

5. Start Tomcat

You should log into GeoServer and verify that your workspaces, etc.. are accesible.

 

 

 

Clients and Sectors

AcuGIS provides GIS Hosting Services to customers in over 80 countries worlwide.

International

International governmental institutions. Email gov@acugis.com

Government

Local, State, and Federal Governments. Email gov@acugis.com

Academia

iscounts for Academic institutions. Email edu@acugis.com

NGO

Non-Governmental Organizations. Email edu@acugis.com

Research

Public and Private Research institutions. Email edu@acugis.com

Developers

Developer-friendly tools and great features