Running multiple Orthanc instances on one PostgreSQL database

Several Orthanc nodes can read and write one PostgreSQL index behind a load balancer, which supports scaling and survives some instance failures. This page covers the version requirements, shared storage, database layer and writer limits to confirm before you build it.

On this page

Running multiple Orthanc instances on PostgreSQL: what it gives you and when to use it

A single Orthanc node becomes a bottleneck when many viewers and modalities query and retrieve at once, and it becomes a single point of failure when that one server is the only route to the archive. Since Orthanc 1.9.2 with PostgreSQL/MySQL plugins 4.0, several Orthanc instances can read and write the same database, which enables horizontally scaled and highly available setups. In this pattern, each node runs the same Orthanc configuration pointed at one shared PostgreSQL index, and a load balancer spreads HTTP traffic across the nodes. Before you commit, confirm that every node runs the same Orthanc and plugin versions, because the shared database only works when the nodes agree on the schema. The Orthanc Book scalability FAQ is the reference for the supported combination.

The pattern covers the Orthanc tier only. Losing an Orthanc node should not stop the archive, but losing the PostgreSQL server still does, because every node depends on the same index. The database therefore needs its own availability design, such as a hot standby with replication, a tested failover process and an external tool to detect a primary failure, since PostgreSQL does not perform automatic failover by itself. Shared storage for the DICOM files must also be reachable from every node, so a storage outage remains a single point of failure even with several Orthanc nodes. Ask whether your storage layer provides this redundancy before you count on the cluster for continuity.

Use this pattern when the archive must stay available through a node restart or hardware loss, or when concurrent load from viewers, modalities and automated jobs has outgrown one server. It is a poor fit for a small clinic with a modest study volume, where a single node with good backups may be simpler to run. Expect added work in load balancer configuration, certificate and access management across nodes, upgrade sequencing and monitoring of each node. The orthanc-setup-samples repository includes a sample that connects several instances to one PostgreSQL database with HTTP load balancing, which is a useful starting point for a proof of concept.

How the parts fit together

Requests start at modalities and workstations, pass through a load balancer, and reach one of several identical Orthanc nodes. Every node reads and writes the same PostgreSQL index, and the DICOM files live on storage that all nodes can reach. The trust boundary separates the client-facing network from the internal database and storage network, so only the Orthanc nodes cross it. Check that each node sees the same storage path and that the database is reachable only from those nodes.

Several Orthanc nodes share one PostgreSQL index and one file store behind a load balancer.

Configuration choices and when each fits

This table compares the main choices for running several Orthanc nodes on one PostgreSQL index, including load balancing, shared file storage, PostgreSQL standbys and connection pooling. Read each row for the situation where it fits and the trade-off you accept, then check the open items with your own team before deciding.

ChoiceWhen it fitsTrade-off to weighWhat to confirm
Load balancer without session affinityOrthanc nodes are stateless for the client's requests, so any node can answer any callRequests for a long transfer or job can land on different nodes, so clients need retry logicWhether your clients and modalities tolerate a node change mid-operation
Load balancer with session affinityViewers or clients keep state tied to one node and cannot retry cleanlyTraffic spreads unevenly and a failed node drops its sessionsHow your viewer and modality profiles reconnect after a node failure
Shared storage on a network file systemYou want every node to read the same DICOM files without changing the storage pluginLocking, latency and mount behavior on the network file system become a single point to testVendor support for concurrent access and the locking behavior your file system provides
Object storage through a storage pluginFiles should live in S3, Azure or Google Cloud object storage that every node reaches directlyEach node depends on the object store's availability and network path, and costs recur per stored object and requestPricing model, egress terms and the plugin version that matches your Orthanc release
PostgreSQL hot standby with asynchronous replicationA failover target is needed and some loss of the most recent commits is acceptable to the businessCommits made just before a failure may not reach the standbyReplication lag you can tolerate and how your monitoring reports it
PostgreSQL standby with synchronous replicationCommitted index changes must exist on a standby before the write is acknowledgedEach write waits for the standby, so write latency and standby outages affect the whole clusterWhich standbys must confirm and how the cluster behaves when none are reachable
PgBouncer connection poolingMany Orthanc nodes open many connections and the database server is near its connection limitPooling modes change which session features work, so the mode must match what Orthanc usesPool mode, connection limits and the Orthanc plugin behavior under your chosen mode
External failover toolingAutomatic promotion of a standby is required rather than manual promotionPostgreSQL does not detect a failed primary or notify the standby, so a separate tool and its testing are neededWhich failover tool your team operates and how it fences the old primary

