Choosing a database for XWiki: MySQL, MariaDB or PostgreSQL

XWiki's official images support MySQL, MariaDB and PostgreSQL variants. The right choice depends on your backup, replication and team skills more than on the wiki itself.

On this page

Choosing a database for XWiki: which engine fits your team

Planning a self-hosted XWiki means picking the database behind it before anything goes live. The official images come in MySQL, PostgreSQL and MariaDB variants, and the choice turns on three things: how you will back up and replicate the data, and which database your team already runs well. Make this decision before the first production deployment, and before any Confluence migration starts, because moving an XWiki instance from one database engine to another later is extra work you will have to schedule and test.

Decide early because the database sits under every other decision in the platform. Your backup tooling, restore drills, failover design, monitoring and upgrade windows all depend on it. Start by asking who on your team already operates the engine in production, which tooling your database team uses for backups and point-in-time recovery, and whether you need a standby that can take over automatically or only one you promote by hand. Those answers narrow the field faster than feature comparison tables.

Confirm the engine versions and support windows with the vendor or project before you commit, since these change on fixed schedules. Also check the exact image tag and database variant you plan to run against the XWiki release line you select, using the official Docker image documentation for XWiki as the starting point. Record the decision in your architecture file with the owner, the backup method and the restore test date, so an auditor or a new engineer can see why the engine was chosen.

How MySQL, MariaDB and PostgreSQL compare for XWiki

This table compares the three database engines XWiki's official images support on licensing, release tracks, replication, backup and recovery, authentication and vendor support paths. Read each row against your own backup, failover and skills requirements, then check the fit column before shortlisting an engine.

CriterionMySQLMariaDBPostgreSQL
LicensingMySQL Community Edition is available under the GPLMariaDB Server is GPLv2, and the MariaDB Foundation states it stays free and open sourcePostgreSQL License, a liberal license similar to BSD or MIT
Release tracksLTS series plus an Innovation track supported only until the next Innovation releaseYearly long-term releases and quarterly rolling releases; confirm which line your team will trackA new major version about yearly, with each major supported for 5 years
Replication and HAGroup Replication with automated failover and InnoDB Cluster in Community EditionAsynchronous, semi-synchronous and parallel replication, plus Galera multi-primary clusteringHot standbys, synchronous and asynchronous replication; automatic failover needs external tools
Backup and point-in-time recoveryHot backups are in Enterprise Backup, which is a paid edition; confirm the Community tooling you will useConfirm backup and point-in-time recovery tooling with your operations team before choosingContinuous archiving and point-in-time recovery are documented in the core project
Authentication optionsExternal authentication modules are listed in Enterprise EditionPluggable authentication including ed25519, PAM and GSSAPIPassword, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth
Vendor support pathOracle, with 24x7 support in Enterprise EditionMariaDB plc and the community, with the Foundation governing the open source projectCommunity-driven project; commercial support comes from third-party vendors, so confirm the contract you need
Fit for XWikiFits teams already running MySQL operations and toolingFits teams that want MySQL compatibility under a community-governed licenseFits teams with PostgreSQL skills, or those who want standard HA and recovery tooling

Why backup, replication and team skills decide the database

XWiki behaves the same way on MySQL, MariaDB or PostgreSQL, so the database choice is really a decision about recovery, availability and day-to-day operations. The official images ship as MySQL, PostgreSQL and MariaDB variants on Tomcat, and the application layer does not change between them. What changes is how you back up the data, how you replicate it, how you fail over, and who on your team knows how to run each of those steps under pressure. Start by writing down your recovery objectives and the backup method your organization already trusts, then test each candidate database against them rather than comparing feature lists.

Backup method is often the first filter. PostgreSQL offers continuous archiving and point-in-time recovery, documented in its continuous archiving guide, so a team can restore a wiki to a chosen moment. Confirm which backup tooling your platform team already supports for each engine, whether logical dumps are enough for your recovery window, and how long a full restore takes in your environment. Replication is the second filter. PostgreSQL supports hot standbys with synchronous or asynchronous replication, but it does not detect a failed primary or promote a standby on its own, so automatic failover needs external tooling you must select, test and operate. MariaDB and MySQL each offer their own replication and clustering options, and you should confirm which of them your chosen topology actually requires.

