Orthanc health checks and automatic restart

Orthanc health checks tell you when a running server has stopped answering, so an automatic restart can recover it. Set them up with a restart pause for long database upgrades so recovery does not interrupt the work.

On this page

Orthanc health checks: what they catch and when you need them

A process-level restart policy only helps when the Orthanc process exits. The more common failure in an archive is quieter: the container keeps running, the port stays open, and requests from viewers and modalities simply stop completing. Orthanc health checks exist to catch that state. A health check periodically asks the instance a question that requires it to actually respond, and if the answer does not come back in time, the instance is marked unhealthy. Automatic restart is the recovery step that follows, so the archive returns to service without someone noticing the outage first.

Teams need this most when Orthanc runs unattended for long periods, when a single node is the only path for modalities or viewers, or when several nodes sit behind a load balancer and one silent node would otherwise keep receiving traffic. A health check is also valuable where a stalled archive delays scheduled transfers or interrupts clinical reading. If your Orthanc is reached only through a single standalone container on a workstation used during business hours, the cost of a hang may be lower, but the reasoning is the same. Write down which clients depend on the instance and how long an outage can be tolerated before you decide how aggressive the checks should be.

The exact probe behavior is tied to the Orthanc version and the Docker image you run, so confirm it before relying on it. Check which endpoint the image's health check calls, what it returns when the database or storage is slow, the interval and timeout values, and how many failures trigger a restart. Confirm these in your own environment with a deliberate test: stall the instance, watch the status change, and verify the restart. The Orthanc Book security FAQ is a useful reference for the access settings that the probe must work alongside, since a probe that cannot authenticate will mark a healthy instance as failing.

How a failed Orthanc health check leads to a restart decision

The flow starts with a probe that runs on a fixed interval against the Orthanc instance. A passing result keeps the container running and the probe simply runs again. A failure is counted, and only after the configured number of consecutive failures does the supervisor consider a restart. Before restarting, the decision checks for a maintenance flag, such as a database upgrade in progress. If the flag is set, the restart is paused and the operator is alerted instead, so check the maintenance flag before you tune retries.

Probe results decide between keeping the instance running, restarting it, or pausing for maintenance.

Which Orthanc health checks fit your deployment

This table compares four ways to detect a hung Orthanc: the Docker aliveness probe, the health-check sample, an external monitor polling the REST API, and an orchestrator probe or autohealing container. Read each row against your own failure modes, because a check that only proves the process responds will not reveal stalled jobs or a database that has stopped accepting writes.

CheckWhat it detectsWhat it missesWho acts and when it fits
Docker aliveness probeWhether the container's built-in probe, as defined for your image version, gets a response from the HTTP endpoint it targetsStalled background jobs, a database that rejects writes while HTTP still answers, and storage that is full or unmountedDocker marks the container unhealthy. Fits single-host Docker deployments that need a basic signal. Confirm the exact endpoint and command in the Orthanc Book and Docker image documentation for your version.
Health-check sample supplied with Orthanc deploymentsA scripted check of the sample's chosen endpoints, which you can extend to test more of the serviceOnly what the sample tests. Its coverage depends on the file version you copy, so checks it does not run stay invisibleThe operator or a wrapper script decides the response. Fits teams that want a reviewable starting point they can adapt. Verify the sample file name and contents for your release before relying on it.
External monitor polling the REST APIReachability and response of endpoints you choose, plus response time and status codes from outside the containerInternal state such as job queue health, unless the monitor queries those endpoints, and causes inside the hostThe monitoring team receives an alert and decides whether to restart. Fits regulated sites that need alerts routed to a human and an audit trail. Pair with authenticated checks if access control is enabled.
Orchestrator liveness probe or autohealing containerFailed probes that trigger automatic restart of the container or pod without waiting for a personProblems the probe does not test, and failures that restart does not fix, such as a corrupted index or full diskThe orchestrator or autohealing tool restarts the workload. Fits clusters and hosts where fast recovery matters. Pause restarts during long database upgrades, or the restart may interrupt the upgrade.

Why a liveness probe alone can miss a hung archive

