Using Docker

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

There is a public Docker image available at and it is the easiest way yo get OpenKM running on your server.

Please, refer to Docker documentation for installation instructions and to learn more about Docker.

Once Docker has been installed, just execute this command to get your OpenKM CE instance:

$ docker run --name openkm-ce -p 8080:8080 openkm/openkm-ce

And after that, point your browser at http://localhost:8080/. The default user and password is "okmAdmin" / "admin".

Using other databases

The default database used in this image is H2 which is an embedded which we don't recommend for production. To use another database you need to customize a couple of files and make available to Docker container:

  • OpenKM.cfg
  • conf/server.xml

These databases are supported:

  • MariaDB
  • MySQL
  • Oracle
  • PostgreSQL
  • SQL Server

Sample configuration

This Docker Compose will start OpenKM with MySQL:

version: '3.2'

    image: openkm/openkm-ce:6.3.9
      - 8080:8080   
      - ${PWD}/server.xml:/opt/tomcat/conf/server.xml
      - ${PWD}/OpenKM.cfg:/opt/tomcat/OpenKM.cfg
      - ${PWD}/repository:/opt/tomcat/repository
      - mysql:mysql

    image: mysql:8.0.13
    command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_bin
      - MYSQL_DATABASE=okmdb
      - MYSQL_USER=openkm
      - MYSQL_PASSWORD=openkm
      - MYSQL_ROOT_PASSWORD=openkm
      - seccomp:unconfined
      - ${PWD}/mysql:/var/lib/mysql

 This would be the content of the OpenKM.cfg file:

# OpenKM Hibernate configuration values

# Logback configuration file

And this is the content of the server.xml file:

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources -->
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    <Resource name="UserDatabase" auth="Container"
              description="User database that can be updated and saved"
              pathname="conf/tomcat-users.xml" />

    <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
            maxTotal="100" maxIdle="30" maxWaitMillis="10000" validationQuery="select 1"
            username="openkm" password="openkm" driverClassName="com.mysql.cj.jdbc.Driver"

    <Resource name="mail/OpenKM" auth="Container" type="javax.mail.Session"
    "localhost" mail.from=""/>


  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
  <Service name="Catalina">
    <Connector port="8080" address="" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" address="" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">
      <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

        <!-- External resources -->
        <!-- <Context docBase="${catalina.home}/custom" path="/OpenKM/custom" reloadable="true"/> -->

Once configured, you can start OpenKM and the database with Docker Compose:

$ docker-compose up -d

And check the logs with:

$ docker-compose logs -f