Running Orthanc on AWS with RDS and S3

A stateless Orthanc on AWS keeps the index in RDS for PostgreSQL and DICOM files in S3, which lets instances be replaced without losing data. This page covers the design, options, setup and limits to confirm.

On this page

Running Orthanc on AWS with RDS and S3: what the design is and when to use it

A stateless Orthanc on AWS keeps the DICOM index in a managed PostgreSQL database on Amazon RDS and stores the DICOM files as objects in Amazon S3, so the Orthanc servers themselves hold no archive data that must survive a restart. The split between index and files is the core of the design: the PostgreSQL plugin stores the metadata Orthanc uses to find studies, series and instances, while the S3 object storage plugin holds the DICOM payloads. Both official plugins are needed, and the Orthanc core is licensed GPLv3 or later, while the cloud and database plugins are licensed AGPLv3 or later. There is no paid edition of Orthanc, so the software cost is zero, and the cost of this design is the AWS resources plus any services you buy from Orthanc Team SRL or a partner.

Teams usually need this pattern when more than one Orthanc instance must read and write the same archive, when the archive is expected to grow past the point where the built-in SQLite index is practical, or when recovery should depend on restoring managed database and object storage rather than rebuilding a local disk. Since Orthanc 1.9.2 with PostgreSQL plugin 4.0, several instances can share one database, which is what makes horizontal scaling and failover of the Orthanc tier possible. If your archive is small, a single instance on local disk may be simpler to operate, and the decision should be made against your study volume, growth rate and recovery objectives, which you should set out before the design is fixed.

Before you commit, confirm with your own team which parts of the design you will own: RDS engine version and maintenance windows, the S3 bucket policy and encryption settings, the IAM role each Orthanc task uses, and whether client-side encryption is required by your data protection rules. Check the plugin versions against the Orthanc release you target, since the plugins must match the core. The official sample configuration in the Orthanc project is a useful starting point, but it is a reference, so you should review every setting it contains against your own security and network requirements.

How the AWS parts fit together

The flow starts with modalities and web viewers sending DICOM and HTTPS traffic to a load balancer in front of several Orthanc instances. Each instance runs inside private subnets of a VPC and reads and writes the study index in RDS for PostgreSQL through the PostgreSQL plugin, while the DICOM files go to S3 through the object storage plugin. Check that no Orthanc port or database port is reachable from outside the VPC, and that every instance points at the same database and bucket.

Orthanc instances in private subnets, with the index in RDS and files in S3.

Which storage and index choices fit which setup

This table compares the index and file storage options available to Orthanc and shows which setup each one suits. Read each row against your instance count, number of Orthanc nodes and the team that will operate the database and storage. The main takeaway is that the built-in SQLite index is only suitable for small, single-node archives, while multi-instance AWS deployments need a shared database.

OptionWhen it fitsOperational cost and trade-offs
SQLite index (built in), local disk filesSingle Orthanc node, small archive well below several hundred thousand instances, test or teaching environmentsNo separate database to run, but the index should be replaced by an enterprise engine once several hundred thousand instances are stored. Files and index share one host, so backups and recovery are tied to that host.
SQLite index, files in S3 through the object storage pluginSingle node with a small archive where object storage is required for file retention or locationIndex still lives on the local host, so a host loss leaves the index and the object store out of step. Plan for index backups alongside S3 versioning.
PostgreSQL plugin on Amazon RDS, files on local diskSeveral hundred thousand instances or more, but one Orthanc node or local file storage is acceptableRDS handles database patching, backups and failover options, but file storage still ties the node to local disk. Confirm RDS engine version support and storage sizing with your AWS team.
PostgreSQL plugin on Amazon RDS, files in S3 (this reference setup)Large archives, several Orthanc instances behind a load balancer, stateless application nodesRequires PostgreSQL plugin and Orthanc 1.9.2 or later with PostgreSQL plugin 4.0 or later for shared access. Ongoing costs are RDS instance and storage plus S3 requests and data transfer, which should be confirmed in your AWS quote.
MySQL or MariaDB plugin, files in S3Sites with an existing MySQL or MariaDB platform and skills, multi-instance deploymentsWorks with the same multi-instance model as PostgreSQL. Confirm that your RDS or Aurora MySQL engine version matches the plugin requirements in the Orthanc plugin documentation.
Other cloud object storage (Azure Blob, Google Cloud Storage)Workloads already standardized on another cloud, or multi-cloud rules that prohibit AWSUses the matching object storage plugin with its own credentials, networking and encryption setup. Moving between object stores later requires migrating stored files and index references.

