XWiki Docker Image Configuration (Environment Variables)

Last modified by Eleni Cojocariu on 2026/04/29 09:38

Reference

Warning

WIP

When a container is started from the XWiki Docker Image (e.g., using Docker Run, Docker Compose or Docker Swarn), Docker automatically executes the /usr/local/bin/docker-entrypoint.sh script inside the container. This script reads the provided environment variables and initializes XWiki by generating the necessary configuration files and setting up connections. The environment variables can also be provided to the container as files containing their values (see the "File-based equivalent" column), in order to support Docker secrets. The following environment variables can be passed, or their equivalents:

Environment VariableDescription of Environment VariableFile-based equivalentDescription of File-based equivalent
DB_USERThe user name used by XWiki to read/write to the DB.DB_USER_FILEThe location, inside the container, of a file containing the value for DB_USER.
DB_PASSWORDThe user password used by XWiki to read/write to the DB.DB_PASSWORD_FILEThe location, inside the container, of a file containing the value for DB_PASSWORD.
DB_DATABASEThe name of the XWiki database to use/create.DB_DATABASE_FILEThe location, inside the container, of a file containing the value for DB_DATABASE.
DB_HOSTThe name of the host (or docker container) containing the database. Default is "db".DB_HOST_FILEThe location, inside the container, of a file containing the value for DB_HOST.
INDEX_HOSTThe hostname of an externally configured Solr instance. Defaults to "localhost", and configures an embedded Solr instance.INDEX_HOST_FILEThe location, inside the container, of a file containing the value for INDEX_HOST.
INDEX_PORTThe port used by an externally configured Solr instance. Defaults to 8983.INDEX_PORT_FILEThe location, inside the container, of a file containing the value for INDEX_PORT.
CONTEXT_PATHThe name of the context path under which XWiki will be deployed in Tomcat. If not specified then it'll be deployed as ROOT. If you had set this environment property and later on, recreate the XWiki container without passing it (i.e you wish to deploy XWiki as ROOT again), the you'll need to edit the xwiki.cfg file in your mapped local permanent directory and set xwiki.webapppath=.  
JDBC_PARAMSCustom JDB parameters to pass to the database connection. Setting this value overwrites the default parameters used (which depend on the DB used). The value must start with a question mark and the content be XML-encoded. For example: ?useSSL=false&connectionTimeZone=LOCAL&allowPublicKeyRetrieval=true.JDBC_PARAMS_FILEThe location, inside the container, of a file containing the value for JDBC_PARAMS.

 

FAQ

Can I use both an environment variable and its _FILE equivalent at the same time?

No. For each configuration value, the normal environment variable and _FILE environment variable are mutually exclusive. Providing values for both variables will result in an error.

Can I also customize the Java runtime used by XWiki?

Yes. You can customize the Java runtime by setting the JAVA_OPTS environment variable in the Docker container. For example, see Remote Debugging for XWiki in Docker.

Related

Get Connected