Setup sequence for a shared-database Orthanc cluster

This sequence takes a team from version checks to a load-balanced group of Orthanc nodes that all read and write one PostgreSQL index and one shared file store. Each step ends with a check that proves the nodes behave as one archive.

  1. Confirm Orthanc and PostgreSQL versions

    Pick an Orthanc release that supports multiple instances on a shared database, which the project documents as starting with Orthanc 1.9.2 with PostgreSQL plugin 4.0. Use a current 1.12.x or 1.13.x release where your organization can test it, and confirm the PostgreSQL major version is still supported under the PostgreSQL versioning policy (18, 17, 16, 15 or 14 at the time of writing). Check the PostgreSQL plugin version against the Orthanc release notes, since the plugin and core must match. Done when the target versions are written in your change record and every node will run the same binaries. Confirm the exact compatibility matrix with the Orthanc project before you commit.

  2. Build the database and roles

    A database administrator creates a dedicated PostgreSQL database for the Orthanc index, plus a login role that owns it and a separate limited role for application access. Restrict network access in pg_hba.conf to the Orthanc nodes, and use SCRAM password authentication rather than MD5. Decide whether connections pass through a pooler such as PgBouncer and test that pooling mode with Orthanc before production use. Done when a test login from each node's address succeeds and a login from any other address is refused.

  3. Configure shared storage reachable from every node

    Mount one shared file store at the same path on every Orthanc node, or configure object storage through an official storage plugin so that all nodes address the same DICOM files. Every node must read and write the same storage location, because the index only points to files. Confirm with your storage team that locking, permissions and latency are acceptable for concurrent writes, and check which storage option the Orthanc storage documentation supports for your setup. Done when a test file written by one node can be read by a second node at the same path or object key.

  4. Start the first node and create the schema

    Configure the first Orthanc node with the PostgreSQL plugin, the shared storage location, and the same settings file you will copy to every other node. Start it once so it creates or migrates the schema, and do this on one node only so two nodes do not migrate at the same time. Keep automatic restarts paused during any long schema upgrade, since restarting mid-migration can leave the index in a partial state. Done when the node reports healthy on its REST endpoint and the database contains the Orthanc tables.

  5. Check the first node with a test upload

    Upload a small set of test studies to the first node through its REST API or a DICOM store, then confirm the study count, the instance count and a sample study's metadata through the REST API. Check that the files appear in the shared storage location. Use anonymized or synthetic data only. Done when the counts match what you uploaded and the files exist on the shared store, which gives you a known baseline for the next steps.

  6. Add the second node and compare views

    Start a second node with an identical configuration file, pointing at the same database and the same storage path, and let it start without migrating again. Query the study count on both nodes directly, not through the load balancer. Then upload a new test study to the second node and confirm it is visible from the first node, and the reverse. Done when both nodes report the same study and instance counts and a study written on either node is readable from the other.

  7. Place the HTTP load balancer and run failover tests

    Put a load balancer in front of the nodes, using the approach shown in the orthanc-setup-samples repository as a starting point, and keep Orthanc's remote access settings, authentication and HTTPS termination in place. Send requests through the load balancer, then stop one node and confirm that requests still succeed and that uploads sent through the balancer are readable after the node returns. Remember that PostgreSQL itself needs its own high availability design, because the database is a single point of failure in this setup unless you add replication and failover tooling. Done when a failed node is removed from rotation and the surviving nodes serve the full archive.

