Configure Tomcat for XWiki in Docker

Last modified by Eleni Cojocariu on 2026/05/27 08:24

Steps

Warning

WIP

To customize the Tomcat configuration used by the XWiki Docker image, mount a host directory to this location inside the container:

  1. Create a temporary container from the XWiki image.
    docker create --name xwiki xwiki:stable-mysql-tomcat
  2. Copy the default Tomcat configuration to the host machine, to start with some existing configuration files.
    docker cp xwiki:/usr/local/tomcat/conf /tmp/tomcat
  3. Modify the configuration files in the copied /tmp/tomcat directory to bring the changes you need.
  4. Remove the temporary container since it was only used to copy the configuration files and we'll need to create a new one with different parameters..
    docker rm xwiki
  5. Start XWiki with the customized Tomcat configuration mounted into the container.
    docker run --net= --name xwiki -p 8080:8080 \
    -v /tmp/xwiki:/usr/local/xwiki \
    -v /tmp/tomcat:/usr/local/tomcat/conf \
    -e DB_USER=xwiki \
    -e DB_PASSWORD=xwiki \
    -e DB_DATABASE=xwiki \
    -e DB_HOST=mysql-xwiki \
    xwiki:stable-mysql-tomcat

Don't forget to replace xwiki-nw with the name of your Docker network, the vales of the environment variablesxwiki:stable-mysql-tomcat with the actual name you give and tag you want (Supported tags and respective Dockerfile links).

FAQ

Where is the Tomcat configuration used by the XWiki Docker Image located?

The Tomcat configuration used by the XWiki Docker image is located in /usr/local/tomcat/conf.

Why would I customize the Tomcat configuration?

For example, to setup a reverse proxy configuration.

How can I modify the default Tomcat configuration instead of creating a new one?

To modify the existing Tomcat configuration, copy the default configuration files from the container to the host machine using the docker cp command. You can then update the copied files locally and mount them back into the container when starting XWiki.

Related

Get Connected