Team skills usually outweigh a theoretically better engine. A database your operators already patch, monitor, restore and upgrade on a routine basis will recover faster during an incident than a stronger product nobody has practiced with. Ask who will hold the pager for the database, who has restored it from backup in the last year, and which runbooks exist for failover and major upgrades. If the answer is a single person, plan for cross-training before go-live. The cheapest database to adopt is the one your team can already operate, and that is the option to test first against your recovery targets.

Which factors should settle the choice

Three engines can run XWiki, and the official images cover MySQL, PostgreSQL and MariaDB variants. The factors below separate them in practice: recovery, failover, upgrades, licensing, authentication and the skills your team already has. Check each one against your own environment before you commit.

Backup and point-in-time recovery

Decide how you will restore XWiki to a given moment, not just how you will take a dump. Ask your DBA team which backup tooling they already run and whether they have tested a restore into a clean instance within your recovery targets. Check how each engine's archiving and recovery features fit your backup platform, and confirm the restore procedure with the XWiki version you run.

PostgreSQL archiving docs

Replication and failover design

Settle whether you need a standby that can take over automatically or only a manual promotion path. PostgreSQL offers hot standbys with synchronous or asynchronous replication but leaves failure detection to external tools. Check whether your platform already provides an orchestrator, how much data loss your team accepts on failover, and how XWiki reconnects after a switch.

PostgreSQL HA docs

Major version upgrade path

Plan the database upgrade alongside XWiki's own upgrade cycle, because the two may not move on the same schedule. Confirm which database major versions your target XWiki line supports, then check the upgrade method your team can run: dump and restore, in-place upgrade or logical replication. Ask how long your maintenance window can be and who signs off on the rollback point.

License and support model

Compare the licenses and vendor commitments behind each engine before procurement asks. PostgreSQL uses a permissive license with no single owner. MariaDB Server is GPLv2 under a foundation, and MySQL Community Edition is GPL with Oracle-backed Enterprise options. Check whether your organization needs a commercial support contract, and what your legal team needs to see in the license terms of the edition you choose.

Authentication integration

List how your users will sign in to the database and to XWiki, and whether your security team requires a specific method. PostgreSQL documents password, GSSAPI, LDAP, certificate and OAuth methods. MariaDB and MySQL have their own plugin sets and enterprise options. Confirm the method your directory supports, and test that the database account policy matches what your identity controls require.

Existing team skills and operations

Count the people who will run the database after go-live, not only those who install it. An engine your DBAs already monitor, tune and patch lowers operational risk more than any feature comparison. Check the monitoring, alerting and patch cadence your team can sustain, and ask whether a managed or partner-supported option is needed for the engine you pick.

How PostgreSQL and MariaDB release and upgrade

PostgreSQL ships a new major version about once a year, issues minor releases at least once every three months, and supports each major version for 5 years after its initial release. For an XWiki database, that means planning a major upgrade roughly every few years, not as a rare event. The currently supported majors are 18 (final release November 14, 2030), 17 (to November 8, 2029), 16 (to November 9, 2028), 15 (to November 11, 2027) and 14 (to November 12, 2026). Anything at 13 or earlier is already unsupported. Confirm the end-of-life dates against the PostgreSQL versioning policy before you fix a target version, because an instance on 14 will need a major upgrade within months.

Minor PostgreSQL updates never change the internal storage format, so they are a matter of replacing executables and restarting. Major upgrades need a deliberate path: a dump and restore, pg_upgrade, or logical replication, which the PostgreSQL documentation says can cut downtime to several seconds. Ask your team which method they have rehearsed against a copy of the XWiki database, and schedule minor updates on a fixed cadence that matches the quarterly release rhythm.

