Configuring Database management

GeoNetwork Enterprise is bundle with a H2 database, the following sections describe how to configure GeoNetwork to use your database. The database connection can be configured using Java Naming and Directory Interface (JNDI) or a direct database connection.

Java Naming and Directory Interface (JNDI) configuration

Java Naming and Directory Interface (JNDI) provides naming and directory functionality to applications written in Java and is the optimal choice in production situations, because it doesn’t require configuration script updates at (re)deployment. JNDI is set up at the container level (e.g. Tomcat).

To configure GeoNetwork to use JNDI, follow these steps:

  1. Add in JAVA_OPTS the following parameter.


    As an alternative can be defined the following environmental variable: GEONETWORK_DB_TYPE.

    export GEONETWORK_DB_TYPE=jndi
  2. Download one of the following geonetwork.xml files, depending on the database that you are using.

  3. Copy the file to the $CATALINA_HOME/conf/Catalina/localhost folder.

  4. Place the corresponding jar for the driver you want to use in the $CATALINA_HOME/lib folder. JDBC drivers can be obtained for the different databases:

Postgres JNDI configuration example

For a Postgres database use the corresponding file linked above, configuring the following parameters:

  • url: JDBC connection string for Postgresql database, typically fill the hostname/port/database name. See additional parameters in

  • username: database username with read/write permissions in the database

  • password: database user password.

  • For other parameters check additional documentation in

      <Environment name="gnDatabaseDialect" value="POSTGRESQL" type="java.lang.String" override="false"/>
      <Resource name="jdbc/geonetwork" auth="Container"
                type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
                username="postgres" password="postgres"
                maxActive="20" maxIdle="10" defaultAutoCommit="false" maxWait="-1"/>

Once configured, copy the file it to $CATALINA_HOME/conf/Catalina/localhost.

Copy the Postgresql JDBC driver to $CATALINA_HOME/lib.

Postgis support

Additionally if you want to enable the spatial index to be stored in Postgis, you should add the Postgis extension to your database:


See additional details in

And uncomment the following Spring beans in the file $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-db/jndi.xml:

<!-- Enable for PostGis configuration with JNDI -->
<bean id="datastoreFactory" class=""/>
<bean id="datastore" factory-bean="datastoreFactory" factory-method="createDataStore">
     <description>The datastore factory parameters see Geotools documentation for details.
     <entry key="dbtype" value="postgis"/>
     <entry key="Data Source" value-ref="jdbcDataSource"/>
     <entry key="Loose bbox" value="true"/>
     <entry key="Estimated extends" value="true"/>
     <entry key="encode functions" value="true"/>
     <entry key="validate connections" value="true"/>
     <entry key="fetch size" value="1000"/>
     <entry key="Expose primary keys" value="true"/>

Direct database connection

Using JAVA_OPTS, adding the following parameters:

  • Type of database (geonetwork.db). Valid values are : h2, postgres, sqlserver, mysql, oracle, db2, postgres-postgis.

    Example for postgres:

  • Database connection parameters:

    • jdbc.database=DATABASE_NAME

    • jdbc.username=DATABASE_USERNAME

    • jdbc.password=DATABASE_PASSWORD


    • jdbc.port=DATABASE_PORT

    Postgres connection example:


Alternatively can be configured using environment variables. The following environment variable can also be for connecting to the database:








Postgres connection example:

export GEONETWORK_DB_TYPE=postgres
export GEONETWORK_DB_HOST=localhost
export GEONETWORK_DB_NAME=geonetworkdb
export GEONETWORK_DB_USERNAME=geonetwork
export GEONETWORK_DB_PASSWORD=mypassword

Postgres and MySql JDBC drivers are bundled with GeoNetwork, for other databases it is required to download them and copy to $CATALINA_HOME/webapps/geonetwork/WEB-INF/lib.