Limits of concurrent writers and what to test

Several Orthanc nodes sharing one PostgreSQL index add failure modes that a single instance never shows. The cards below cover where writers can collide, which operations need a maintenance window, and what a load test must reproduce before you rely on the cluster. Confirm each limit against the Orthanc project documentation and your own test results.

Concurrent writes to the same study

Two nodes can receive instances belonging to the same study at nearly the same time, for example when a modality sends slices through one load-balanced address while a retry lands on another node. Check how the index handles duplicate instance and study records, and whether storage writes and index updates can end up out of step. Test by sending overlapping sends of one study through the load balancer and then comparing instance counts in the index with files in storage.

Upgrades that require paused restarts

Some Orthanc upgrades run long database migrations when the server starts. If a load balancer or container orchestrator restarts a node during that migration, the schema can be left half-converted. Plan a maintenance window, disable automatic restarts for the duration, and confirm with the release notes which versions trigger this behavior. Rehearse the full sequence on a copy of production data before touching the live cluster.

Orthanc NEWS file

Jobs queued on one node

Background jobs such as large exports, transfers or deletions are stored and executed by the node that accepted the request. If that node stops, the job may stall until it is resumed or the node returns, even though other nodes are healthy. Confirm how saved jobs are recovered after a restart, and decide who watches the queue. Test by starting a long job, stopping its node, and measuring how long the work takes to finish.

Schema changes across versions

Nodes running different Orthanc or plugin versions against one database can disagree about the schema. Keep all nodes on the same core and PostgreSQL plugin version, and check whether a mixed-version state is supported at all before any rolling upgrade. Record the exact versions in each container image so that a partial rollout is visible in your inventory.

Locking and contention under load

Index writes from several nodes compete for the same PostgreSQL tables and row locks, and this contention grows with ingest rate and query volume. Watch for lock waits, long-running transactions and connection exhaustion in PostgreSQL, and decide whether a pooler such as PgBouncer sits between the nodes and the database. Confirm the pooling mode is compatible with the plugin before you enable it.

PgBouncer project

Load tests with realistic study volumes

A cluster that handles a few hundred test studies may still fail at production scale. Build a test dataset that matches your modality mix, study sizes and retention, then run ingest, query, retrieve and deletion together for the length of a typical busy day. Compare results with the scale reported in the Orthanc scalability FAQ, and record the failure points you find before go-live.

Orthanc scalability FAQ

Version requirements for Orthanc and PostgreSQL

Multiple Orthanc instances can share one database only from Orthanc 1.9.2 with PostgreSQL plugin 4.0 or later. Earlier combinations cannot run this setup, so the version pair is the first decision in any multi-node design. Confirm the plugin version that matches your Orthanc build in the plugin documentation before ordering hardware or writing deployment files, and keep every node on the same Orthanc and plugin version so that all writers follow the same schema and locking behavior.

Orthanc 1.13.0 was released on 2026-08-15 with a rewrite of storage-area access and DICOM parsing and transcoding aimed at caching and memory use. Because that work touches the code paths that every node uses, read the Orthanc NEWS file for each candidate release, check the notes for changes to the database plugin and storage behavior, and test the chosen version on a copy of your database before rolling it out to a cluster. Previous lines, including 1.12.11 (2026-04-14) and 1.12.10 (2025-11-26), remain listed in the same file if your change window requires them.

On the database side, PostgreSQL 18, 17, 16, 15 and 14 are the supported major versions. PostgreSQL 18 supports until November 14, 2030, 17 until November 8, 2029, 16 until November 9, 2028 and 15 until November 11, 2027. Version 14 ends on November 12, 2026, so a cluster built on it needs a major upgrade plan in place before that date. Choose a version that will outlive your planned hardware life, and confirm with your Orthanc release that the plugin supports the PostgreSQL major version you select, since support lists for the server and the plugin do not always move in step.

Security and operational considerations for shared nodes

Every Orthanc node that joins a shared PostgreSQL index inherits the same exposure, so access control, transport encryption and recovery have to be designed for the cluster as a whole. The cards below cover the Orthanc settings that govern HTTP access, the routes to disable, database authentication, DICOM TLS for inter-site traffic and the backup and restore tests that protect the shared index and files.

Restrict remote HTTP access

By default Orthanc accepts HTTP connections only from localhost, so each node behind a load balancer needs an explicit decision about remote access. If RemoteAccessAllowed is enabled, set AuthenticationEnabled to true and define every account in RegisteredUsers on each node, so a user denied on one node is denied on all of them. Confirm that the load balancer does not present every client as localhost, since that would bypass the default restriction at the network level.

Orthanc security FAQ

Terminate HTTPS at a reverse proxy

Put a reverse proxy or the load balancer in front of the cluster so that clients reach Orthanc only over HTTPS, and keep the Orthanc HTTP ports off any Internet-facing interface. The Orthanc documentation recommends HTTPS and a reverse proxy for Internet exposure. Check that certificates are renewed on the proxy, that proxy access logs are retained, and that node addresses are reachable only from the proxy and the database network.

Disable script and export routes

The /tools/execute-script route can let a malicious user run any system command on the host, and the export route can overwrite files. Both should stay disabled on every node in the cluster, including nodes added during a scale-out. Because each node has its own configuration file, confirm the setting on each one after every change, and review the configuration in your change control process rather than relying on one node's settings.

Authenticate to PostgreSQL

Every node holds credentials for the shared index, so the PostgreSQL side needs the same care. Use SCRAM password authentication, since PostgreSQL 18 deprecated MD5 password authentication. Certificate authentication or LDAP can be used where the organization already manages identities that way. Restrict the pg_hba.conf entries to the Orthanc node addresses, and confirm the chosen method with your database team before the first node connects.

PostgreSQL authentication methods

Encrypt DICOM traffic between sites

Orthanc supports DICOM TLS encryption for inter-site exchanges starting with version 1.9.0, which covers peers and modalities that send studies to the cluster from other locations. Enable it for each site connection, exchange and verify certificates with the remote operator, and record which nodes accept TLS and which still accept plain DICOM. Plain DICOM ports left open after rollout are a common gap in shared clusters.

Test backups and restores

A shared index and shared storage are a single point of failure even when several nodes are running, because a bad database change or deletion affects all of them at once. Back up the PostgreSQL database and the DICOM file storage together, using a method that keeps them consistent, and keep a copy outside the cluster network. Schedule restore tests on a separate environment and record how long recovery took, since the restore results determine whether the backup is usable.

Continuous archiving and PITR

Making the PostgreSQL layer survive a failure

Several Orthanc nodes sharing one PostgreSQL index only help availability if the database itself can survive a failure, and PostgreSQL does not provide that on its own. PostgreSQL supports hot standby servers that answer read-only queries, and it offers both synchronous replication, where a commit waits until a standby confirms it, and asynchronous replication, where the primary does not wait. Synchronous replication protects committed index changes at the cost of write latency, which matters because every Orthanc node writes to the same database. Asynchronous replication is faster but can lose the most recent commits if the primary fails. Choose the mode deliberately and confirm the trade-off with your DBA before the first production load.

PostgreSQL does not detect a dead primary or promote a standby by itself. The official failover documentation expects external tooling to decide when to fail over, promote the standby and redirect clients. Plan that tool as a named component with an owner, a tested promotion procedure, and a way to stop the old primary from accepting writes if it returns. Then check how each Orthanc node reaches the database: a fixed hostname or connection pooler such as PgBouncer lets you repoint nodes without editing every Orthanc configuration. Confirm which connection details the PostgreSQL plugin reads and whether a restart is needed after a change.

Replication copies mistakes as faithfully as it copies data. A bad DELETE, a faulty migration or a corrupted table reaches the standbys within moments, so replication does not answer those failures. The answer is continuous archiving with point-in-time recovery, which keeps a base backup plus archived write-ahead log so the database can be restored to a moment just before the damage. Confirm that archives are stored away from the primary, that retention covers the time you need to notice a problem, and that restores are rehearsed. Restore testing should also check that the restored index still matches the DICOM files in storage, since the two must stay in sync. Backup design for the whole archive is covered in the backup section of this guide.

Questions teams ask before running multiple Orthanc instances

What does running multiple Orthanc instances on one PostgreSQL database cost?

No public price exists for this work, and DeployOpen does not publish a price list. Cost follows from the written scope, which covers the number of Orthanc nodes, the PostgreSQL topology (single server, hot standby or synchronous replication), the load balancer, shared storage, and the test plan. Orthanc itself has no paid edition, so the license cost is zero, but Orthanc Team SRL sells deployment and configuration services, including pre-paid dedicated support hours valid for 12 months, quoted on request. Ask any provider for a one-time build quote and a separate recurring figure for support, upgrades and monitoring, and check whether storage and database hosting are included.

What drives the effort in a multi-instance Orthanc setup?

Effort rises with four factors: topology, storage, database high availability and testing. Topology covers how many Orthanc nodes sit behind the load balancer and how sessions and uploads are routed. Storage covers whether every node reads the same DICOM files through shared storage or an object storage plugin, and how locking and deletion behave across nodes. Database high availability matters because PostgreSQL does not detect a failed primary or promote a standby on its own, so automatic failover needs external tooling. Testing covers concurrent uploads, retrieves, deletions and failover drills against realistic DICOM data.

How long does it take to set up and confirm a multi-instance deployment?

The duration cannot be estimated without a written scope, because it depends on the topology, the number of sites, the existing archive size and how many failure scenarios the team wants to test. Ask the provider for a timeline split into design, build, integration testing, failover testing and handover. The reader's own environment sets the longest steps: network approvals, storage provisioning, database access and change windows for the first production cutover. Confirm whether the timeline includes a period of parallel running.

What must our team provide before the work starts?

The team must provide network access between the Orthanc nodes, the PostgreSQL servers and the load balancer, plus the DNS names and certificates that clients will use. Storage must be sized and presented to every node in the form the design requires. A DBA must be available to create roles, review connection limits and approve replication settings. The team also needs representative DICOM test data, including large studies, modalities that send and retrieve, and a list of viewers and integrations that call the REST API. Confirm who owns change approvals and maintenance windows.

Can our own team run multiple Orthanc instances on one PostgreSQL database without outside help?

Yes, if the team has Linux, PostgreSQL and DICOM networking skills and time to test failure cases. The sample in the orthanc-setup-samples repository shows connecting multiple Orthanc instances to the same PostgreSQL database with HTTP load balancing, which gives a reference starting point. The harder work is not the first start but the operational edges: concurrent writers, failover behavior, backup consistency across the index and files, and upgrade order. Teams that lack a DBA or a PostgreSQL on-call rota should weigh that gap before choosing to operate it alone.

Does an upgrade path exist for a multi-instance Orthanc cluster?

Yes. Orthanc 1.9.2 with PostgreSQL and MySQL plugins 4.0 introduced shared database access, and the current release line includes 1.13.0, released on 2026-08-15, which followed 1.12.11 on 2026-04-14. Upgrades need a plan covering the order in which nodes are stopped and started, schema changes, and compatibility between the core and the database plugin. On the database side, PostgreSQL 18 is the newest supported major version, and PostgreSQL 14 reaches end of support on November 12, 2026. Minor releases replace executables and restart, while major upgrades use dump and restore, pg_upgrade or logical replication. Ask for a written upgrade runbook and a rehearsal on a copy.

What are the limits of several Orthanc nodes writing to one index?

