Metabase high availability: running several instances on one PostgreSQL database
When a Metabase instance becomes business-critical, the team's first goal is to remove the single point of failure. In this setup, high availability means several Metabase JAR instances behind a load balancer, all reading and writing one shared PostgreSQL application database. The web tier is the easy part to replicate. The application database is the element that needs the most planning, because every instance depends on it for users, sessions, saved questions, dashboards, permissions and settings. If that database is down or slow, the cluster is down or slow, no matter how many instances are running.
Four areas are hard. The first is session and state handling: confirm with Metabase's documentation how user sessions and any cached state behave when requests land on different nodes, and test sign-in persistence through the load balancer. The second is the shared database as a dependency: plan its own backups, failover and connection limits rather than treating it as an internal detail of Metabase. The third is sizing against user and query load, which depends on your concurrent users, the number of data sources and how heavy your queries are. Measure this in your own environment instead of relying on a general figure. The fourth is the migration lock, which changes how you upgrade a cluster and is covered in the upgrade section below.
Before you commit to a design, confirm which edition and features your intended setup needs. The open source edition and the paid plans differ in areas such as single sign-on and permissions, so an architecture that depends on a paid feature must be priced against that plan. Ask Metabase to confirm the supported database versions, the load balancer and health check requirements and any clustering guidance for your release, and record the answers in your design. The Configuring the Metabase application database page is the natural starting point for that check.
Which Metabase high availability components you are actually operating
A clustered Metabase setup is a small set of parts that must agree with each other. Some of them are shared by every node, and some are local to a single instance, so a change that is safe on one node can break the others. Know which parts are shared before you size, monitor or upgrade the cluster.
Load balancer and health check target
The load balancer spreads user traffic across the Metabase instances and decides which nodes receive requests. Point its health check at Metabase's own health endpoint rather than at a TCP port, so a node that is up but not serving is removed from rotation. Confirm the health endpoint path and expected response for your version in the configuration docs, and set session stickiness deliberately, since it affects how users behave when a node is replaced.
Metabase instances running the JAR
Each node runs the same Metabase JAR with identical configuration, including the same version. Per-node settings are limited to things like the listening address and the local JVM memory allocation, which you size against the host. Do not let nodes drift onto different versions, because the cluster has to be upgraded as one unit. Confirm which settings are safe to differ per node for your version.
PostgreSQL application database
The application database is the shared state of the cluster. It stores questions, dashboards, users, groups, permissions and settings, so every node reads and writes the same database. Metabase recommends PostgreSQL for production, and the embedded H2 database is meant for demos. Give the database its own backups, monitoring and capacity plan, and treat its availability as the availability of the whole cluster.
Application database docsConnected data sources
Queries run against your organization's data sources, not against the application database. Each node opens its own connections to those sources, so the data warehouse or operational database must accept the combined connection count from all nodes. Use least-privilege database credentials and confirm the connection pool settings for your version, because a cluster multiplies any connection limit you set per node.
Encryption key and shared configuration
Credentials stored in the application database, such as data source passwords, are encrypted with a key that every node must share. If one node runs with a different key, it cannot read those credentials and queries against those sources fail on that node only. Store the key in your secrets manager, set it identically on each instance, and confirm the exact setting name in the configuration docs for your version before the first node starts.
Decisions to settle before you add a second Metabase node
This table compares the main choices that shape a multi-node Metabase setup, from node count and database hosting to load balancing, TLS and configuration. Read each row for when the option fits and what it costs your team to run, then confirm capacity limits with Metabase and in a load test before you commit.
| Decision | Option | Trade-off | When to choose it |
|---|---|---|---|
| Node count | Two nodes | Simplest step up from one node, but one node failure leaves no spare capacity during an incident or upgrade. | Modest, steady internal use where a short degraded period is acceptable. |
| Node count | Three or more nodes | More capacity headroom and redundancy, with more instances to patch, monitor and keep on the same version. | Many concurrent viewers or scheduled jobs, or when you need spare capacity during maintenance. |
| Application database hosting | Self-managed PostgreSQL | Your team patches, backs up and fails over the database, and owns its skills and on-call burden. | Existing database platform team and standard tooling already in place. |
| Application database hosting | Managed PostgreSQL | Patching and backups are largely handled by the provider, but failover behavior and maintenance windows depend on the service tier you buy. | You want less database operations work and can accept the provider's failover and maintenance terms. |
| Load balancer | Stateless round robin | Simple to run, and it fits when instances share all state in the application database, but health check tuning is still needed. | Standard HTTP health endpoint and no reliance on per-user server state. |
| Load balancer | Session affinity (sticky sessions) | Can smooth user experience during rolling restarts, but uneven load and drained sessions are common when one node is removed. | Only if testing shows a real session problem that round robin cannot solve. |
| TLS termination | At the load balancer | Certificate management is centralized, but traffic between the balancer and nodes must be protected by your own network controls. | Central certificate tooling exists and the internal network is trusted and segmented. |
| TLS termination | On each Metabase node | Encryption reaches the node, but certificates must be rotated on every instance and the setup is harder to keep consistent. | Policy requires encryption to each instance or the balancer cannot hold the certificates. |
| Configuration | Shared configuration file | One source of truth that is easy to review, but every change must reach all nodes at the same time. | Teams that manage config through a single repository and deployment pipeline. |
| Configuration | Environment variables per node | Works well with container orchestration and secrets stores, but drift between nodes is possible without checks. | Infrastructure already injects settings and secrets at runtime. |
How traffic and data flow through a clustered Metabase deployment
The diagram starts with users on the corporate network reaching the load balancer over TLS. The load balancer spreads requests across several Metabase nodes, and each node reads and writes the same PostgreSQL application database, which holds Metabase's own configuration, users, and saved questions. Nodes then connect outward to the organization's data sources, which is the only path to business data. The load balancer also polls a health check endpoint on each node, so an unhealthy node is removed from rotation. Check that the application database is the only shared state and that data source credentials never leave the Metabase tier.
Request, health check and database paths across the trust boundaries in a clustered Metabase deployment.
How to build a Metabase high availability cluster step by step
This sequence takes a single Metabase instance to two nodes sharing one PostgreSQL application database, behind a load balancer with health checks and TLS, and ends with restart tests that show sign-in survives a node failure.
Provision PostgreSQL for the application database
The platform or database team creates a PostgreSQL instance dedicated to Metabase's application data, separate from the analytics sources Metabase queries. Confirm the PostgreSQL version is one Metabase supports for production, create a dedicated database and role for Metabase, and check which network paths the Metabase hosts need to reach it. Confirm that a backup job runs against this database and that you can restore a copy to a scratch instance. The step closes when a test connection from the intended Metabase host succeeds and a restore test to a scratch instance completes. Confirm the supported versions with the Metabase application database documentation before you choose a PostgreSQL release.
Start one node and complete setup
The Metabase administrator starts a single Metabase node using the JAR and points it at the PostgreSQL application database through the environment variables described in the application database documentation. Let the node run its migrations on first start, then complete the setup wizard and create the first admin account. Record the encryption key or other shared secrets the deployment uses, because every node must share them. The step closes when the node serves the login page, the admin can sign in directly on that node, and the application database contains Metabase's tables.
Copy configuration and shared secrets to the second node
The platform engineer prepares the second node with the same Metabase version, the same JAR, and identical environment settings, including the database connection, the encryption secret and any site URL or SMTP settings. Do not rely on the first node's local files for anything the cluster needs. Keep the configuration in a managed source such as a secrets store or deployment template so both nodes are built from one definition. The step closes when a diff of the two nodes' effective settings shows no differences except host-specific values such as the network address.
Start the second node against the same database
Start the second node pointed at the same PostgreSQL application database. It should detect that the schema is current and join without repeating setup. Check the application database and the Metabase logs to confirm both nodes are running and that the second node does not attempt a conflicting migration. The step closes when both nodes can be signed into directly, and a user, collection or dashboard created through the first node is visible through the second node.
Place both nodes behind the load balancer with a health check
The network team adds both nodes to a load balancer pool and configures a health check against the endpoint Metabase exposes for health status, which the Metabase documentation describes for operators. Set the check to remove a node from rotation when it fails and to return it only after it passes again. Keep sticky sessions optional and test without them first. The step closes when the load balancer reports both nodes as healthy, and a request through the load balancer's address reaches each node in turn when you check the logs.
Route TLS and confirm sign-in through the load balancer
Terminate TLS at the load balancer or at the nodes, using the certificate for the public Metabase hostname, and set the Metabase site URL to that same hostname so links and redirects are correct. Confirm that the browser reaches Metabase only over HTTPS through the load balancer. Sign in as a test user and open a saved question to confirm queries run. The step closes when sign-in and a saved question work through the public hostname, and the site URL matches the address users type.
Test a restart of each node
Stop one node while users are signed in through the load balancer, then confirm the health check removes it and that sessions continue on the remaining node. Restart the stopped node, wait until the health check passes, and confirm it rejoins rotation. Repeat the test for the second node. Record which errors, if any, users saw during each failover so you can decide whether session handling or retry behavior needs attention. The step closes when both restarts complete with sign-in and a saved question still working after each one.
How the cluster design changes by environment
A single Metabase instance is the reference point for the other designs. It has one application server, one JAR, and one connection to the application database, so there is no load balancer and no shared session concerns. Availability depends on restarting the process and restoring the database, which makes a managed database with point-in-time backups the main safeguard.
- Application database: Use a managed PostgreSQL service with automated backups and a tested restore path, rather than the embedded H2 database.
- Restart handling: Run the JAR under a service manager such as
systemdso the process restarts after a crash or reboot. - Upgrades: Plan a maintenance window, since a single node has no peer to keep serving users during a migration.
- Operations you own: Patching the host, rotating the database credentials, and monitoring disk and memory on the application server.
Confirm with the platform team how database backups are retained, who can run a restore, and how long a restore takes in your environment.
In a virtual machine cluster, several Metabase instances run on separate hosts behind a load balancer, and all of them share one PostgreSQL application database. The build adds the load balancer health check, consistent configuration across nodes, and a procedure that accounts for the migration lock during upgrades. Sizing is set per node and must be validated under real query load, not assumed from a template.
- Load balancer health checks: Point the check at Metabase's health endpoint and remove a node from rotation when it fails.
- Shared configuration: Keep the same Metabase version and the same application database settings on every node.
- Upgrade sequence: Reduce the cluster to one node for major upgrades because of the migration lock, then restore the others after the upgrade completes.
- Operations you own: Node patching, load balancer certificates, database connection limits across nodes, and capacity reviews as user counts grow.
Confirm with the platform team whether the load balancer supports sticky sessions if your configuration needs them, and how node replacement is scheduled.
In a container platform, the orchestrator handles restarts, rescheduling, and replacement, so the design shifts from managing hosts to declaring desired state. The application database stays external and shared, and the image version becomes the control point for upgrades. Probes, resource limits, and secret handling are defined in manifests, which makes them reviewable but also easy to get wrong.
- Liveness and readiness probes: Configure readiness so traffic only reaches pods that have finished starting and connected to the database.
- Replica count and rollout: Set the rollout strategy so the migration lock is respected, since parallel pods starting new migrations can conflict.
- Secrets: Store database credentials and the encryption key in the cluster's secret store, not in the image or plain manifests.
- Operations you own: Image provenance, base image patching, resource tuning, and the application database itself, which the cluster does not manage.
Confirm with the platform team which Metabase image source is approved, how the image is pinned by version, and whether the cluster's network policies allow access to the database and identity provider.
In an air-gapped network, nothing can reach the public internet at build or run time, so the load balancer, the PostgreSQL database, and every container image or JAR must be sourced internally. Dependencies that a connected build would fetch on demand must be mirrored in advance, and updates arrive through an approved transfer process. The cluster design stays the same in shape, but the supply chain and update cadence change substantially.
- Internal artifacts: Mirror the Metabase JAR or image, the JDK or base image, and any drivers you need into your internal registry before the build.
- Load balancing and database: Use internal load balancers and an internal PostgreSQL service with no outbound dependency.
- Licensing and features: Confirm which edition you will run, since SSO and other paid features require Pro or Enterprise, and plan that procurement inside the network.
- Operations you own: The full update pipeline, including reviewing new releases and moving them across the boundary, plus restore testing for the database.
Confirm with the security team how new releases enter the network, how long that review takes, and whether the upgrade procedure in your environment has been rehearsed offline.
How the migration lock changes the Metabase upgrade procedure in a cluster
In a Metabase cluster, a major upgrade cannot be treated as a rolling restart. Every Metabase instance runs application database migrations automatically when a newer JAR starts, and the vendor's upgrade documentation recommends reducing the cluster to a single node for major upgrades because of a migration lock. A rolling upgrade that works for patch releases therefore needs a different plan for major releases: a scheduled window with one node serving traffic, a verified backup of the application database taken before the first new JAR starts, and a rehearsal of the same steps on a copy of the application database. Confirm with your load balancer team how traffic will be drained to the remaining node and how the other nodes will be stopped and held out of rotation during the window.
Decide the rollback path before the window opens, not during it. The vendor documents two options: restoring the pre-upgrade application database backup, which is the recommended path, or running the migrate down command with the newer JAR. The backup restore is usually the simpler route to a known state, but it discards any application database changes made after the backup, such as new questions, dashboards or user settings, so the team needs to agree on that trade-off with the business owners in advance. Check that the backup can actually be restored into the PostgreSQL instance you run, and record which Metabase JAR version each node should return to. Confirm the exact steps for the migrate down path against the version documentation for your target release.
Teams upgrading from versions older than 40 should move release by release rather than jumping straight to the current version. Plan each hop as its own change with its own backup, verification and rollback decision, and confirm the intermediate versions you need against the Metabase upgrading documentation. Keep the versions you pass through within their support windows as well, using the Metabase version support page, so that the final target is one you can keep running after go-live.
What drives the effort and cost of a Metabase high availability setup
This table lists the drivers that move the effort of a clustered Metabase deployment, how each one changes the work, and how to keep it contained. Read it as a checklist for scoping and for the questions to put in a written quote, separating one-time design and testing from recurring upgrade and database operations.
| Driver | Why it changes effort or cost | How to keep it down |
|---|---|---|
| Concurrent users and query load | More concurrent sessions and heavier dashboards mean more application nodes, more connection pool pressure on the application database, and a larger load test before go-live. | Agree a target concurrency in writing, run a shared load test against that profile, and cache or schedule the heaviest dashboards. |
| Application database size and operations | The shared PostgreSQL application database holds users, permissions, saved questions and query metadata. Its size, backup window and failover design add one-time build work and ongoing database administration. | Use a managed or well-run PostgreSQL service with tested backup and restore, and confirm who owns database patching and failover. |
| Number and type of connected data sources | Each database connection adds credential handling, permission mapping, network paths from every node, and validation that every node reaches each source the same way. | Limit connections to what the business uses, keep data source configuration documented, and test each source from every node. |
| Environments (dev, test, production) | Each environment needs its own cluster topology, application database, secrets and upgrade rehearsal, so the work multiplies rather than being done once. | Keep environments as close in topology as the budget allows, script the build, and promote the same JAR version through each stage. |
| Load balancer and identity integration | Health check endpoints, session stickiness decisions, TLS termination and SSO settings must work identically across nodes. SSO on JWT, OIDC or SAML requires Pro or Enterprise per the pillar facts. | Document the load balancer configuration, test login and session failover, and confirm the plan supports the chosen identity method before design starts. |
| Health checks and monitoring | Custom health checks, log collection, alerting on node failure and application database errors are built during the project and must be maintained after each upgrade. | Agree a monitoring baseline, define alert ownership, and keep check definitions in version control. |
| Upgrade procedure and migration lock | Metabase runs application database migrations automatically, and the docs recommend reducing a cluster to a single node for major upgrades because of a migration lock. Each upgrade therefore needs a rehearsal, a maintenance window and a rollback plan. | Rehearse each upgrade on a copy of production, back up the application database first, and budget upgrades as recurring work in the quote. |
| Compliance evidence | Assessors often ask for topology diagrams, access controls, backup and restore results, change records and evidence of tested failover. Producing this evidence is one-time work with recurring refresh after each change. | Ask for an evidence list at scoping, keep documentation in one controlled location, and agree which artifacts are delivered and retested. |
How to verify Metabase high availability works and fails safely
Before go-live, write down the expected result of every test in this section, then run the tests and compare. Fails safely means three things for a Metabase cluster: the shared application database loses no data, scheduled deliveries are either sent or visibly failed (never silently dropped), and users who hit a failed node see a clear error or a re-login prompt rather than a partial or corrupt state. Record the expected outcome for each case in a test log so the team can judge pass or fail without debate during the test window.
Start with the node-loss tests. While a login and query load runs through the load balancer, stop one Metabase node and confirm that sessions continue or re-authenticate cleanly, with no stuck spinners or duplicated writes. Then restart each node in turn, one at a time, and confirm the load balancer health check pulls a stopped node out of rotation and returns it only after it is healthy. Check the health endpoint's response against what your load balancer expects, and confirm the path your health check uses is the one Metabase exposes. Repeat the failure with a node that is mid-query so you can see how in-flight requests are reported to users.
Next, confirm shared state. Change a setting in the admin panel and create a saved question and a dashboard on one node, then open them from every other node and confirm the change is visible without a restart. If a database failover is in scope, simulate it against the PostgreSQL application database and confirm Metabase reconnects, with no lost saved content. Finally, treat this test set as a regression suite: rerun it after every upgrade, since upgrades run application database migrations and your cluster sizing and procedure may need to change. Confirm the procedure against the Metabase upgrading guide before each release.
What to monitor, back up, upgrade and document after go-live
A clustered Metabase is only as dependable as the routine that watches it. The cards below connect node health, the application database, backups, upgrade planning, version control and handover so that the operations team can keep the cluster running after the implementation partner or internal project team steps back.
Node and load balancer health
Watch each Metabase node and its load balancer target status separately, so one failing node does not hide behind a healthy pool. Confirm that the health check path you configure reports a node as unhealthy when it cannot reach the application database, and that the load balancer removes such a node from rotation. Test this by stopping one node during a quiet window and confirming that user sessions continue. Record the health check settings in the runbook.
Application database docsApplication database health and connections
Track connection counts and database health on the shared PostgreSQL instance, because every node opens its own pool against it. Alert on connection saturation, replication lag if you run replicas, storage growth and slow queries. Confirm the connection limit on the database is high enough for all nodes combined, and agree with the database owner who is paged when the instance degrades.
Metabase log review
Collect logs from every node into one place so that a problem seen by one user can be traced to the node that served it. Review startup messages, database connection errors and migration messages, which matter most during upgrades. Confirm the log level you run in production and the retention period your security team requires, since logs may contain query and user context.
Scheduled application database backups
Back up the application database on a fixed schedule and restore a copy to a test database on a regular basis. An untested backup does not prove recovery works. The restore test should confirm that a fresh Metabase node starts against the restored database and that saved questions, dashboards and permission groups are present. Backups are also the recommended rollback path before any upgrade.
Upgrade planning by version support
Plan upgrades against the vendor's version support windows, not against whatever release is current. LTS releases are supported for 14 months and non-LTS releases usually reach end of life after about 2 months, so a non-LTS install needs an upgrade cycle every few months. Check the version support page for current release dates before scheduling, since dates change with each release.
Version support pageConfiguration and runbooks in version control
Keep the Metabase JAR version, environment variables, load balancer configuration, health check definitions and infrastructure code in version control. Changes then go through review and can be traced to a date and an owner. Store the upgrade and rollback runbook in the same repository so that the procedure a team follows matches the configuration it is running.
Handover documents and node inventory
Hand over a node inventory listing each instance, its host, its Metabase version and its health check address, together with the upgrade and rollback runbook and the on-call contacts for the application database. The operations team should be able to answer what runs where, which version is live, and how to return to the previous state without the original builders present. Confirm that these documents are reviewed after each upgrade.
Questions buyers ask about Metabase high availability and outside help
How much more effort does a Metabase cluster add compared with a single node?
A cluster adds work in four areas: a shared PostgreSQL application database that must be sized, a load balancer with health checks, consistent configuration across every node, and a longer upgrade procedure. A single node needs one JAR, one database and one restart path. In a cluster, each instance must point at the same application database and run the same version, and your team must test failover, not just assume it. The added effort is mostly one-time design and load testing, plus a recurring change to how you patch. Confirm the node count, expected concurrency and query load with a load test on your own data sources before you commit to a sizing.
What access does the client team need to provide for a Metabase cluster?
Plan for access in four groups before work starts:
- Database: an administrative role or a provisioned database and user for the shared PostgreSQL application database, plus connectivity from every Metabase node.
- Network: routes and firewall rules between the load balancer, the Metabase nodes, the application database and the data sources Metabase queries.
- Identity: a test tenant or service account for your SSO provider if sign-in is part of the rollout, and the group names that map to Metabase permissions.
- Load balancer: rights to create listeners, target groups and health checks, and to set TLS certificates.
Ask your security team to approve each grant in writing, and confirm the exact list against the Metabase application database docs before scheduling.
Can our internal team build and run a Metabase cluster without outside help?
Often yes, if your team already runs load-balanced web services and PostgreSQL in production. The skills that matter are database operations, load balancer health checks, secrets handling and a tested upgrade runbook. The harder part is proving behavior: failover under load, what happens when one node restarts during a query, and how sessions and caches behave across nodes. Teams without a recent load test or a rehearsed upgrade often underestimate the work. A partner can take a fixed scope covering design, build, load testing and documentation, while your team keeps ownership. Compare that scope against your own staffing before deciding.
How long does a Metabase high availability project take, and what drives the duration?
Duration depends on the environment more than on Metabase itself. The main drivers are how quickly access to the database, network, identity provider and load balancer is granted, whether the PostgreSQL service already exists and is sized, how many data sources and users must be validated, and how much load testing you require. Identity integration on Pro or Enterprise adds time for group mapping. Ask any partner for a timeline built from a written scope, and ask your team to confirm the approval lead times for each access group. No duration should be accepted until those dependencies are listed.
How do Metabase upgrades change once the instance runs as a cluster?
Metabase runs application database migrations automatically at startup, and the migration lock means that for major upgrades the documented approach is to reduce the cluster to a single node first. Then you back up the application database, upgrade, confirm migrations finish, and scale back out. Rollback is either restoring the pre-upgrade backup, which the docs recommend, or running the migrate down command with the newer JAR. Versions older than 40 must be upgraded release by release. Build this into a runbook and rehearse it on a copy of the database. Check the exact steps for your target version in the upgrading docs.
Can a partner take over day-to-day operations of our Metabase cluster?
DeployOpen offers ongoing support, upgrades and continuous testing as retainers, and most engagements are fixed-scope with deliverables and timelines agreed in writing before work starts. A retainer can cover monitoring follow-up, patch and upgrade cycles, and incident response within the scope you agree. Confirm in writing who holds on-call duties, how access is granted and revoked, what response expectations apply, and who owns the application database backups. A quote follows from the written scope, so list the nodes, environments and upgrade cadence you need.
Which Metabase edition or plan should we confirm before starting a cluster project?
Confirm the edition before design, because it changes the identity and governance design. Open Source and Starter support Google sign-in and LDAP, while SSO through JWT, OIDC or SAML, advanced LDAP group sync and SCIM provisioning require Pro or Enterprise. Row and column level permissions, multi-tenant segregation and usage analytics and auditing are also limited to Pro and Enterprise. Enterprise pricing is by quote starting at $20,000 per year, and Pro is listed at $575 per month or $517.50 per month billed yearly, per the Metabase pricing page. Confirm current terms with Metabase directly, since list prices can change.
How DeployOpen scopes, builds and hands over a Metabase cluster
DeployOpen plans and deploys self-hosted Metabase clusters inside your own infrastructure, with the load balancer, shared PostgreSQL application database, health checks and upgrade runbook documented for your team. Each engagement starts from a written, fixed scope so your security, data and platform teams review the same deliverables before work begins.
How we scope
- Review the target hosting model, network path and load balancer options for your Metabase nodes
- Size the shared PostgreSQL application database and confirm backup, failover and access requirements
- Agree in writing which upgrade, rollback and single-node maintenance steps the cluster runbook will cover
How we build
- Deploy several Metabase instances against one PostgreSQL application database inside your environment
- Configure load balancer health checks and confirm each node answers before it receives traffic
- Test node restarts, failover and a rehearsed upgrade on a non-production copy before go-live
How we hand over
- Deliver configuration records, architecture notes and the sizing rationale for your platform team
- Document the migration lock behavior and the step-by-step cluster upgrade procedure with rollback
- Walk your operators through health check signals, logs and the backup restore process
How we support
- Offer ongoing support, version upgrades and continuous testing through a retainer agreed in writing
- Track Metabase version support windows so upgrade planning stays ahead of end-of-life dates
- Retest the cluster after each upgrade or infrastructure change and report any findings with fixes