Setup sequence for RDS, S3 and Orthanc

This sequence takes a stateless Orthanc from an empty AWS account to a tested deployment where the PostgreSQL index lives on RDS and DICOM files live in S3. Each step ends with a check so the team can confirm the layer works before the next one depends on it.

  1. Create the VPC and private subnets

    The network team, or DeployOpen working inside your AWS accounts, creates a VPC with at least two private subnets in separate Availability Zones, a route table without an internet gateway for the database subnets, and security groups that allow only the Orthanc tasks to reach the database port. Interface or gateway endpoints for S3 can keep object traffic off the public internet, and this should be confirmed against your own routing policy. Done means a test instance in the Orthanc subnet resolves and reaches the planned database endpoint and cannot reach the database from any other security group.

  2. Provision RDS for PostgreSQL

    Create an RDS for PostgreSQL instance in the private subnets with encryption at rest, a dedicated database and role for Orthanc, and no public access. Choose a major version that is still supported on the PostgreSQL versioning policy at the time of deployment; at the time of this page, 14 through 18 are listed as supported, and the team should confirm the current list before selecting one. Confirm backup retention and a maintenance window that you have agreed with the operations team. Done means the Orthanc role can connect from the Orthanc subnet with TLS and cannot log in from anywhere else.

  3. Create the S3 bucket and the Orthanc role

    Create a private S3 bucket with public access blocked, default encryption enabled, and versioning or deletion protection chosen according to your retention rules. Attach an IAM role to the Orthanc task that grants only the object actions Orthanc needs on this bucket and prefix, and deny access from other principals through the bucket policy. Confirm with the object storage plugin documentation which actions your plugin version requires before finalizing the policy. Done means the Orthanc role can write, read and delete objects under its prefix, and a principal outside that role receives access denied.

  4. Configure the PostgreSQL and S3 plugins from a secrets store

    Load the Orthanc configuration with the PostgreSQL index plugin and the S3 object storage plugin enabled, pointing at the RDS endpoint and the bucket. Database credentials and any non-role keys should come from AWS Secrets Manager or your equivalent store, injected at container or service start rather than written into files or images. Keep the remote access and script routes disabled as described in the Orthanc security guidance. Done means Orthanc starts, logs that both plugins loaded, and reports the expected database and storage back ends on its system endpoint.

  5. Enable client-side encryption before writing files

    Turn on client-side encryption in the configuration of the S3 storage plugin and confirm the key source, which must be held outside the bucket and managed under your key management process. Enable it before the first write, because files already stored in plain form will not be encrypted by a later change. Confirm how the key is rotated and what happens to existing objects if the key is lost. Done means a test upload produces an object in S3 that is not readable as DICOM when downloaded directly, and Orthanc still returns the original instance through its REST API.

  6. Run a test study through store, query and retrieve

    Use a de-identified test study, sent with a DICOM C-STORE client or the Orthanc REST API, to confirm the full path. Query the study by patient and study identifiers, retrieve it with C-MOVE or C-GET from a second AE title or a DICOMweb client, and compare the retrieved instance checksums with the source. Check that the database rows and the S3 objects match the same instance count. Done means the study is stored, queryable, retrieved intact and recorded in both the index and the bucket.

  7. Verify restart and instance replacement

    Restart the Orthanc task, then replace it with a new instance built from the same image and configuration, and confirm the study is still available without copying files between hosts. This test shows that no state remains on the local disk. Also confirm that a second Orthanc instance can read the same database, if your plan includes more than one instance. Done means the study is retrieved identically after both events, and the test records show that the database and bucket remained the only sources of state.

How client-side encryption interacts with S3 and the index

Client-side encryption means Orthanc encrypts each DICOM file before it is written to the S3 bucket, so the bucket holds only ciphertext and the cloud provider never sees plaintext pixel data. The trade-off is that the key material becomes the most sensitive part of the design. Before enabling it, confirm in the Orthanc Book which encryption option the object storage plugin version in use supports, and confirm the algorithm and key format against that plugin's documentation rather than assuming them. Your team also needs to decide where the key comes from (a secrets manager, a hardware-backed store or a file injected at startup) and who can read it.

Encryption changes what the PostgreSQL index can do on its own. The index on RDS still holds study, series and instance metadata and the attachment references, so queries, C-FIND style lookups and the Explorer views keep working without decrypting files. Only operations that need the pixel data, such as transcoding, rendering or sending an instance to a peer, must fetch and decrypt the object, which adds latency and requires the key to be available to every Orthanc instance that serves those requests. Test those paths explicitly rather than inferring their behavior from the index tests.

Deletion and key rotation need a written procedure. Removing a study through Orthanc deletes the index entries and the stored objects, but an S3 object version, lifecycle rule or backup copy can still hold ciphertext after that point, and destroying the key is the only way to render those copies unreadable. Confirm with the plugin documentation how existing objects behave when the key changes, and keep a tested restore path that includes the key, since losing it makes both the bucket and any backup of it unrecoverable.

Security controls for the AWS deployment

A stateless Orthanc on AWS holds patient images in S3 and its index in RDS, so access has to be closed at three layers: the Orthanc API, the routes that can run commands or overwrite files, and the database and bucket credentials. The cards below are the checks to settle before the first study is stored.

Remote access and authentication

Orthanc accepts HTTP connections only from localhost by default. If you enable RemoteAccessAllowed, set AuthenticationEnabled to true and define every user in RegisteredUsers. Confirm that no shared or default password survives into the AWS configuration, and that the load balancer does not turn a private listener into a public one.

Orthanc security FAQ

HTTPS and a reverse proxy

For any exposure beyond a private network, the Orthanc documentation recommends HTTPS and a reverse proxy in front of the REST API and viewers. On AWS this usually means TLS terminated at a load balancer with certificates managed outside the container. Check that the proxy passes the upload size limits your largest studies need and that Orthanc is not reachable directly on its own port.

Orthanc security FAQ

Disable the 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 in the configuration deployed to ECS, EC2 or any other compute layer. Test this after every upgrade, since a configuration rebuilt from a sample can reintroduce them.

Both routes
Disabled

DICOM TLS between sites

Orthanc supports DICOM TLS for inter-site exchanges from version 1.9.0. The DICOM port is a separate trust boundary from the HTTP API, so enabling it does not protect the REST interface. Plan the certificate authority, certificate rotation and the peers that must trust each other, and confirm that the AWS security group allows the DICOM port only from known modalities or sites.

Least-privilege IAM for S3 and RDS

The Orthanc task role should reach only its own bucket and prefix, with the actions the object storage plugin needs and no bucket administration rights. Database access should use a dedicated role that owns only the Orthanc schema, with no access to other databases on the same RDS instance. Ask your AWS team to review the policies with IAM Access Analyzer and to confirm that bucket encryption and public access blocks are set.

PostgreSQL authentication and SCRAM

Configure the RDS parameter group so that password storage uses SCRAM rather than MD5, since PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM. Keep the Orthanc database user off superuser roles, restrict the client address ranges in the connection rules to the Orthanc subnets, and confirm that the RDS instance does not accept connections from the public internet. Store the database password in AWS Secrets Manager and rotate it on a schedule you can name.

PostgreSQL authentication methods

Backups, failover and upgrades for RDS and S3 data

RDS automated backups and point-in-time recovery are the managed form of PostgreSQL continuous archiving, so the recovery model your team relies on is a base backup plus archived write-ahead log that can be replayed to a chosen moment. Confirm with AWS which retention period and recovery window your RDS instance is configured for, and then test a restore to a new instance with a timestamp before the first production load. The restored database is a separate instance, so your team must plan how Orthanc is pointed at it. The S3 bucket is a separate recovery domain. A restored index that references objects deleted from S3 will show studies whose files cannot be read, so the two restores must be reconciled by date and tested together.

PostgreSQL does not detect a failed primary and promote a standby on its own. Hot standby and synchronous or asynchronous replication give you the copies, but the decision to promote, the fencing of the old primary and the repointing of Orthanc's PostgreSQL settings must come from external tooling or from RDS Multi-AZ behavior that you verify. Orthanc can run several instances against one database, so a failover plan should also confirm how each instance reconnects after a database switch. Write down the expected behavior, then rehearse it in a non-production account. For S3, versioning and cross-region replication are not enabled by default, and each must be turned on, scoped to the Orthanc prefix and restored in a drill.

Major PostgreSQL upgrades on RDS can follow the same logical choices described in the PostgreSQL documentation: pg_upgrade, dump and restore, or logical replication to a new major version. Logical replication works across major versions and can shorten the cutover window, but it needs a rehearsed switch and a rollback path. PostgreSQL supports version 14 until November 12, 2026, version 15 until November 11, 2027, version 16 until November 9, 2028, version 17 until November 8, 2029, and version 18 until November 14, 2030. Check the current RDS support calendar for the minor versions AWS offers, because an RDS end-of-support date can come before the community date. Plan the Orthanc plugin version to match the database upgrade, and rehearse both in one window.

Questions buyers ask before running Orthanc on AWS

What drives the cost of running Orthanc on AWS with RDS and S3?

Cost comes from three areas: the AWS resources (RDS for the PostgreSQL index, S3 for DICOM files, compute for the Orthanc container or host, and network transfer), the engineering time to configure and secure them, and ongoing operations. AWS bills the resources monthly and their size grows with stored studies and request volume, so ask for storage and retrieval estimates from your own imaging volumes. Orthanc itself is free under GPLv3 or later, and its cloud and database plugins are AGPLv3 or later, so there is no Orthanc license fee. Any services you buy from Orthanc Team SRL or DeployOpen are quoted from a written scope, so ask each provider to itemize one-time setup and recurring support separately.

Can our team build this alone using the project samples?

Yes, a team with AWS, PostgreSQL and Linux experience can use the reference samples as a starting point, but the samples are a starting point rather than a finished production design. The work that usually takes the most effort is not the first deployment: it is IAM policies scoped to the bucket and database, network placement, TLS, backups and restore testing, and client-side encryption key handling. Confirm the sample's plugin versions against the release you intend to run, and test a full restore before you rely on the setup. Whether to build alone depends on whether your staff can own those controls and the on-call work afterward.

How long does an Orthanc on AWS deployment take?

Duration depends on the number of environments, how much your security and network teams must review, the size of the existing archive to migrate, and how many integrations with modalities and viewers must be tested. A proof of concept with test data moves faster than a production build that needs approvals, change windows and validated backups. No supplied benchmark gives a fixed duration for this setup, so ask any partner for a timeline tied to a written scope and list the decisions that are still open, such as the VPC layout, the identity provider and the retention rules. Migration from another archive adds time for data validation.

What do we need to provide for an AWS Orthanc build?

The work needs a dedicated AWS account or organizational unit with rights to create VPC, RDS, S3, KMS, IAM and compute resources, along with a named owner for the cloud account. Network access must be agreed for the modalities, viewers and clinical sites that send or read images, including firewall rules for DICOM and HTTPS ports and any VPN or private connectivity. Your team should name a compliance owner who can confirm data classification, retention and access requirements. Test data is essential: use de-identified or synthetic studies in non-production environments, and do not copy live patient images into a test account without approval.

Do we need Orthanc Team SRL or DeployOpen for production?

Neither is required by the license, because Orthanc is open source and the project's documentation covers the reference components. Many organizations still buy help because production work includes items the samples do not settle, such as access control, backup and restore drills, monitoring and upgrades. Orthanc Team SRL sells deployment, configuration and development services, including pre-paid dedicated support hours valid for 12 months, quoted on request. DeployOpen plans, implements, hardens, backs up, upgrades and supports self-hosted platforms in your own AWS accounts under a written, fixed scope. Ask each provider what is covered after go-live and who holds the operational runbooks.