A liveness probe that only confirms the process and its HTTP port respond can report an Orthanc instance as healthy while it cannot do useful work. The process can accept a TCP connection and return a response from the web layer while the index is locked, the database connection pool is exhausted or a request thread is stuck. A shallow check answers whether the program is alive, not whether the archive can read its index and serve a request. Treat the two as different questions and decide which one your restart logic is allowed to act on.

The trade-off is easy to state and harder to tune. A shallow probe rarely causes false restarts, but it may pass while the server is degraded. A deeper probe that reads the index through a REST route can catch that state, yet it can also fail under heavy load, during startup or while a large job holds the database, and a restart triggered by a slow but healthy instance can start a restart loop. Set the timeout and failure threshold with your observed peak load in mind, and test the probe against a busy instance before you enable automatic restarts.

Before you rely on the health-check sample, confirm which REST route it calls and whether that route touches the database. A route that returns a static response proves only that the web layer runs. A route that queries the index proves more, but you should verify its cost under your own load and that it does not require credentials your probe cannot supply. Record the route, its expected response and its timeout in your runbook so that an on-call engineer can tell a real hang from a probe that was configured too strictly.

Setting up Orthanc health checks and restart policy

This sequence takes an Orthanc instance from an unmonitored state to one where a hung server is detected, restarted within set limits, alerted to an owner and paused cleanly for maintenance. Each step ends with a check the operator can verify before moving on.

  1. Confirm the Orthanc version and image tag

    The platform or infrastructure owner records the exact Orthanc core version, the database plugin versions and the Docker image tag in use, and pins the tag instead of relying on a floating label. Health check behavior and endpoints can differ between releases, so the team checks the NEWS file for the target release before writing any probe. Done when the running container reports the expected version through the system endpoint and the same tag appears in the deployment manifest.

  2. Lock down remote access before exposing probes

    Before any probe or monitoring credential reaches the server, the security owner confirms that RemoteAccessAllowed is disabled unless remote access is required. If it is enabled, AuthenticationEnabled must be true and every user must be defined in RegisteredUsers, with HTTPS terminated at a reverse proxy for any network exposure. The security FAQ also says the script execution and export routes should stay disabled. Done when an unauthenticated request to a REST route returns an authorization failure from a host other than the Orthanc server itself.

  3. Add the probe with a read-only credential

    The platform engineer creates a dedicated Orthanc user with a status-reading role only, stores its password in the orchestrator's secret store, and configures the chosen aliveness probe or the health-check sample against a system status endpoint. The probe should not call routes that write, delete or run scripts. Done when the container shows a healthy state in the runtime and the probe account is denied a write request made with its own credentials.

  4. Set the restart policy and retry limits

    The platform owner defines how many consecutive probe failures mark the container unhealthy, how long each probe waits before timing out, and whether an autohealing component is allowed to restart the container automatically. Retry and restart limits should be set so that a crash loop stops and escalates instead of restarting indefinitely. Values are chosen from the team's own measured startup time on its hardware, since no fixed interval is published here. Done when the written configuration lists each threshold and the runtime reports the same values.

  5. Run a deliberate failure test outside production

    In a non-production copy of the archive, the operator blocks Orthanc's HTTP port or stalls the process, then watches the probe move to unhealthy and the restart policy act within the configured limits. The test should also check that the restart does not leave the database in an inconsistent state. Done when the event log shows the expected sequence of failure, restart and recovery, and the restart count stops at the configured limit when the fault is kept in place.

  6. Confirm the alert reaches a named owner

    The operations lead connects the unhealthy state to the team's alerting channel and names a primary and backup owner for each Orthanc instance. The operator triggers the failure test again and confirms that the message arrives, includes the instance name and links to the logs. Done when the named owner acknowledges the test alert within the team's own agreed response process.

  7. Document the maintenance pause procedure

    The platform team writes the steps for pausing automatic restarts during a long database upgrade or schema change, including how to disable the autohealing component, who authorizes the pause, how the probe is set to ignore the planned outage and how restarts are re-enabled afterward. Restarts must not run while a schema migration is in progress. Done when a second operator has followed the written procedure in the test environment and restored automatic recovery without help.

Where automatic restarts go wrong

An automatic restart fixes a hung process, but it can also hide faults, interrupt work and repeat the same failure. The cards below pair each failure mode with the symptom to watch for and the control to add before the probe goes live.

Restart loop on a slow startup

A liveness probe with a short timeout can kill Orthanc while it is still opening a large index, so the container restarts, starts indexing again and is killed once more. Watch for a restart count that climbs during the first minutes after each start. Add a startup probe or a longer initial delay, and size that delay from measured startup times on your own archive, not from a default.

Scalability FAQ

Restarts that interrupt jobs

A restart cancels in-flight DICOM transfers and REST calls, and background jobs in the queue may need to resume or be retried. Watch for modalities reporting failed store operations and jobs left in a pending or failed state right after a restart. Add a rule that checks for active transfers and jobs before the autohealing action runs, and confirm with the Orthanc docs how saved jobs behave across restarts in your version.

Restart during a schema change

Restarting Orthanc while a database schema upgrade is running can leave the index half-migrated and harder to recover than the original hang. Watch for startup errors that mention the schema version after an upgrade window. Pause automatic restarts for the whole upgrade window, and take a verified database backup before the upgrade begins.

Repeated restarts hiding disk faults

When a failing disk or full storage volume causes requests to stall, each automatic restart clears the symptom and the fault stays unnoticed. Watch for steady restarts with no change in load, along with disk errors or rising usage in the host logs. Alert on the restart count itself, and set a limit after which the container stops restarting and pages an operator.

Probe passes while storage is down

A simple HTTP aliveness check can keep returning success while the object store or database behind Orthanc is unreachable, so the instance looks healthy but cannot store or read studies. Watch for successful probes alongside failed store or retrieve operations in the logs. Extend the check to exercise storage, or pair it with a monitor that tests a real read and write path.

Orthanc plugins

Pausing restarts during long database upgrades

A long database upgrade can look exactly like a hung Orthanc to a health check. While a schema change rewrites index tables, the HTTP endpoint may stop answering for minutes or longer, so a probe that expects a quick response will mark the container unhealthy and autohealing will restart it. Automatic restart must be paused for the duration of the upgrade, because a restart in the middle of a schema change can leave the index partly migrated. Recovering from that state is slow and costly, and it can require a restore from backup rather than a simple retry.

Before the upgrade window opens, decide who owns the pause and write the steps down. For the affected container, disable the restart or autohealing action for that container only, so the rest of the stack keeps its normal recovery. Then confirm progress from the container and Orthanc logs rather than from the probe, since the probe result is the signal you are suppressing. Look for the migration messages and for the server reaching its normal startup sequence. Re-enable recovery only after Orthanc starts cleanly and answers its system endpoint, and record the time the pause was lifted. Confirm the exact upgrade-time behavior, including any migration steps, in the release notes for your target version, and check the sequence of schema changes in the Orthanc NEWS file before you start.

Keep a rollback path that you have actually tested. That means a verified backup of the index and the DICOM files taken together, the previous container image or package kept available, and a written decision point for when to stop waiting and roll back. Set that threshold in advance with the database owner, since an unplanned restart during the wait is the outcome the pause exists to prevent. For the migration steps themselves, including multi-instance clusters where every node must be stopped or upgraded in a specific order, follow the Orthanc upgrades group rather than improvising them here.

Security and operating a health check safely

A health check that restarts containers is itself an attack surface and an operational lever. The cards below cover who can reach the health route, how credentials are handled, who can trigger restarts, which Orthanc routes stay disabled, and how every automatic restart is recorded.

Restrict the health route

Treat the health endpoint as an Orthanc REST endpoint, not a public URL. By default Orthanc only accepts HTTP connections from localhost, so a probe running inside the container or on the same host works without opening anything. Keep RemoteAccessAllowed off unless a remote monitor truly needs it. If you enable it, set AuthenticationEnabled to true, define users in RegisteredUsers, and check that the port is not reachable from the Internet.

Security FAQ

Keep credentials out of probes

A probe that carries a password in its command line exposes that password to anyone who can read process listings, container inspection output or orchestrator manifests. Avoid placing credentials in the HEALTHCHECK instruction, environment values visible in image metadata or shell arguments. Where authentication is required, read the secret from a mounted file or the platform secret store, and confirm that the probe account can only read the status route.

Limit who can restart containers

Restart rights are powerful because a restart discards in-memory state and interrupts DICOM associations and running jobs. Restrict the rights to restart containers, pods or services to a named operations group, and separate them from rights to edit configuration. Confirm with your platform team who holds those rights in Docker, Kubernetes or your autohealing tool, and review that list as staff change.

Keep high-risk routes disabled

The Orthanc security FAQ warns that the /tools/execute-script route can let a malicious user run any system command, and that the export route can overwrite files. Both should stay disabled in production. Verify this after every upgrade and configuration change, because a health-check rollout is a common moment for someone to enable a route to debug a fault.

Security FAQ

Log every automatic restart

Record each automatic restart with its timestamp, the container or service name, the probe result that triggered it and the restart count over a window. Keep these records in a store that the Orthanc administrators cannot silently edit. Without them, incident responders cannot tell a legitimate recovery from a sign of tampering, and a restart loop can hide behind normal-looking availability.

Orthanc health checks questions buyers ask

Can our team set up Orthanc health checks and automatic restart ourselves?

Yes, for a single Orthanc node with a clear runbook, a team with Docker experience can add an aliveness probe and a restart policy. The work needs someone who can read container health status, write a small health-check script, test that a hung instance is detected and restarted, and document what happens to in-flight transfers. The harder part is deciding what counts as hung, because a long database upgrade or a large import can look unresponsive without being broken. Teams without that judgment, or with several nodes behind a load balancer, usually benefit from an outside review of the design before they rely on it.

What makes the effort for Orthanc restart automation grow?

The main drivers are the number of Orthanc nodes, the orchestrator that runs them, the monitoring stack that reports on them, the maintenance procedures and the amount of testing required. A single Docker host with one container is a small job. Several nodes on a shared PostgreSQL index, a Kubernetes or Swarm cluster, autohealing tooling and alert routing each add design decisions and failure cases to test. Maintenance procedures also matter: teams need a documented way to pause restarts during long database upgrades and to resume them afterward. Ask any provider to break its quote into design, build, test and handover, and to state which of these items are included.

Is a partner worth it for a regulated Orthanc archive?

A partner is worth considering when restart behavior must be documented, tested and explained to auditors, clinical governance or your own security team. Patient image archives have stricter expectations for availability, change control and evidence than a typical internal tool. Orthanc is open source, so the core software has no vendor support contract to rely on, and a partner can help define the failure cases, write the runbook, and run restart tests that produce records. Orthanc Team SRL also sells services, and its pre-paid dedicated support hours are valid for 12 months, quoted on request (Orthanc Team). Your internal team still owns the decisions about your environment.

What do we need to provide before a health check engagement starts?

The engagement needs access to the environment where Orthanc runs, including the container host or cluster, the monitoring tools and the relevant configuration, under the access rules your organization sets. It also needs maintenance windows for testing restarts, because a deliberate hang and recovery test interrupts the service. Name one owner for alerts who can respond when a restart happens and who approves changes to probe settings. Provide the current runbook, the upgrade schedule and any rules on how long a long import or database migration may run. The scope should state which of these inputs you supply and which the provider handles, in writing before work starts.

Does DeployOpen certify our Orthanc setup for compliance?

No. DeployOpen does not issue audit reports, attestations or certifications. It can prepare the systems, documented controls and test evidence that a compliance assessment will review, such as the probe configuration, restart test records, runbook and alert routing. Independent auditors and certification bodies carry out the assessment and decide whether the controls meet the relevant requirements. Ask any provider which evidence it will hand over, in what format, and who keeps it current after handover.

What does the scope include for Orthanc health checks?

A written scope should list the detection method, the recovery action, the test plan and the handover material. Detection covers the Docker aliveness probe or equivalent, the health-check sample logic and any autohealing tool. Recovery covers restart limits, how restarts interact with the database and storage, and how restarts are paused during long database upgrades. Testing covers deliberate hang scenarios and confirmation that alerts reach the owner. Handover covers the runbook and the settings to be kept under change control. Anything outside these items, such as broader monitoring dashboards or log design, should be listed as separate work so the quote stays comparable.

What should we check before trusting an automatic restart?

Check that the probe tests real service behavior, not only that the process exists, and that it is not triggered by normal slow operations such as large imports or migrations. Confirm that a restart cannot interrupt a database schema change, and that repeated failures stop restarting and raise an alert instead of looping. Verify that storage and database state survive a forced restart, and that the team knows how to recover jobs that were running. Write down the expected behavior and repeat the test after each Orthanc upgrade. Confirm the exact probe options and version-specific behavior with the Orthanc documentation and your own test environment before production use.

Limits to confirm in your environment

The health check path for Orthanc depends on the exact version, image and orchestrator in use, and none of those can be assumed from documentation alone. The cards below list the items to confirm in a test environment before a restart policy goes near a production archive.

Exact health endpoint for your version

Confirm which URL path the probe calls and what response counts as healthy for the Orthanc release you run. The endpoint and sample script should be checked against the documentation for that specific version, because the 1.13.0 release rewrote storage-area access and parsing, and a path that worked on an earlier release may behave differently. Record the version and endpoint together in your runbook so a future upgrade triggers a re-check.

Orthanc downloads

Built-in health definition in the image

Check whether the Docker image you deploy ships with a health check definition, and whether your own compose file or orchestrator manifest overrides it. A health definition in the image and a second one in your deployment can disagree on interval, timeout or retries. Inspect the running container's configuration rather than trusting the image tag alone, and confirm which check is actually executing.

Orchestrator and autohealing behavior

Find out how your platform treats a failed probe: whether it marks the container unhealthy, restarts it immediately, waits for a threshold of consecutive failures, or hands the decision to an autohealing tool. Confirm the failure threshold and the restart backoff. A short threshold on a busy archive can restart a node that was only slow to answer, which interrupts DICOM transfers in progress.

Probe behavior during startup and migration

Test what the probe reports while Orthanc starts, rebuilds its index or runs a database schema upgrade. A long migration can look like a hang to a probe with a short start period. Measure startup duration on a copy of your largest database, set the start grace period above that measurement, and confirm that your platform can pause restarts during planned upgrades.

Interaction with shared PostgreSQL nodes

When several Orthanc instances share one PostgreSQL database, confirm that a restart of one node does not affect the others and that the probe checks only its own process. Review the scalability guidance on multiple instances, and test a rolling restart under load to confirm that jobs and writes continue on the remaining nodes. Verify that the restarted node rejoins cleanly without manual cleanup.

Scalability FAQ

How DeployOpen scopes and delivers Orthanc health checks

DeployOpen plans, builds and documents health checks and automatic restart for Orthanc inside your own infrastructure, starting from a written scope. The work covers how a hung instance is detected, how recovery is triggered and when restarts must be paused, with each step tested and handed over to your team.

How we scope

  • Confirm how Orthanc runs today: Docker, Linux package or Windows service, and the database back end in use.
  • Agree which probes, health-check scripts and autohealing rules are in and out of the written scope.
  • Record the maintenance windows, including database upgrades where restarts must be paused, before any build begins.

How we build

  • Configure the Docker aliveness probe and health-check settings for your Orthanc image and network layout.
  • Test the health-check sample against a deliberately stalled instance to confirm detection and recovery behave as designed.
  • Set up the autohealing or orchestration rules and a documented pause procedure so restarts stop during long upgrades.

How we hand over

  • Deliver the probe definitions, configuration files and restart rules as versioned artifacts in your environment.
  • Provide a runbook covering how to pause and resume automatic restarts and how to read the health signals.
  • Walk your operations team through failure tests and record the results in the engagement documentation.

How we support

  • Engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer.
  • Revisit probe and restart settings when you move to a new Orthanc release or change database plugins.
  • Retest health-check behavior after infrastructure changes so recovery rules still match how your instance runs.

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.