What an Orthanc Java plugin is for and when a team needs one
If your team runs Orthanc and needs behavior that its settings and REST API cannot provide, this page explains when a Java plugin is the right extension route and what it takes to build one. Orthanc's core is licensed under the GNU General Public License version 3 or later, and the server is extended through plugins that load into the process rather than through external scripts. Before you commit to Java, check what Orthanc already does. The official plugins cover database back ends such as PostgreSQL, MySQL/MariaDB and ODBC, object storage on S3, Azure and Google Cloud, DICOMweb, modality worklists, the Orthanc Explorer 2 interface, the Stone Web and OHIF viewers, and an advanced authorization plugin. A Java plugin is for behavior none of those cover, such as a custom REST route that your applications call or a reaction to instances as they arrive that your own rules define.
Confirm SDK coverage before you design anything. The Java SDK does not expose every capability of the C or C++ plugin interface, and coverage changes between releases. Check the plugin documentation in the Orthanc Book plugins page against the exact Orthanc version you run, and record which callbacks, REST operations and storage calls the SDK supports. Also confirm that the functions your design depends on exist in that version. The latest core release at the time of writing is 1.13.0, but the version you deploy should be the one you test against.
Write down the requirement in one sentence and test it against two questions: can a setting or an existing official plugin meet it, and does it need to run inside the server process? If a configuration key or REST call solves the problem, use that. If the need is a new HTTP endpoint or a per-event decision inside Orthanc, a plugin is the right tool. Plan for the licensing consequences too, since a plugin linked into a GPL-licensed server carries obligations for the code you distribute, so have legal review them before you release anything.
Which extension language fits which kind of team
This table compares Lua, Python, Java and C or C++ for extending Orthanc across team skills, logic complexity, build effort, testing and long-term maintenance. Read each row against your own team's skills and the work you expect to hand over. Confirm Java SDK coverage for your target Orthanc version before you commit to a Java design.
| Criterion | Lua | Python | Java | C or C++ |
|---|---|---|---|---|
| Team skills | Suits operators and integrators comfortable with short scripts and event callbacks | Suits teams with Python and pydicom experience who want readable routines | Suits teams with Java services, build tooling and an existing JVM operations practice | Suits teams with native development experience and tolerance for memory-safety and build complexity |
| Kind of logic needed | Filtering incoming instances, simple routing and REST calls | Routine processing, pydicom work, scheduled tasks and custom routes | Typed domain models, larger integrations, custom routes and background queues | Low-level storage or parsing changes and performance-critical code paths |
| Build and packaging | Minimal: script files loaded by the server | Low: plugin loaded with a Python environment that must match the server | Moderate: compiled artifacts and SDK bindings packaged for each target version | Highest: compiled per platform and rebuilt for each core upgrade |
| Testing | Quick manual checks, harder to unit test at scale | Good unit test options with standard Python tooling | Strong unit and integration testing with mature Java tools | Strong when the team already has native test harnesses |
| Maintenance after handover | Easy for small teams, but scripts can sprawl without conventions | Easy to hand over if the team keeps dependencies pinned | Suits long-lived code owned by a service team with JVM skills | Needs engineers who can maintain native code across Orthanc upgrades |
| Java SDK coverage for your version | Not applicable | Not applicable | Confirm which SDK functions and plugin callbacks your target Orthanc version exposes | Not applicable |
| License question | Review with counsel: obligations depend on how scripts and plugins are distributed | Review with counsel: obligations depend on how scripts and plugins are distributed | Review with counsel: obligations depend on how the plugin is distributed alongside Orthanc | Review with counsel: obligations depend on how the plugin is distributed alongside Orthanc |
How a Java plugin sits between client requests and the Orthanc core
The diagram starts with a REST client or viewer calling a route exposed by the Java plugin. The request crosses the trust boundary into the plugin host, where authorization should be checked before any work runs. The plugin then calls the Orthanc core through its API, while the core handles DICOM events and storage and sends callbacks back to the plugin. Check where authorization is enforced and whether the plugin reaches external databases or identity services over paths you have secured.
Request, authorization and callback paths between clients, the Orthanc core and a Java plugin.
Setting up a Java plugin build, install and verification
This sequence takes a Java plugin from a written behavior specification to a build that loads on a test Orthanc instance and answers its routes only as intended. Each step ends with a check the team can record before the plugin moves toward any shared environment.
Scope the required plugin behavior
The team lists the events the plugin must react to, the REST routes it must expose, any data it must store in the key-value store or queues, and the systems it must call. A named owner signs off on this list, and each item is marked as in scope or deferred. The step is done when every route and event has an acceptance check written in plain terms, such as the expected response for an unauthenticated request. This list decides whether Java is the right language at all, so it should be settled before any build tooling is chosen.
Confirm the Orthanc version and plugin settings
Someone on the team records the exact Orthanc release the plugin will target, then reads the plugin loading and authentication settings in the Orthanc Book for that release. Confirm the packaging format, the plugin path configuration key and the Java plugin requirements for your operating system and container image, because these change between releases. Download the server build only from the official download channels. The step is complete when a written note names the release, the configuration keys used and the source page each was checked against.
Select and pin the Java SDK version
A developer chooses the SDK and Java runtime versions that match the Orthanc release confirmed in the previous step, and pins them in the build file. Check the SDK's compatibility notes against the Orthanc Book plugin documentation rather than assuming the latest version works. The step is done when the build file contains pinned versions and a short record shows which combination was tested together.
Build the plugin against the chosen SDK
A developer compiles the plugin and produces the shared library artifact that Orthanc will load, along with any Java runtime files the packaging requires. The build should run from a clean checkout in the same way on every developer machine and in CI. The step is complete when the build succeeds from a clean state and the produced artifact name and size are recorded with the build log.
Install the plugin on a test instance
An engineer copies the artifact to a dedicated test Orthanc instance, not a clinical or shared archive, and sets the plugin path in the configuration file as the Orthanc Book describes for the confirmed release. Keep remote access disabled during this step. Restart the server with logging enabled. The step is done when the server starts without errors and the configuration file change is saved in version control.
Confirm the plugin loads in the startup log
The engineer reads the server's startup log and searches for the plugin's name and version string. The plugin's own initialization message should appear once, with no load errors for the Java runtime or missing dependencies. If the plugin does not appear, check the plugin path, the runtime version and file permissions before changing any code. The step is complete when a saved log excerpt shows the plugin loaded cleanly.
Verify routes answer only after authentication
Before exposing any route, the engineer enables authentication with a test user defined in the configuration, as the Orthanc Book security guidance describes. Send a request to each plugin route without credentials and confirm it is refused, then send an authenticated request and confirm the expected response. The step is done when a short test record lists each route, the unauthenticated result and the authenticated result. Repeat this check for any route that the team later exposes through a reverse proxy.
How REST routes, event handlers and key-value storage fit together
A Java plugin for Orthanc usually combines three pieces: a custom REST route that starts or reports on a workflow, an event handler that reacts when instances or studies arrive or change, and some state that survives between those calls. Design these together rather than adding them one at a time. Start by writing down which events the workflow depends on and which route callers will use to trigger or inspect it. The first design question is which work must finish before Orthanc continues. Anything that changes what gets stored or returned, such as rejecting an instance or altering its metadata during reception, must run synchronously inside the callback. Work that only notifies another system, builds a derived file or updates a dashboard can usually be deferred. Confirm in the Java SDK documentation exactly which callbacks are blocking, what they may return, and whether an exception in a handler fails the originating DICOM or REST operation.
Second, decide where state lives. If several Orthanc instances share one database, as the scalability model allows for the PostgreSQL and MySQL/MariaDB plugins, an in-memory map in one JVM will not see what another instance has already processed. Treat process-local caches as optimizations only and make the authoritative record of progress something every instance can read and update safely. Check whether the SDK exposes a key-value store or a queue, and if it does, confirm the version in use, its persistence behavior across instances, and its thread-safety. Do not assume that a route handler and an event callback run on the same thread or in a specific order. If the SDK offers a queue, verify how items are claimed, retried and acknowledged before building a workflow that depends on exactly-once processing.
Finally, test the seams. Replay the same instance twice, call the route while the event handler is running, and restart one instance mid-workflow to see whether state stays consistent. Record which state is safe to lose and which must survive a restart, then size the storage and retry behavior around that answer. Because the SDK surface and its thread-safety guarantees differ by Orthanc and plugin release, confirm each capability against the documentation for your exact version before you design around it. The Orthanc Book plugins page is the natural starting point for locating the plugin documentation that matches your release.
Security risks a custom Java plugin adds to Orthanc
A Java plugin runs inside the Orthanc server process and can add REST routes, read and write patient images, and change server behavior. The risks below connect because each one widens what a remote caller or a line of plugin code can reach, so each needs a deliberate decision and a test before production.
New routes under remote access
Orthanc only accepts HTTP connections from localhost by default. Once RemoteAccessAllowed is enabled, every REST route your plugin registers becomes reachable from whatever network Orthanc can see. Map each new route to the caller it is meant for, and confirm in the Orthanc Book security FAQ which default routes stay exposed. Test every new route from outside the intended network before production, including requests with no credentials and malformed input.
Authentication and registered users
The security FAQ advises that when remote access is enabled, AuthenticationEnabled should be true with users defined under RegisteredUsers. A plugin route that skips the server's authentication check, or that trusts a header supplied by the client, bypasses this control. Confirm that each custom route rejects unauthenticated calls and that service accounts used by automation have only the rights they need.
Script and export routes stay disabled
The 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. A Java plugin does not need either route to add its own behavior, so keep both disabled. Review the plugin's configuration and any reverse proxy rules to confirm neither route is reachable by a caller, and record that check in your deployment evidence.
Trust in plugin code
Java plugin code runs inside the Orthanc server process, so a defect in it can read or change any study the server holds, and a dependency with a flaw runs with the same privileges. Review the plugin source, pin library versions, and limit what the plugin's configuration file exposes. Ask who signs off on plugin releases and how a rollback is performed if a build misbehaves.
Patient data in logs and temporary files
A plugin that logs request bodies, DICOM tags or file paths can write patient identifiers into log files that are copied to monitoring systems and backups. Temporary files created while parsing or converting instances can also hold patient data after a failure. Decide what the plugin logs at each level, set log retention and access, and check the temporary directory and its cleanup behavior during testing.
External authorization that returns 403
The advanced authorization plugin forwards each REST request's token to an external web service, which decides access and returns HTTP 403 when access is denied. If a custom route is not checked by that service, or the service fails open, the route is exposed. The orthanc-auth-service reference project uses Keycloak-issued tokens with Orthanc Explorer 2. Confirm with the authorization plugin page how your Java routes pass through the check, and test denial paths as well as allowed ones.
Authorization pluginChoosing Java by team situation
A team with experienced Java engineers and an existing build pipeline can treat an Orthanc plugin as one more service in its normal delivery process. Code reviews, dependency scanning, artifact repositories and deployment tooling already exist, and the plugin can follow the same release rhythm as the rest of the platform. The team gains typed code, familiar debugging and test frameworks, and the ability to share libraries with other internal systems that talk to the same archive.
- Existing pipeline reuse: Build, test and packaging steps that already run for Java services can cover the plugin with little new tooling.
- Shared libraries: Parsing, logging and HTTP client code written for other systems can be reused, provided it is compatible with the plugin packaging.
- Ownership to plan for: The team must maintain the JNI-level bridge to the Orthanc SDK, track Orthanc releases, and retest the plugin after each core upgrade.
- Licensing review: Confirm with counsel how the plugin's license interacts with the Orthanc license terms before distributing it outside the organization.
- Skill concentration: Plan for knowledge of the plugin to sit with more than one engineer.
Check whether the existing Java runtime version and build tools match what the plugin packaging expects, and confirm this with the Orthanc documentation for the release you plan to run.
A mixed team usually has some Python or Lua experience and only a few Java engineers. Here the choice is less about raw capability and more about who can review, debug and change the code during an incident. Java suits this team when a senior engineer will own the plugin and the rest of the team can work on the surrounding scripts, configuration and infrastructure. The team gains a compiled language with strong typing for a long-lived component, while keeping lightweight scripts for simpler tasks.
- Split responsibilities: Keep routine event filters in Lua or Python if those skills already exist, and reserve Java for a component that needs stronger structure.
- Review capacity: Assign at least two reviewers who can read the Java code, even if only one writes it.
- Onboarding cost: Budget time for engineers to learn the plugin build, the SDK types and the debugging workflow.
- Mixed runtime operations: Operators must know which component is running in which language when troubleshooting.
- Signs Python or Lua fits better: Changes are frequent, few people can read Java, or the logic is mostly calling the REST API.
Ask the team to write a small Lua or Python script and a small Java plugin for the same test task, then compare how long each takes to review and debug before you commit.
An operations-led team wants the archive to behave predictably with as little custom code as possible. For this team, the main question is whether a plugin is needed at all. Most routine needs can often be met with official Orthanc plugins, configuration files and REST API calls managed by operators. If custom logic is required, a Java plugin adds a compiled artifact that operations must version, deploy and support, so it should be justified by a clear requirement that the configuration cannot meet.
- Configuration first: Check whether the official plugins and settings in the Orthanc Book cover the requirement before writing code.
- Minimal custom surface: A single, well-documented plugin is easier to support than several scripts across languages.
- Ongoing duties: Operations must track core releases, rebuild the plugin for each upgrade and keep the plugin version aligned with the Orthanc version.
- Support path: Decide in advance whether the plugin will be maintained internally or through an external provider under a written agreement.
- Signs Java is the wrong choice: No engineer on the team can own the code, or the requirement changes every few weeks.
Before committing, confirm which Orthanc release the plugin must match and who will approve each upgrade.
Limits to confirm before committing to a Java plugin
A Java plugin depends on the Orthanc SDK, the core's storage and parsing internals, and the database layer shared across instances. Each of the items below is a point where an assumption made during a proof of concept can fail in production. Get written answers for each before you commit the build to a schedule.
SDK coverage for your version
Confirm that the Java SDK exposes every callback, REST hook and storage call your design needs for the exact Orthanc version you run. Plugin APIs grow release by release, so a feature in the current core may not be reachable from Java on your installed build. Ask the project which SDK functions are stable for your version and which are marked as internal or subject to change. Record the answer against the version you will deploy, not the latest release.
Orthanc plugins docsBehavior across core upgrades
The Orthanc 1.13.0 release rewrote storage-area access and DICOM parsing and transcoding to improve caching and reduce memory use. Any plugin that assumes a particular file layout, parsing timing or caching behavior may need testing after an upgrade. Ask whether the SDK guarantees compatibility across minor releases and what changed in the NEWS file for each version your plugin must support.
Orthanc NEWS fileMultiple instances on one database
Since Orthanc 1.9.2 with PostgreSQL or MySQL plugin 4.0, several instances can read and write the same database. A Java plugin that caches state in memory, schedules jobs or writes to the key-value store can behave differently when two instances run it at once. Confirm how the SDK handles shared key-value entries and queues across instances, and test duplicate event delivery before you rely on exactly-once behavior.
Scalability FAQPerformance on large archives
The scalability FAQ advises replacing the built-in SQLite index once an archive holds several hundred thousand instances, and cites production deployments far larger. Java adds a JVM with its own heap, garbage collection and startup cost on each instance. Measure memory and latency for your expected study volume, particularly for event handlers that run on every received instance and for queries that fan out across the archive.
Scalability FAQLicense review of plugin code
The Orthanc core is GPLv3 or later, and several official plugins are AGPLv3 or later. A Java plugin linked against the SDK may fall under copyleft obligations when you distribute it, and the answer depends on how the code is built and shipped. Ask your legal or compliance team to review the licensing position, and confirm with the project how the SDK header and linking terms apply to your use before any distribution outside your organization.
Licensing FAQVendor and community support
Confirm who answers when the SDK behaves unexpectedly: the upstream project's community channels, a commercial support contract, or an implementation partner. Orthanc Team SRL sells dedicated support hours on request, and the terms, response expectations and coverage for Java-specific issues need to be written down. Ask whether the Java SDK has the same support level as the C and Python paths, and who fixes a bug found in a Java binding.
Orthanc TeamQuestions buyers ask about building Orthanc plugins in Java
What drives the cost of a Java plugin for Orthanc, and what is one-time versus recurring?
The cost follows the number of routes, event handlers and external systems the plugin touches, plus how much DICOM edge-case handling the workflow needs. One-time work includes requirements, design, the build, test archives, staging setup and documentation. Recurring work covers keeping the plugin working as Orthanc releases arrive, retesting after each core or database plugin change, and fixing issues found in production. Ask any quote to split these phases and to state who holds the source code and the build pipeline after handover. Orthanc itself has no paid edition, so the license cost is zero; the spend is on people and infrastructure, and Orthanc Team SRL sells its own services separately, quoted on request.
How long does a Java plugin project usually take?
Duration depends mainly on how many REST routes and event handlers the plugin needs, how many external systems it calls, and how clean the existing test data is. A plugin that only reacts to stored instances and writes a status to the key-value store is far shorter than one that adds authenticated routes, queues work and integrates with a PACS or a research registry. Delays usually come from unclear acceptance criteria, missing sample DICOM from every modality, and waiting for access to staging systems. Ask for a written schedule with milestones for design, build, test and cutover, and confirm which dates depend on your team's reviews.
What skills, test data and environments must our team provide?
Your team needs someone who can read and build Java, understands HTTP and JSON, and can review code for security. A plugin also needs a representative test archive: real or properly de-identified studies from each modality, with the transfer syntaxes and vendor quirks your site actually receives. Provide a staging Orthanc that mirrors production's version, database back end and network path, plus credentials for any downstream system. Access to people who know the DICOM sources matters as much as access to servers. Confirm early who approves de-identified data handling, since test archives may contain patient information.
Can our internal team build a Java plugin for Orthanc alone?
Yes, a team with Java experience and some DICOM knowledge can build a small plugin alone, using the Orthanc Book's plugin documentation and the official SDK coverage. The risk grows with the number of DICOM edge cases, the security review of authenticated routes, and the operational expectations of a clinical system. Common gaps include handling of concurrent events, error paths that return the wrong HTTP status, and packaging for the same Linux or Docker targets used in production. A partner can fill specific gaps, such as a design review or a security test of the routes, while your team keeps ownership of the code. Decide the split before the build starts and write it into the scope.
How do Orthanc upgrades and retesting affect ongoing effort for a Java plugin?
Every Orthanc core release, and every database or storage plugin update, can change behavior your plugin depends on, so each upgrade needs a regression pass. Orthanc 1.13.0 was released on 2026-08-15 with a complete rewrite of storage-area access and DICOM parsing and transcoding, which is exactly the kind of change that calls for retesting against your archive before the production upgrade. Plan for a staging rebuild of the plugin against the new SDK, a test run of routes and event handlers, and a rollback path. The amount of effort depends on how many features the plugin uses and how well the test archive covers them. Ask whether the quote includes upgrade testing or whether it is a separate retainer.
What should we ask for in a written quote for a Java plugin?
Ask for a fixed scope that lists each route, event handler, queue and external integration, with the acceptance test for each. The quote should name the Orthanc version and database back end the work targets, the test archives used for sign-off, and which environments you will receive. Request the delivery of source code, build scripts, packaging, a deployment runbook and handover sessions, and confirm who owns the repository. Clarify what is one-time and what is a recurring support or upgrade commitment, and how changes after sign-off are priced. DeployOpen agrees scope, deliverables and timelines in writing before work starts, so compare each quote against the same written checklist.
How DeployOpen scopes and delivers Orthanc plugin work
DeployOpen treats a Java plugin for Orthanc as a scoped engineering deliverable inside your own infrastructure. We agree on the REST routes, event handlers and storage or queue behavior in writing, build against the Orthanc SDK in your environment, test the plugin against your real workflows, and hand over code, packaging notes and runbooks your team can maintain.
How we scope
- We list the Orthanc events, REST routes and DICOM workflows the Java plugin must handle, in writing.
- We confirm the Orthanc version, Docker or Linux packaging and database back end the plugin must run on.
- We agree on acceptance tests, deliverables and timelines before work starts, as engagements are fixed-scope.
How we build
- We develop the plugin against the Orthanc SDK coverage that matches your target Orthanc release.
- We implement event handlers, key-value store and queue usage only where the agreed workflow needs them.
- We test routes and handlers in a non-production Orthanc instance before anything reaches your clinical archive.
How we hand over
- You receive source code, build instructions and the packaged shared library for your deployment targets.
- You receive written documentation of routes, configuration keys, licensing obligations and known limits.
- We walk your engineers through deployment, logs and troubleshooting so the plugin can be operated without us.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- We retest the plugin when Orthanc releases change the SDK or when your database or storage back end changes.
- Pre-paid support hours from Orthanc Team SRL are a separate option for core product questions, which we will help you choose between.