What changes if the archive grows to hundreds of thousands of instances?

The core change is that the index must move off the built-in SQLite database to an enterprise engine, and the Orthanc Scalability FAQ recommends the PostgreSQL plugin for large datasets once an archive reaches several hundred thousand DICOM instances. RDS sizing, storage, backup windows and query performance then become design inputs, and you should plan for multiple Orthanc instances if availability matters. Since Orthanc 1.9.2 with PostgreSQL plugin 4.0, several instances can read and write the same database. On the PostgreSQL side, plan for failover tooling, since PostgreSQL does not detect primary failure on its own, and confirm which PostgreSQL major version RDS offers for your plan.

Is client-side encryption required before files reach S3?

Client-side encryption is a design decision to make early, and it is not automatic from the reference setup alone. S3 server-side encryption protects data at rest, but client-side encryption means Orthanc encrypts files before they leave the server, so the bucket operator cannot read them. Confirm with your compliance owner which obligations apply to your archive, then decide where keys are held, who can rotate them and how a restore works if keys are lost. Key handling is often the step that most affects the recovery plan, so test it in a non-production account before go-live.

What the project's reference setup covers and what it does not

The Orthanc project publishes a reference setup for AWS in its samples repository, and it is the right place to start because it shows how the PostgreSQL index, the S3 storage plugin and the Orthanc containers are wired together. Read it for the configuration keys that connect Orthanc to RDS and to the bucket, the container layout, the environment variables and the way credentials are passed in. Before you copy anything, confirm the sample's current contents, supported plugin versions and image tags in the Orthanc documentation, because samples change between Orthanc releases and the sample may not match the version you plan to run. Check the release notes for your target version as well, starting with the Orthanc NEWS file.

The sample is a functional starting point, not a hardened production design. It does not decide your network segmentation: you must define which subnets can reach the RDS instance, the bucket endpoints and the Orthanc listeners, how DICOM ports are exposed to modalities, and whether traffic to S3 and RDS stays on private endpoints. It does not provide monitoring, alerting on storage errors, database connection exhaustion or disk and bucket growth, and it does not set up a secrets rotation process for database passwords and access keys. Write these controls down as requirements before the build starts, and assign an owner to each.

Two gaps matter most for evidence. First, the sample does not prove that your backups can restore, so you need a scheduled restore test that rebuilds the index from RDS snapshots and confirms that objects in S3 match the index. Second, it does not produce the compliance evidence your assessors will ask for, such as access logs, change records, key management decisions and a record of who approved each configuration. Ask your compliance lead which control evidence is required for your environment, and plan how each item will be collected from RDS, S3, CloudTrail and the Orthanc logs. DeployOpen can plan and build these controls under a written scope, and the independent auditor or certification body makes the final assessment.

How DeployOpen scopes and delivers an Orthanc AWS deployment

DeployOpen plans and builds a stateless Orthanc on AWS inside your own cloud accounts, with the PostgreSQL index on RDS and DICOM files in S3 through the object storage plugin. Each engagement starts from a written scope that names the accounts, regions, networks and client-side encryption design before any build work begins.

How we scope

  • Written scope names the AWS accounts, regions, VPC layout and who owns each component before work starts.
  • We record which Orthanc version, PostgreSQL major version and object storage plugin will be deployed, and why.
  • Scope states who manages encryption keys, IAM roles, backups and access to modalities and viewers.

How we build

  • We build the RDS PostgreSQL index, S3 storage area and Orthanc configuration as code from the project samples.
  • Client-side encryption, private networking and DICOM port rules are configured and tested against your modalities.
  • We test restarts, failover of stateless Orthanc instances and restore of both the database and object storage.

How we hand over

  • Handover includes architecture diagrams, configuration files, IAM policies and a runbook for your operations team.
  • Test results, restore procedures and open risks are documented so your security and compliance teams can review them.
  • Knowledge transfer sessions cover upgrade steps for Orthanc, the database engine and the AWS resources.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Ask us to confirm the support scope, response expectations and upgrade responsibilities in the written quote.

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.