Build and Run a Custom XWiki Docker Image

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

Steps

To build and run a custom XWiki Docker image:

  1. Install Git.
  2. Run the following command to clone the repository:
    git clone https://github.com/xwiki/xwiki-docker.git
  3. Go to the xwiki-docker directory created by the clone.
  4. Choose the directory matching your setup:
    cd <cycle_version>/mysql-tomcat

    For example, 18/mysql-tomcat for the latest released XWiki version of the 18.x cycle running on Tomcat and for MySQL, or 18/postgres-tomcat for XWiki 18.x + PostgreSQL.

  5. Modify the Dockerfile in that directory as you wish.
    Information

    To build a different XWiki version, change both XWIKI_VERSION and XWIKI_DOWNLOAD_SHA256 in the Dockerfile. The XWIKI_VERSION entry of the .env file does not affect the build: it only selects which published image Docker Compose pulls.

  6. Build the image, giving it a tag of your own:
    docker build -t my-xwiki .
    Warning

    Use your own tag rather than an official one such as xwiki:18.5.0-mysql-tomcat, otherwise your local build shadows the published image of the same name.

  7. In docker-compose.yml, point the web service at your build by replacing its image value:
    image: "my-xwiki"
  8. Start the containers: docker compose up.
  9. Access XWiki: open your browser and go to http://localhost:8080/ once XWiki is started.

FAQ

Is there any other method to build the image?

Yes, you can:

  • build the image with a specific name and tag, for example: docker build . -t name:tag,
  • build the image with a more generic name: docker build -t xwiki . and then use the instructions from above to start XWiki and the database using docker run.

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected