Configure Jetty for XWiki in Docker

Last modified by Eleni Cojocariu on 2026/07/13 17:35

Steps

Warning

WIP

To run XWiki on the official Jetty Docker image:

  1. Download the XWiki WAR file for the version you need.
  2. Extract the WAR file into a directory named xwiki. This directory is referred to as XWIKI_HOME.
  3. Create a directory on your host machine to store XWiki's permanent data (attachments, configurations, extensions). This directory is referred to as XWIKI_PERMDIR.
  4. (Optional) Open XWIKI_HOME/WEB-INF/xwiki.properties and set the permanent directory path:
    environment.permanentDirectory=/var/lib/jetty/xwiki-data
    If you skip this step, you can pass the path as a JVM system property when running the container (see next step).
  5. Run the Jetty Docker container:
    docker run -d \
      -v /path/to/xwiki:/var/lib/jetty/webapps/xwiki \
      -v /path/to/permdir:/var/lib/jetty/xwiki-data \
      -p 8080:8080 \
      -e JAVA_OPTIONS="-Dxwiki.data.dir=/var/lib/jetty/xwiki-data" \
      jetty:12-jre17
    If you configured environment.permanentDirectory in xwiki.properties (step 4), you can omit the -e JAVA_OPTIONS argument.
  6. Once the container is running, open a browser and navigate to http://localhost:8080/xwiki/bin/view/Main/ and continue with the distribution wizard.

FAQ

Which modules do I need for Jetty 12?

Jetty 12 requires specifying the environment module. The module depends on your XWiki version:

  • XWiki 17.x and above (jakarta): ee10-deploy, ee10-webapp, ee10-jstl
  • XWiki 16.x and below (javax): ee8-deploy, ee8-webapp, ee8-jstl

Pass the modules on the docker run command line:

docker run ... jetty:12 --module=ee10-deploy,ee10-webapp,ee10-jstl

The list of modules used by XWiki is maintained in the xwiki.mod file used by the demo packaging. 

Do I need a database?

Yes, XWiki requires a database. For quick testing, you can copy the HSQLDB JAR into XWIKI_HOME/WEB-INF/lib. For production, configure an external database (such as PostgreSQL or MySQL).

Related

Get Connected