Official Openfire Image loses settings on container recreation

Hello everyone,

I’m using the official Openfire Docker image and I’m struggling with persistence. If I recreate the container (e.g., docker compose up -d --force-recreate), I lose all my settings and users.

I am using bind mounts specifically because I need my data visible in /opt/containers/ for my backup workflow.

Here is my docker compose:

x-logging: &default-logging
  driver: "json-file"
  options:
    max-size: "50m"
    max-file: "3"

services:
  openfire:
    image: ghcr.io/igniterealtime/openfire:v5.0.2
    container_name: openfire
    logging: *default-logging
    restart: unless-stopped
    ports:
      - "9090:9090"
      - "5222:5222"
      - "7443:7443"
    volumes:
      - ./data/lib:/var/lib/openfire
      - ./data/logs:/var/log/openfire

The Issue:

  1. I run docker compose up -d.

  2. I complete the Setup Wizard (Embedded Database).

  3. I create a test user.

  4. To test persistence I run docker compose up -d --force-recreate.

  5. Result: The test user is gone, and I am back to the default admin password.

Questions for the experts:

  • Is /var/lib/openfire the correct and only path I need to persist for a full standalone setup?

  • Are there any required environment variables to ensure the internal Openfire process respects the /var/lib/openfire mount point for its openfire.xml?

Any feedback on my Compose structure would be greatly appreciated!

-Schwach