MariaDB uses two release tracks. The Foundation announces a new long-term release yearly, with community binaries supported for 3 years after general availability and critical and security fixes for 2 more years. Rolling releases arrive quarterly. The current LTS lines are 12.3 (general availability May 28, 2026), 11.8, 11.4 and 10.11, while 13.0 is a rolling release with community end of life in Q4 2026. An XWiki instance on a rolling release will have to move to a new version within a short period, so choose an LTS line for the database, and check its end date before each XWiki upgrade. Confirm the current list on the MariaDB/server releases page.

Which database fits which team situation

If your organization already runs PostgreSQL for other applications, the operational knowledge you need is largely in place. PostgreSQL supports hot standby servers that serve read-only queries, both synchronous and asynchronous replication, and continuous archiving for point-in-time recovery. It does not include software that detects a primary failure and promotes a standby, so automatic failover depends on external tools that your team must select, configure and test.

  • Backup and recovery: Point-in-time recovery relies on base backups and archived WAL. Confirm that your existing tooling already covers this and that restores are tested, not just taken.
  • Replication: Synchronous replication trades commit latency for lower data loss risk. Decide which mode each database needs before the build starts.
  • Major upgrades: Logical replication can work between major versions, which can shorten downtime, while pg_upgrade and dump and restore are the other documented routes. Plan which path you will use.
  • Support lifecycle: Confirm which major version you will deploy against the published end-of-support dates, since the supported window determines how often you upgrade.
  • Failover tooling: Confirm which external failover tool your team already operates and who owns it.

Before choosing this path, confirm that the people who will own the database have run PostgreSQL backups, replication and upgrades in production.

How the database decision flows from requirements to variant

The decision starts with the skills your team already has and the recovery targets you must meet, then branches on whether you need replication and high availability. Each branch ends at one of the three official XWiki image variants: MySQL, MariaDB or PostgreSQL. The last check is that the engine version you choose is still supported and that the matching image variant exists for it. Confirm both against the XWiki and vendor documentation before you build.

Decision path from team skills and recovery needs to an XWiki image variant.

How to set up the chosen database for XWiki

This sequence takes the database decision through to a tested restore, so the XWiki line, image variant, database engine and recovery path agree before any wiki content is written.

  1. Confirm the XWiki line and image tag

    The platform owner chooses between the stable line and the LTS lines, then records the exact image tag to deploy. At the time of research the official Docker image tags were 18.8.0 for stable, 17.10.14 for LTS and 18.4.7 for the intermediate LTS, so confirm the current tags in the official library file before you pin one. Write the chosen tag into the change record so the database version and the image variant can be checked against it. This step is done when the tag, the upgrade path you expect to follow, and the owner of that decision are written down.

  2. Match the image variant to the database engine

    Select the official XWiki image variant that matches the engine you chose: MySQL, MariaDB or PostgreSQL. Each variant runs on Tomcat and is published for amd64 and arm64v8, so confirm that your node architecture is covered before you pull. Do not mix an engine with a variant built for another one, because the schema and JDBC driver come from the image. This step is done when the image reference for the variant is recorded alongside the database major version it expects.

  3. Provision the database with backups and replication

    The database administrator creates the database server in your infrastructure, sized and placed as your architecture review specified. Configure scheduled backups and, where the design calls for it, a standby or replica using the engine's own replication features. Confirm the engine version is one your organization still receives fixes for, using the vendor's support policy for that exact release. This step is done when the server is running, a backup job has produced a file, and the replication status shows the expected role and lag.

  4. Create the XWiki database user with least privilege

    Create a dedicated database account for XWiki, separate from administrator accounts and from other applications. Grant it privileges on the XWiki database only, and avoid granting server-wide administrative rights. Store the password through your secrets process and pass it to the container with the _FILE variable form, not as a plain environment value. Keep the account's network access limited to the XWiki hosts. This step is done when the account exists, its grants are reviewed by a second person, and the password is stored in the secrets system.

  5. Connect XWiki and verify the database link

    Start XWiki with the chosen image, the database host, the database name and the least-privilege account. Watch the startup logs until the initialization completes, then open the wiki in a browser and confirm that the front page loads and an administrator can sign in. Check that the expected tables exist in the database and that the XWiki account can read and write them. This step is done when the wiki responds, the database shows XWiki tables with recent writes, and the logs contain no repeated connection errors.

  6. Test a restore from the backup

    Restore the most recent database backup into a separate, empty database or server that is not used by production. Start a test XWiki instance against the restored copy and confirm that pages, attachments metadata and user accounts appear as expected. Record the time the restore took and the steps needed, because that record informs your recovery objectives. A backup that has not been restored is not yet a recovery plan. This step is done when the test instance shows the restored content and the restore procedure is written in your runbook.

  7. Record the configuration and schedule the next review

    Document the chosen line, image tag, database engine and version, replication design, backup location, account name and the restore test result in your platform records. Name the owner of each item and set a review date tied to your organization's upgrade and support policy. Confirm with your database vendor or the engine's published policy when the current release reaches end of support. This step is done when the record is stored with the infrastructure documentation and the owners have accepted it.

