Configure Jetty for XWiki in Docker
Last modified by Eleni Cojocariu on 2026/07/13 17:35
Steps
To run XWiki on the official Jetty Docker image:
- Download the XWiki WAR file for the version you need.
- Extract the WAR file into a directory named xwiki. This directory is referred to as XWIKI_HOME.
- Create a directory on your host machine to store XWiki's permanent data (attachments, configurations, extensions). This directory is referred to as XWIKI_PERMDIR.
- (Optional) Open XWIKI_HOME/WEB-INF/xwiki.properties and set the permanent directory path:If you skip this step, you can pass the path as a JVM system property when running the container (see next step).
environment.permanentDirectory=/var/lib/jetty/xwiki-data - Run the Jetty Docker container:If you configured environment.permanentDirectory in xwiki.properties (step 4), you can omit the -e JAVA_OPTIONS argument.
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 - 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-jstlThe 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).