Why midPoint PostgreSQL repository and audit database setup comes first
midPoint keeps its repository in PostgreSQL, and the repository and audit data should be planned as separate databases on a dedicated database server. Teams running midPoint in production make this decision before go-live, because the layout is hard to change once identity data, task history and audit records are accumulating. The repository holds midPoint's core objects: users, roles, organizations, resource definitions, tasks and the state that drives provisioning. Native audit writes a record of changes and events into its own store, so compliance reviewers can later see who changed what and when. Evolveum's guidance advises considering audit migration and partitioning before running midPoint in production, which makes this a design step rather than a tuning task for later.
Before the first production deployment, the team should decide on the PostgreSQL version, the server it will run on, and how the two databases are named, owned and backed up. Evolveum recommends a separate PostgreSQL server even for small deployments, so the database should not share a host with other workloads. Confirm the supported PostgreSQL major version against the midPoint release you plan to run, and confirm the audit retention period with your compliance and security owners, since it drives disk growth. Changing these choices after users and audit history exist means migrating live data, which is slower and riskier than deciding now.
The first milestone is a written database design that names the server, the two databases, the roles that connect to each, the retention policy and the backup and recovery owner. Use it as the input for sizing, for the Docker Compose or Kubernetes deployment, and for the security review of database access. Ask your midPoint implementation partner or internal team to show how the design will be tested before go-live, including a restore of the repository and audit databases into a separate environment.
Choosing a PostgreSQL layout for small, mid-size and large deployments
Evolveum recommends a separate PostgreSQL server even for small midPoint deployments, so the database does not compete with the midPoint application for the same host. For fewer than 5,000 users, Evolveum's reference sizes the database server at 2 cores and 3 GB RAM. The reference treats the repository and the audit data as separate databases, and a small deployment should keep that split from the first day so the layout does not need to change later.
- Dedicated server: Run PostgreSQL on its own host or virtual machine, not alongside the midPoint application node.
- Two databases: Create one database for the midPoint repository and one for native audit records, each with its own owner account.
- Reference figures: The 2 cores and 3 GB RAM figures are Evolveum's, taken from the system requirements page, not a guarantee for your workload.
- Growth path: Plan disk space and connection limits so the server can be resized or the audit database moved without rebuilding the repository.
- Backups: Schedule backups for both databases from the start, since a small team often has no separate operator to notice a missing one.
Confirm the sizing against your actual user count, role complexity and audit retention period before you order hardware.
Mid-size deployments are where audit volume starts to shape the design. Evolveum's reference sizes the database at 8 cores and 12 GB RAM with 20 to 100 GB of disk for three months of audit, at 50,000 to 100,000 users. The disk range is wide because audit volume depends on how often identities change, how many resources are connected and how much detail the audit configuration records, so the figure is a planning range rather than a fixed allocation.
- Reference figures: Evolveum's reference for this scale is 8 cores, 12 GB RAM and 20 to 100 GB of disk for three months of audit.
- Separate audit database: Keep audit records in their own database so that retention, cleanup and partitioning decisions do not touch the repository.
- Audit partitioning: Evolveum's native audit documentation advises considering audit migration and partitioning before production, so decide the approach during design.
- Retention period: Confirm how many months of audit your policy requires, because disk use scales with the retention window.
- Monitoring: Track disk growth on the audit database from the first week in production.
Ask Evolveum or a sizing specialist to review the figures against your change rate and retention requirement.
Above the reference table, the layout is less about one server and more about how the database is operated. Evolveum's sizing reference covers the scales it publishes, and deployments beyond those figures, or with heavy reporting or unusual audit volume, should expect a custom sizing exercise. High availability, backups and upgrades then become design decisions, not add-ons, because the repository holds the identity state the whole platform depends on.
- Custom sizing: Request a sizing review when user count, connector count or audit retention exceeds the published reference.
- Availability design: PostgreSQL supports hot standby servers and synchronous or asynchronous replication, but it does not detect a failed primary on its own, so automatic failover needs an external tool.
- Connection management: Plan connection pooling, for example with PgBouncer, before several midPoint nodes share the database.
- Recovery testing: Test point-in-time recovery for both databases, since the repository and audit data may need to be restored to different points.
- Major upgrades: Plan the PostgreSQL major version path with the midPoint upgrade path, so each change is tested against supported versions.
Confirm with your database and identity teams which recovery objectives and failover model apply before the layout is final.
Whatever the scale, the layout decision comes down to a few facts you should confirm in writing before procurement. The sizing reference is a starting point, and the choice between a single server and a more complex arrangement depends on your user count, audit retention, availability target and who operates the database. Use the scale tabs to pick a starting point, then check each item against your own environment.
- User count: Record the number of identities that midPoint will manage, including future joiners, not only current staff.
- Audit retention: Record how long audit records must be kept and who can access them.
- Server separation: Confirm that PostgreSQL runs on a dedicated server or virtual machine, with separate repository and audit databases.
- Operations ownership: Name the team that patches PostgreSQL, runs backups and handles restores.
- Version support: Check the PostgreSQL version against the supported release list on the PostgreSQL versioning policy page before you install.
If any of these facts are uncertain, ask for a written sizing review before ordering infrastructure.
Which PostgreSQL versions midPoint deployments can run on
Only PostgreSQL 14 through 18 are currently supported, and any version 13 or earlier is out of support. The PostgreSQL project publishes a support window for each major version: 18 was first released on September 25, 2025 and is supported until November 14, 2030, 17 until November 8, 2029, 16 until November 9, 2028, 15 until November 11, 2027, and 14 until November 12, 2026. A new major release arrives about once a year, and minor releases with fixes come at least once every three months. Because each major version gets roughly five years of support, the window you have left on a version shrinks every year you run it, so the date you install is part of the decision.
For a new midPoint deployment, start from the end-of-support date and work backward. Choosing 14 today leaves only a few weeks of community support before its window closes, so it is rarely the right starting point. Choosing 18 gives the longest runway, and midPoint's own requirements are the next check: confirm in Evolveum's system requirements which PostgreSQL majors the midPoint release you plan to install supports, because the project's list can lag or lead the PostgreSQL calendar. Record the chosen major and its end-of-support date in your platform register so the upgrade trigger is visible before it becomes urgent.
Plan for the minor-release cadence as an ongoing task, not an install-time choice. Minor releases do not change the internal storage format, so applying them means replacing executables and restarting the server, which is a routine maintenance window. Major upgrades are a separate project, covered in the upgrade material on this page, and should be scheduled well before a version's end-of-support date.
How to set up the repository and audit databases in order
This sequence takes a new midPoint installation from an empty database server to a verified repository and a separate audit database, with each step closed by a check you can run. Follow it in order, because later steps depend on roles, authentication and connection settings created earlier.
Provision a dedicated PostgreSQL server
Your database or platform team installs a supported PostgreSQL major version on a server that serves midPoint only, rather than sharing it with other applications. Evolveum recommends a separate server even for small deployments, and sizes the database by user count, so confirm your target sizing with the sizing guidance before choosing cores, memory and disk. Confirm the major version against PostgreSQL's support dates at the time of installation, since version 14 support ends in November 2026. The step is done when
psql --versionandSELECT version();return a supported major version on the new host.Create dedicated roles and separate databases
Create one login role for the repository and a different login role for the audit database, each with only the privileges its database needs. Create the repository database and the audit database as separate databases, so audit data can be partitioned, retained and backed up on its own schedule. Keep the schema owner and the runtime account distinct where your policy requires it, and record the role names for the midPoint configuration step. The step is done when both databases appear in
\land each role can connect to its own database but not to the other.Enable SCRAM password authentication
Set
password_encryptiontoscram-sha-256and re-set each role's password so it is stored with SCRAM rather than MD5. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so avoid MD5 even if an older version on your network still accepts it. Inpg_hba.conf, allow only the midPoint application host to reach each database, usingscram-sha-256for those entries, and reload the configuration. The step is done whenSELECT rolname, left(rolpassword, 14) FROM pg_authid WHERE rolname IN ('...');shows SCRAM-formatted hashes and a connection from an unlisted host is refused.Configure the native repository connection
On the midPoint host, point the repository settings in the midPoint home configuration at the repository database, host, port and the repository role, and supply the password through your secrets mechanism rather than a plain file where possible. Keep the connection direct to PostgreSQL. Do not place a connection pooler or proxy between midPoint and the database, because midPoint's repository layer depends on a direct session. Start midPoint so it initializes the schema in the repository database. The step is done when the server log reports a successful repository start and the schema tables exist in the repository database.
Configure native audit to the separate audit database
Add the native audit settings that point midPoint's audit writes at the audit database and its dedicated role, following Evolveum's native audit configuration reference for the midPoint version you run. Confirm the audit schema is created in the audit database, not in the repository database. Review how audit migration and partitioning apply to your version before you accept production data, because Evolveum advises considering both before running midPoint in production. The step is done when the audit tables exist in the audit database and the repository database holds no audit tables.
Apply audit migration and partitioning
Run the audit migration and partitioning steps described in Evolveum's native audit documentation for your release, in a test environment first, and record the exact commands and output. Partitioning affects how audit rows are grouped and later removed, so agree the retention period with your compliance and audit owners before enabling it in production. Capture the partition layout and the retention job owner in your runbook. The step is done when the partitions you expect appear in the audit database and a test run completes without errors in the midPoint log.
Verify connectivity and audit writes
Make a change in midPoint that the audit log should record, such as a test user modification in a non-production environment, and then query the audit database to confirm a new audit row was written with the expected event and actor. Test the repository from midPoint's own health and monitoring endpoints, and confirm that a failed login to the audit role is rejected. Record the query and the row count so you can repeat the check after upgrades. The step is done when the test change appears as an audit record in the audit database and the repository database shows the matching object change.
How audit partitioning and retention affect disk and maintenance
Audit records grow with every change midPoint makes, so disk use and maintenance work follow directly from how much history you keep and how it is partitioned. The cards below cover the decisions to make before production and the routine tasks that keep the audit database and repository healthy afterward.
Audit growth over time
Every provisioning action, login and change that midPoint records adds rows to the native audit tables in the audit database. Growth is steady and cumulative, so a database that looks comfortable at launch can become the main disk consumer within months. Measure the rate during a pilot with realistic user counts and activity, then project it across the full retention window before sizing storage.
- Audit reference retention
- 3 months
Partitioning as a pre-production step
Evolveum's native audit documentation advises considering audit migration and partitioning before running midPoint in production, not after the tables have filled. Partitioning changes how audit data is stored and later removed, so retrofitting it on a large live table is harder. Decide the partitioning approach during setup and record it in your build runbook.
Retention period decisions
Retention is a policy choice shared by security, compliance and operations, not a database default. The Evolveum sizing reference assumes three months of audit for 50,000 to 100,000 users, which is a sizing basis, not a requirement. Ask your compliance team which events and how long each must be kept, then confirm that the retention you choose matches the disk you provision.
Cleanup and repository maintenance
Audit cleanup and repository housekeeping remove or archive old data so the database stays within its disk and performance budget. Schedule these tasks deliberately, test them in a non-production environment, and confirm that you have a verified backup before running any deletion. Ownership of the schedule should be named, because cleanup that never runs shows up later as a full disk.
Confirm the procedure for your version
Partitioning and cleanup steps depend on the midPoint version in use, and the exact procedure should come from the documentation for that release rather than from general PostgreSQL practice. Ask your implementation team or Evolveum to confirm the steps for your version before you enable partitioning. Keep the confirmed procedure under version control alongside the rest of your deployment configuration.
How midPoint nodes, the repository and the audit database connect
The diagram starts at users reaching midPoint through a sticky load balancer, which sends each session to one of several midPoint nodes. Every node connects directly to the same dedicated PostgreSQL server, where the repository and audit databases are separate databases on one server. A standby replica can receive changes from the primary, and it is shown as an option, not a default. Check that the database network is reachable only from midPoint nodes and administrators, and that no connection pooler sits between midPoint and PostgreSQL.
Midpoint nodes connect directly to a dedicated PostgreSQL server with separate repository and audit databases.
Securing PostgreSQL authentication, roles and backups for midPoint
The midPoint repository and audit databases hold identity data, role assignments and a record of who changed access and when. The cards below cover the controls that protect those databases: how clients authenticate, which roles they hold, where connections can come from and how the data can be recovered.
Replace MD5 with SCRAM passwords
PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM. Before midPoint connects, confirm that password_encryption is set to scram-sha-256 and that pg_hba.conf requires SCRAM for the midPoint and audit database users. Existing MD5 password hashes should be re-set after the change, because the stored hash format does not change on its own. Check that no midPoint role still authenticates with MD5.
Choose the authentication method per connection
PostgreSQL documents several client authentication methods, including password, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth. For midPoint, the usual choice is SCRAM password or client certificate for the service account, with LDAP or GSSAPI only if your directory team already runs and monitors it. Ask your DBA to document one method per connection path and to confirm that the chosen method is supported by the PostgreSQL version you run.
Authentication methods docsGrant least-privilege database roles
Create separate roles for the repository and the audit database, and give each only the rights its midPoint node needs. The repository role should not own the schema, and the audit role should not be able to alter repository tables. Keep schema changes on a separate, administrative role used only during installs and upgrades. Review grants after every midPoint upgrade, since schema changes can add objects that the application role needs.
- Separate databases
- 2
Restrict network access to midPoint nodes
Allow inbound connections to the PostgreSQL server only from the addresses of midPoint nodes and approved administration hosts. Enforce this in pg_hba.conf, in the host firewall and in the network segment design, so a single control failure does not expose the database. In a multi-node deployment, add every node address, and remove entries when nodes are retired. Confirm with your network team how the database port is exposed to any load balancer or container network.
Plan base backups and point-in-time recovery
Continuous archiving lets you restore a base backup and replay archived write-ahead log to a chosen point in time. For midPoint, this matters because a bad mass change or an accidental deprovisioning run can damage identity data within a short window. Decide the archive location, retention and the restore test schedule before go-live. Test a restore into a separate server and confirm that the repository and audit databases recover to a consistent point. Standby servers are not backups, because they replicate mistakes as well as data.
Continuous archiving docsDocument backup ownership and failover tooling
PostgreSQL does not detect a failed primary or promote a standby on its own, so automatic failover requires external tooling that your team selects, configures and tests. Record who owns backups, who approves a restore and how long a restore takes in your environment. Confirm that failover tooling does not route midPoint connections to a server without the expected audit and repository data.
PostgreSQL failover docsQuestions teams ask before setting up midPoint's PostgreSQL databases
Do we need a separate audit database for midPoint?
Evolveum suggests separate databases for audit and the repository, so the short answer is that a separate audit database is the recommended layout rather than an optional extra. The reason is operational: audit data grows with every change and has its own retention, backup and access needs, so keeping it apart lets you size, back up and purge it without touching the repository. Evolveum's native audit documentation also advises considering audit migration and partitioning before running midPoint in production. Confirm the exact layout against the native audit configuration guide for the midPoint version you plan to run.
Does a dedicated PostgreSQL server add much cost and effort?
Evolveum recommends a separate PostgreSQL server even for small midPoint deployments, so the server is a planned cost, not an exception. The one-time effort covers provisioning the host or virtual machine, network rules, storage, backup configuration and the PostgreSQL install. The recurring effort covers patching, minor and major upgrades, monitoring and backup tests. Cost depends on your hosting model, licensing for the operating system and any high availability design you add. Ask for the server build, the owner of patching and the restore test in any written quote.
How long do setup and the audit migration take?
Duration depends on the number of users, how much audit history already exists, the midPoint version and how many environments must be built. Evolveum's sizing guidance ties database resources to user count and audit retention, so a larger user base and a longer retention window mean more disk, more data to migrate and more testing time. Before agreeing a schedule, ask for the audit data volume, the planned retention period, the migration rehearsal count and the cutover window. Timelines should appear only in the written scope.
Can our own DBA team set this up without outside help?
Yes, a capable PostgreSQL team can build the repository and audit databases from Evolveum's requirements, and many do. The work that usually needs care is the audit migration, partition planning, connection settings and the restore test. If your DBAs have not run midPoint before, the first build is where most avoidable mistakes happen. Decide early who owns each step, and whether you want a partner to review the design, build a reference environment or hand over a runbook.
Which PostgreSQL version should we choose for midPoint?
Choose a PostgreSQL version that is still in its support window for the whole period you expect to run midPoint. According to the PostgreSQL versioning policy, 14 is supported until November 12, 2026, 15 until November 11, 2027, 16 until November 9, 2028, 17 until November 8, 2029 and 18 until November 14, 2030. Versions 13 and earlier are unsupported. Also check the midPoint system requirements for the version you plan to run, because compatibility is set by midPoint, not by PostgreSQL alone.
Is PgBouncer allowed in front of the midPoint repository?
Connection poolers such as PgBouncer are a common way to manage database connections, but whether it fits midPoint depends on the midPoint version, the connection behavior and the pooling mode you choose. Test the pooler against your exact midPoint release, including startup, scheduled tasks and multi-node operation, before using it in production. Confirm the approach with Evolveum for your version, and do not assume a pooler is supported because the PostgreSQL project documents it. The PgBouncer project documentation is the place to check pooling modes.
What does DeployOpen provide and what does our DBA team keep?
DeployOpen plans, builds and documents the midPoint repository and audit databases inside your infrastructure, and prepares the configuration, backup and restore evidence your reviewers ask for. Your DBA team typically keeps ownership of the production database servers, credentials, patching windows, backup retention decisions and day-to-day monitoring after handover. The split should be written into the scope so that each party knows who runs upgrades, who approves changes and who responds to incidents.
Limits to confirm in your environment before go-live
Before go-live, confirm the exact midPoint release you will run and the PostgreSQL major versions that release supports. Support windows differ by release: midPoint 4.8 is a long-term support release supported until 17 October 2028, midPoint 4.10 is supported until 26 November 2027, and midPoint 4.9 support ends 18 October 2026. Check the midPoint releases page for the release you plan to deploy, then check the midPoint system requirements for the matching PostgreSQL and Java versions. Record the PostgreSQL major version you will run and its end-of-support date, since that date will fall inside the life of your midPoint release in some combinations.
Ask Evolveum or read the release documentation for the audit partitioning procedure that applies to your exact release. Confirm whether audit tables must be migrated or partitioned before the first production start, how partitions are created and dropped, and who runs that job. Confirm the connection pooling position as well: whether your standard PgBouncer setup or another pooler has been tested with midPoint for the repository and audit databases, and whether session-level settings are compatible with it. Treat any pooler in front of the database as a decision to test, not a default.
Confirm sizing against your actual user count, not a rounded estimate. Evolveum's reference figures cover fewer than 5,000 users and a range of 50,000 to 100,000 users, so a deployment between those points needs the vendor to confirm the database cores, memory and disk for your audit retention period. Also confirm the failover tooling. PostgreSQL does not detect a primary failure or promote a standby by itself, so name the external tool, its owner, and how it interacts with midPoint's connection settings during a switchover. Write these answers into your go-live record so the people approving the release can see which limits you accepted and which you resolved.
How DeployOpen scopes and delivers midPoint database setup
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, including the PostgreSQL repository and audit database that midPoint depends on. We start from your user count, retention requirements and hosting model, then deliver a database layout your compliance and security teams can review.
How we scope
- Confirm your midPoint release line and the matching Java and PostgreSQL versions before any build work starts.
- Agree in writing whether the repository and audit databases run on dedicated servers, and where they are hosted.
- Record audit retention, partitioning and migration requirements so the written scope states exactly what is delivered.
How we build
- Install a dedicated PostgreSQL server with separate repository and audit databases, configured for SCRAM authentication and direct connections without a proxy in the path.
- Configure native audit and its partitioning in a test environment, then check that midPoint writes audit records to the intended database.
- Test backup, restore and failover steps with the client's team, and document the connection settings midPoint uses.
How we hand over
- Deliver a written runbook covering versions, database layout, connection settings, audit partitioning and the upgrade path for PostgreSQL and midPoint.
- Walk the operations team through routine tasks such as minor PostgreSQL updates, audit housekeeping and restore testing.
- Provide configuration files and evidence of verification that internal reviewers or external auditors can examine.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover is complete.
- Plan major PostgreSQL and midPoint upgrades as separate written scopes, checking supported version pairs before each step.
- Retest database configuration after platform changes, so the setup stays aligned with your security and audit requirements.

