1. configuring an external data directory in Geoserver
  2. By default, Geoserver uses a data directory under webapps/. This is, of course, ridiculous for persistence purposes, as on each undeploy all data are lost. To configure an external data directory able to survive undeployments, you need to edit WEB-INF/web.xml and set the value of the context parameter GEOSERVER_DATA_DIR to point to that directory. E.g.:

       <context-param>
          <param-name>GEOSERVER_DATA_DIR</param-name>
           <param-value>/mnt/some-other-disk/geoserver-data</param-value>
       </context-param>

    Purportedly setting and exporting the environment variable GEOSERVER_DATA_DIR on the shell from which Tomcat is launched has the same effect but my experience was to the contrary.

  3. restore the root password in GeoServer
  4. After trying various suggestions on how to restore the root password in Geoserver, in the end, what did the trick was deleting the entire data/security directory at which point the default settings were restored.

  5. address logout and login problems
  6. In January 2025 while working with a GeoServer I had installed locally for my own development where I had simply copied over the data/ directory of a production GeoServer (after having erased, first, the local data directory) I encountered problems in logout and, I belive, login which I addressed by editing file webapps/geoserver/data/global.xml and:

    As a matter of fact, I don't think the second part was necessary.

  7. allow login with the root user in Geoserver
  8. provenance (tried January 2025)

    Login via master password has been disabled by default back in 2018, see GEOS-8928: Disable master password Admin GUI login by default In order to enable root login, take the following steps:

    1. Open “Passwords” in the Security sub-menu
    2. Open the master password provider (clicking on “default”)
    3. Select the “allow root user to login as admin” checkbox (unchecked by default)
    4. Log-out as admin, and try to log in back as “root”. You should succeed.

    It should be noted that the effect of the above instructions results in a change in the contents of file security/masterpw/default/config.xml which is to be found in GeoServer' data directory. Specifically, the following element is added:

    <loginEnabled>true</loginEnabled>

    If you have lost the ability to get in as admin, you can enable the root login by going to the data directory, get into “security/masterpw/default”, open “config.xml” and switch loginEnabled to true. Then probably restart (not 100% sure it’s needed) and you should be able to login.

  9. installation of GeoServer 2.26.2 on Ubuntu 20.04 (January 2024)
  10. NB: the below instructions assume that Java 11 is already installed (I had the OpenJDK version).

    Contrary to representations on this page which declare that "GeoServer [2.26.x] requires a newer version of Tomcat (7.0.65 or later) that implements Servlet 3 [...]" I nevertheless encountered this problem which shows that GeoServer 2.26.2 is incompatible with Tomcat 10.1.34. As advised in the currently accepted solution I therefore installed Tomcat 9.0.98 using the procedure described below and found GeoServer to run fine with it.

    1. download and explode the apache-tomcat-9.0.98.tar.gz tarball.
    2. enter into the /bin directory and create file setenv.sh as described in RUNNING.txt with the following contents:
      CATALINA_HOME=/media/hddb/software/apache-tomcat/apache-tomcat-9.0.98/
      CATALINA_BASE=/media/hddb/software/apache-tomcat/apache-tomcat-9.0.98/
      JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
    3. at this point Apache Tomcat can be started by running the bin/startup.sh script
    4. edit the conf/tomcat-users.xml file to activate the admin user for the manager-gui role
    5. I then downloaded the GeoServer web archive version from here in the form of file geoserver-2.26.2-war.zip
    6. I unzipped said file and simply copyied the *.war that was inside under the webapps directory in Tomcat.
    7. pointing my browser at http://localhost:8080/geoserver I saw that GeoSserver was indeed availabe.