Security and operations for the database behind XWiki

Whichever engine you pick, the database holds every page, revision and user record XWiki depends on, so its transport, credentials, backups and patching need the same attention as the wiki itself. The cards below cover the controls to confirm with the chosen engine's documentation before the database goes live. Each one is a decision your team or your partner should record in the design.

TLS between XWiki and the database

Decide whether XWiki connects to the database over TLS and which certificate authority signs the database server certificate. Check that the JDBC connection string used by the XWiki container enables encryption and verifies the server certificate, not only that the port is open. Repeat the check for any replica or proxy in the path, such as a connection pooler, since each hop can terminate the session separately. Confirm the exact parameter names with the driver and engine documentation for your version.

PostgreSQL auth methods

Password authentication method

PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so new XWiki database roles should use SCRAM and existing MD5 roles should be migrated on a planned date. Confirm which method the MariaDB and MySQL versions you run use by default and whether the XWiki JDBC driver supports it. Plan a separate, least-privilege role for XWiki that owns only its schema, and keep administrative accounts out of the application configuration.

Secrets handling for database credentials

The database password should reach the XWiki container through a secret store or a file-based secret, not through plain environment variables in a compose file or a values file committed to version control. The official XWiki Docker images support secrets through _FILE variables, so confirm which variable names your image tag supports. Define a rotation procedure that updates the database role and the XWiki secret together, and test it on a non-production instance first.

Backup encryption and restore testing

A database backup is a copy of every wiki page, so encrypt it at rest and restrict who can read the backup store. Check that the backup tool for your engine supports encryption and that the keys are stored apart from the backups. A backup that has never been restored is not proven, so schedule restore tests into a separate environment and record the time taken and the result. For PostgreSQL, point-in-time recovery depends on archived WAL, which must be included in the same plan.

Continuous archiving docs

Patching cadence for the chosen engine

Each engine publishes its own release lines and end-of-life dates, so a patch plan must start from the version you run. For PostgreSQL, minor releases come at least once every three months and PostgreSQL 14 is supported until November 12, 2026, so an older major version may need an upgrade within the year. Confirm the support window of your MariaDB or MySQL line with its vendor pages, and schedule XWiki upgrades so the database version stays inside its supported window.

Access logging and audit trail

Turn on connection and statement logging at a level your compliance team can review, and send the logs to a store that XWiki administrators cannot edit. Record failed logins, role changes and schema alterations, and keep the retention period in line with your records policy. Confirm which logging parameters and audit plugins each engine provides, since MySQL Enterprise Edition includes an audit component that the Community edition does not.

Questions teams ask before choosing a database for XWiki

Which database is best for XWiki?

There is no universal best choice. The official XWiki Docker images come in MySQL, PostgreSQL and MariaDB variants, so all three are supported paths, and the deciding factors are your backup tooling, replication design and the skills your team already has. If your organization runs PostgreSQL well with tested point-in-time recovery, it is usually the simplest default. If your operations are built around MySQL or MariaDB, staying on that engine lowers the learning curve. Confirm the exact version combination you plan to run against the XWiki release notes before you commit.