Multiple nodes can read and write the same PostgreSQL database, but the design still has limits. Concurrent writes depend on database locking, connection limits and the load balancer's routing of uploads, so heavy parallel ingestion needs testing before go-live. Shared storage must behave consistently for all nodes, and deletion or recycling must not remove files that another node is still serving. Orthanc's security guidance also applies to each node, including keeping the /tools/execute-script and export routes disabled and enabling authentication when remote access is allowed. Confirm these points in a test plan rather than assuming the sample configuration covers your load.

Does Orthanc Team SRL or DeployOpen offer this work, and how do quotes work?

Orthanc Team SRL sells deployment, configuration and development services for Orthanc and quotes them on request. DeployOpen is a Chainscore Labs company that plans, implements, hardens, backs up, upgrades, documents and supports self-hosted open-source platforms inside the client's own infrastructure. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. DeployOpen does not publish a price list, and a quote follows from the written scope. Ongoing support, upgrades and continuous testing are available as retainers. Compare any quote against the same written scope.

How DeployOpen scopes and delivers a multi-node Orthanc cluster

The sequence turns a set of Orthanc nodes sharing one PostgreSQL index into a documented cluster that has been tested for instance failure before it takes production traffic.

  1. Confirm the target architecture and version baseline

    DeployOpen reviews your current Orthanc version, PostgreSQL version, storage layout and the clients that send and retrieve studies, then records the target node count and the environment where the cluster will run. Your team confirms the Orthanc release line and the PostgreSQL major version against the vendor support windows, since the cluster must run versions that support shared database access. The output is a short architecture note that both sides sign off on before any scope is priced.

  2. Agree the written scope and deliverables

    DeployOpen drafts a fixed-scope statement covering node count, database topology (single primary or replicated PostgreSQL), shared storage, HTTP load balancing, DICOM endpoint handling, testing and handover. Each deliverable, the client responsibilities and the acceptance criteria are written down. The quote follows from this written scope, and no build work starts until both parties accept it. The output is a signed scope document that names every exclusion, such as hardware procurement or network changes you own.

  3. Prepare infrastructure and access inside your environment

    Work proceeds inside your cloud accounts, data centers or private network, so DeployOpen engineers operate under your identity, approval and change processes. Your team provisions the nodes, the PostgreSQL service, the shared storage path and the load balancer, and grants the access DeployOpen needs. The check at the end of this step is a documented inventory of hosts, network paths, credentials locations and backup targets, confirmed by your team.

  4. Build and configure the shared-index cluster

    DeployOpen installs the Orthanc nodes with the PostgreSQL plugin, points each node at the same database and shared storage, and configures the load balancer in front of the HTTP ports. Configuration is kept in version control so every node runs the same settings. The output is a cluster where a study uploaded through one node can be found and retrieved through another, verified with a set of end-to-end test transactions.

  5. Run failover and concurrency tests

    DeployOpen stops individual Orthanc nodes and, where the scope includes it, the PostgreSQL primary, while uploads and queries continue. The tests record what the load balancer routes, which jobs fail or retry, and whether any writes conflict. Limits on concurrent writers are measured, not assumed. The output is a test report with each scenario, its observed result and the fixes applied, and a retest after each fix.

  6. Document operations and hand over

    DeployOpen writes the runbook: how to add or remove a node, how to restart nodes safely, how to read the logs and metrics, and how to recover from each tested failure. Your staff are trained on the procedures and run at least one failover drill themselves while DeployOpen observes. The handover is complete when your team has the runbook, the configuration repository and the test evidence.

  7. Go live and move to retainer support if wanted

    After acceptance, the cluster takes production traffic under the agreed change window. DeployOpen supports the cutover and watches the first period of live use for errors that the tests did not cover. Ongoing upgrades, Orthanc and PostgreSQL version reviews, and continuous failover testing can continue under a retainer, which is scoped separately in writing. The output is a live cluster with a documented support path and a record of every change.

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.