Custom Configuration Files with Docker

Last modified by Eleni Cojocariu on 2026/04/29 08:49

Explanation

Warning

WIP

XWiki configuration files in Docker can be customized by mounting Docker volumes from the host machine to the corresponding locations inside the container. It is recommended to mount only the configuration files that you need to customize. During upgrades, any overridden files may need to be merged with the newer default versions provided by XWiki. If a file has not been customized, no merge is required.

Example with Docker Run

If your config files are in a local /my/xwiki/config/path directory, you would use the following for docker run:
docker run ... -v /my/xwiki/config/path/xwiki.cfg:/usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg -v ... xwiki

Example with Docker Compose

[...]
services:
  web:
    image: "xwiki:stable-mysql-tomcat"
    [...]
    volumes:
      - xwiki-data:/usr/local/xwiki
      - xwiki-cfg:/usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.cfg
      - xwiki-properties:/usr/local/tomcat/webapps/ROOT/WEB-INF/xwiki.properties
      - xwiki-hibernate:/usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml
      - xwiki-jgroups:/usr/local/tomcat/webapps/ROOT/WEB-INF/observation/remote/jgroups
      - xwiki-logback:/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/logback.xml
   - xwiki-webxml:/usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml
    [...]
volumes:
  [...]
  xwiki-data: {}
  xwiki-cfg: {}
  xwiki-properties: {}
  xwiki-hibernate: {}
  xwiki-jgroups: {}
  xwiki-logback: {}
  xwiki-webxml: {}

Related

Get Connected