Is MariaDB a drop-in replacement for MySQL in XWiki?

Do not assume it is. MariaDB began as a fork of MySQL and keeps a high degree of compatibility, but the two diverge in features, default settings and release tracks over time. The XWiki image you choose must match the database variant you deploy, so MariaDB should be tested as its own variant rather than swapped in underneath a MySQL image. Plan a test restore, run your upgrade and backup procedures against the target engine, and check the XWiki version you run is listed as supported for it.

What drives the effort of switching databases later?

The main drivers are the volume of wiki data, how many attachments and page history entries you hold, whether you use custom extensions with direct database access, and how much downtime your users accept. A switch means exporting, transforming and re-importing data, then validating it against the source. Each of these steps needs its own rehearsal. The earlier you choose, the cheaper the change, so treat the choice as part of the initial design rather than a later optimization.

Can our team make the database choice without outside help?

Yes, if you have people who already run production databases and can own backups, restores, patching and monitoring after go-live. The choice itself is mostly a comparison of your operating model against each engine's licensing, replication and recovery features. Teams without that experience often benefit from a short review that tests the chosen setup against restore and failover requirements. DeployOpen plans, implements, backs up and documents self-hosted platforms in your own infrastructure, so scoping the database work with us is one option among several.

What does the work need from our team?

Expect to provide named owners for the database, the XWiki application and the infrastructure underneath them, access to your cloud or data center environment, and decisions on backup retention, recovery time expectations and maintenance windows. Your security team should confirm encryption, network paths and credential handling. Your platform team should confirm where backups are stored and how restores are tested. Without these inputs, the database choice cannot be validated against your real requirements.

How long does a database decision and setup take?

The duration depends on scope: whether you are choosing an engine for a single small wiki or a clustered deployment with replication and disaster recovery, how many environments you need, and whether you are migrating existing data. A decision alone can often be settled in a workshop once requirements are written down. Setup, backup testing and failover testing take longer and grow with each replica or site. Ask any provider, including us, for a written timeline tied to the agreed scope rather than a generic figure.

What should a quote for database work include?

A useful quote lists the scope in writing: the engines and versions evaluated, the XWiki variant selected, the topology (single node, replicated or clustered), backup and restore testing, failover testing if required, documentation and handover. It should separate one-time work such as design, installation and migration from recurring work such as patching, upgrades and monitoring support. Ask which deliverables are included, what is excluded, who performs restore tests, and how changes to scope are priced. Note that DeployOpen does not publish a price list, so quotes follow from the written scope.

How DeployOpen scopes the XWiki database decision

DeployOpen plans and implements self-hosted XWiki inside your own infrastructure, and the database choice is one of the first decisions we scope. We do not pick the engine from a default. We test MySQL, MariaDB and PostgreSQL against the questions that decide whether the wiki stays recoverable and maintainable: how backups will be taken and restored, how the database will replicate or fail over, and which engine your database administrators already run well. The official XWiki images ship in MySQL, PostgreSQL and MariaDB variants, so the choice is mostly about operations, not about whether XWiki runs at all.

In the scoping phase we typically review your existing database standards, backup tooling, recovery time expectations and on-call skills, then record the decision and its reasons in writing. We also confirm which replication model your team can operate. Asynchronous or synchronous replication, Galera-style clustering and Group Replication each carry different failover and operational work, and the automatic failover tooling is not identical across the three engines. Where a fact is still open, such as which vendor version your organization has approved, we list it as a item for you to confirm rather than assume it.

Every engagement starts from a written fixed scope with agreed deliverables and timelines. A quote follows from that scope. DeployOpen does not publish a price list, so the cost depends on the systems in scope, the environments involved and the testing and documentation you require. Ongoing support, upgrades and continuous testing are available as a retainer once the wiki is running.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.