Docker Volumes Used by XWiki Containers

Last modified by Vincent Massol on 2026/07/27 15:33

Explanation

When running XWiki with Docker, persistent data needs to be stored outside the containers. In the default setup, Docker volumes are commonly used for this purpose. They are typically used for:

If you don't explicitly map your own volumes when using Docker Run, Docker still creates a volume for each directory declared as a volume by the images, and gives it a generated hexadecimal name.

Docker Compose with the default setup creates two named volumes instead:

  • A volume containing the database data, named <prefix>_mysql-data, <prefix>_mariadb-data or <prefix>_postgres-data depending on the database engine.
  • A volume named <prefix>_xwiki-data containing XWiki's permanent directory.

<prefix> is the Docker Compose project name, which defaults to the name of the directory containing the Compose file.

To find the volume names, list all volumes with docker volume ls. To find out where a volume is stored, inspect it with docker volume inspect <volume name> and look at its Mountpoint.

On Linux, where the Docker engine runs directly on the host, that mount point is a real directory on the host, accessible as root. On macOS and Windows, Docker Desktop runs the Docker engine inside a Linux virtual machine, so the mount point exists only inside that virtual machine and not on your host filesystem. To access the content of a volume there, either browse it from the Volumes view of Docker Desktop, or mount it into a temporary container, as follows:

docker run --rm -it -v <volume name>:/data alpine sh

FAQ

Is the XWiki permanent directory the same as a Docker volume?

No. The permanent directory is the location used by XWiki inside the container. A Docker volume is one way to persist that directory outside the container.

Why is persistent storage needed for XWiki Docker installation?

Persistent storage is required to ensure that XWiki data is not lost when the container is stopped, restarted, or upgraded. To enable persistent storage, XWiki must be configured to store its data outside the container filesystem.

Should I use absolute or relative paths for mounted directories?

Use fully-qualified absolute paths when mounting directories into the container. Relative paths are not recommended.

Related

Get Connected