Docker Volumes Used by XWiki Containers
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:
- the database data directory,
- the XWiki permanent directory (/usr/local/xwiki).
If you don't explicitly map your own volumes when using docker run, or if you use Docker Compose with the default setup, Docker automatically creates internal volumes and attaches them to the containers.
Two volumes are created:
- A volume named
<prefix>_mysql-dataor<prefix>_postgres-datathat contains the database data. - A volume named
<prefix>_xwiki-datathat contains XWiki's permanent directory.
To find out where those volumes are located on your local host machine you can inspect them with docker volume inspect <volume name>. To find the volume name, you can list all volumes with docker volume ls.
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.