I want to run GeoServer 2.14 with Jetty on a Ubuntu 18.04. I copied the war-file in the webapps folder and GeoServer is responding.

Unfortunately I can not set the data directory location as described in the GeoServer docs.

I appended the following line to /etc/environment:


After logging in to the system the variable is set as expected:


I also created the folder /opt/geoserver_data:

#ls -la /opt/geoserver_data
total 8
drwxr-xr-x 2 root root 4096 Nov 12 15:20 .
drwxr-xr-x 5 root root 4096 Nov 12 15:20 ..

When I restart Jetty, the first two GeoServer log lines are:

INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-
INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-

This is strange because according to the GeoServer source code, there should be a warning that the given folder does not exist or is not writable.

Obviously I am doing something wrong, but I have no idea what?

Based on Ian Turton's answer, I ensured that jetty is not run as root. Furthermore I start jetty now with -DGEOSERVER_DATA_DIR=/opt/geoserver_data, which is easier to handle than a system variable.

At the moment I still get the following warning messages:

WARN [geoserver.platform] - Found Java environment variable GEOSERVER_DATA_DIR set to /opt/geoserver_data , which is not writeable
INFO [geoserver.platform] - Falling back to embedded data directory: /tmp/jetty-

But at least the expected warning is shown. Although the fallback data directory still looks odd.


The most likely issue is that the user running jetty doesn't have write/execute permission to /opt/geoserver_data. If you are running jetty as root then please don't!

Next, most likely is that the user running jetty doesn't run a shell that sources /etc/environment as part of its start up.

Finally, your fallback jetty data directory looks odd, /tmp/jetty- looks like you have not unpacked the platform independent binary properly. I would expect to see something like /tmp/geoserver-2.14.0/data_dir if you had unpacked it in /tmp.


I found that a recent update to jetty9 in Ubuntu has added the entries




which then prevents GeoServer from using an external data directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.