How Medplum presigned URLs serve binaries in a self-hosted deployment
Medplum uses presigned URLs to grant temporary authenticated access to binary content such as clinical documents, images and video, and the signing key is what makes those links trustworthy. Anyone holding a valid presigned link can fetch the object until it expires, so the key must be strong, private and stable across the deployment. Teams that self-host Medplum need this work as soon as clinicians, patients or partner systems must open stored files from a browser or another application, because binaries are then served from your storage layer rather than through the Medplum application itself.
The link mechanism is only one layer. A presigned URL proves that a request was signed by your Medplum server, but it does not decide whether a given user should see a given record. Who may read a DocumentReference, an Media resource or the binary behind it is governed by project access policies, the access control model in Medplum and your own consent rules. Treat those as separate controls, and confirm each one in your test plan. The signing key work also does not cover TLS termination, network exposure of the storage bucket or retention of the files themselves.
Before go-live, confirm three things with your Medplum configuration and your cloud team. First, which storage backend holds binaries and how the server is pointed at it. Second, how the signing key is generated, where it is stored and who can read it. Third, what happens if no key is configured, since Medplum generates a temporary signing key at startup when none is set, which the vendor describes as a local development convenience. Plan for that temporary key to be absent in any environment that handles real patient data.
The mechanics differ by platform. Signing keys are generated automatically through the Medplum CLI for AWS S3 and CloudFront, while GCP, Azure and Ubuntu deployments require you to create and distribute the key manually. Review the Medplum presigned URLs documentation for the exact configuration keys in your version, and treat any key rotation plan as part of your operating runbook from the start.
How a binary request becomes a presigned URL
The request starts with a user or app calling the Medplum API for a binary. Medplum checks the caller's authorization first, then issues a time-limited URL signed with the configured key. The client uses that URL to fetch the object from storage or a CDN, which verifies the signature before serving it. The signing key is the trust boundary: if Medplum starts without a configured key, it generates a temporary one at startup, which is only a local development convenience.
Medplum issues a signed, time-limited URL, and storage or CDN checks it before serving the object.
Which binary storage option fits each cloud
On AWS, Medplum stores binary content in S3 and serves it through CloudFront, and presigned URLs are the mechanism that grants temporary, authenticated access to that content. This is the environment where key generation is most automated. The Medplum CLI generates the signing key for the S3 and CloudFront setup, so the team's main job is to make sure the AWS resources exist and that the generated key is stored and distributed to the server correctly.
- Storage target: An S3 bucket for binary content, fronted by a CloudFront distribution.
- Key generation: Produced automatically through the Medplum CLI for this combination.
- Provisioning: The bucket, the CloudFront distribution and the IAM permissions the server needs must exist before signing is tested.
- Key handling: Store the generated key in a secret store that the server can read, and keep it out of source control.
- Verification: Request a presigned URL from a test binary and confirm it resolves, then confirm it stops working after expiry.
Confirm the current bucket, distribution and key configuration steps in the Medplum presigned URL documentation before you build the environment.
On Google Cloud, signing keys are not generated automatically. The team creates and distributes the key by hand, which moves ownership of the key lifecycle to the platform team. Because the Google Cloud deployment is marked Beta in Medplum's self-hosting documentation, confirm the storage and signing steps against the current docs rather than against a copy of older instructions.
- Storage target: A Google Cloud Storage location for binary content, as described in the presigned URL documentation.
- Key generation: Manual. The team generates the signing key and supplies it to the server.
- Provisioning: The storage location, the service identity the server runs as, and access permissions must be in place before the key is used.
- Key handling: Place the key in Secret Manager or an equivalent store and define who can rotate it.
- Verification: Test a presigned URL end to end after each key change, including the expiry behavior.
Confirm the current Google Cloud storage and signing configuration in the Medplum presigned URL documentation before you provision.
On Azure, the signing key is also produced manually, so the platform team owns generation, storage and rotation. The Azure deployment is marked Beta in Medplum's self-hosting documentation, which is a reason to verify each storage step against the current presigned URL guidance and to record the exact versions you deploy.
- Storage target: An Azure storage location for binary content, as described in the presigned URL documentation.
- Key generation: Manual. The team generates the key and makes it available to the server.
- Provisioning: The storage location, network access rules and the identity the server uses must be created before signing works.
- Key handling: Keep the key in Key Vault or an equivalent secret store, with a named owner and a rotation procedure.
- Verification: Confirm that a presigned URL works from the intended client networks and fails once it expires.
Confirm the current Azure storage and key steps in the Medplum presigned URL documentation before you start the build.
On a single Ubuntu server or an edge device, there is no managed cloud signing service to lean on. The team provisions local or self-managed binary storage, generates the signing key manually, and makes sure the server and the clients that download files can reach the URLs it produces. The smaller the installation, the more likely the team is to skip this step, so it needs an explicit owner.
- Storage target: Storage on the server or on infrastructure you control, as set out in the presigned URL documentation.
- Key generation: Manual. Generate the key and configure the server to load it.
- Provisioning: Storage paths, file permissions for the Medplum service account, and any reverse proxy routing for binary requests must be planned.
- Key handling: Restrict file permissions on the key, back it up securely, and document how it is replaced.
- Verification: Test downloads from the client networks the site uses, including any clinics with intermittent connectivity.
Confirm the current local storage and signing steps in the Medplum presigned URL documentation before you install.
Signing key options and when each fits
This table compares the three ways a self-hosted Medplum deployment gets a presigned URL signing key, based on who generates it and where it applies. Read each row against your cloud or host platform, then check the last row to confirm that the startup-generated key is never your production choice. The main takeaway is that AWS can rely on CLI generation, while GCP, Azure and Ubuntu require your team to create and store the key itself.
| Option | Where it applies | Who generates and stores it | When it fits |
|---|---|---|---|
| CLI-generated key on AWS | AWS S3 and CloudFront | Medplum CLI generates the key; confirm with your team where it is stored and who can read it | Production AWS deployments where you want the tooling to handle key creation |
| Manually generated key on GCP | Google Cloud deployments | Your team generates the key and distributes it to the server configuration | Production GCP deployments where your team owns key rotation and storage |
| Manually generated key on Azure | Azure deployments | Your team generates the key and distributes it to the server configuration | Production Azure deployments where your team owns key rotation and storage |
| Manually generated key on Ubuntu | Single-server Ubuntu installs | Your team generates the key and places it in the server configuration | Production single-server installs where your team controls file permissions and backups |
| Startup-generated temporary key | Any platform, when no signing key is configured | Medplum generates it at server startup; it is not something your team stores | Local development only, as Medplum describes it; not suitable for production |
Setting up signing keys and binary storage
This sequence moves a self-hosted Medplum server from the temporary startup signing key to a managed key tied to your chosen binary storage backend. The result is presigned URLs for documents, images and video that your team can verify and that expire as designed.
Choose the binary storage backend
The platform or security lead selects where binary content will live, such as AWS S3 with CloudFront, a Google Cloud Storage or Azure storage setup, or a local store on an Ubuntu server, and confirms it with the cloud or infrastructure team. Record the bucket or container names, the region, and who owns the account. Check that the server configuration points at that backend and that a test upload lands in the expected location. The step is done when the storage location is documented and one test object can be written and read through Medplum.
Generate the signing key for your cloud
Produce the key pair that Medplum will use to sign presigned URLs. On AWS S3 and CloudFront, the Medplum CLI generates the key. On GCP, Azure and Ubuntu, the team creates the key manually with the tooling of that platform, following the presigned URLs documentation. Confirm the key type and its owner with your cloud administrator, and record which account or key store holds the private half. The step is done when the key exists, the public half is registered with the storage path, and the key ID is written in your change log.
Place the key outside source control
The private key moves into the configuration path that the Medplum server reads at startup, using a secret store or a restricted file on the host rather than a value committed to a repository or baked into a container image. The platform engineer sets file permissions so only the server process account can read it and confirms that the configuration file references the key location, not the key contents. Search the repository and build artifacts for the key material before merging. The step is done when a repository scan finds no key material and the server starts with the key loaded.
Restart and confirm the server signs URLs
Restart the Medplum server so it reads the new configuration, then request a presigned URL for a stored binary through the API. Check the server logs for the startup message, if any, that confirms a configured key is in use, and make sure no message describes a temporary startup key. Compare the key ID in the signed URL with the key you generated. The step is done when a URL requested after restart carries the expected key identifier and the server does not report a generated temporary key.
Test that expired URLs are refused
Request a presigned URL with a short expiry in a non-production environment, wait until it expires, and then fetch the object with that URL. The fetch should fail with an access-denied response from the storage layer. Repeat the check with the URL requested before the expiry window closes to confirm the object still loads. The QA or security engineer records both results. The step is done when the expired URL is refused and the valid URL succeeds, with the outcomes saved in the test record.
Test that altered URLs are refused
Take a valid presigned URL and change one character in the signature parameter, then change the object path in a second copy. Request each altered URL. Both should be refused by the storage layer, because the signature no longer matches the requested resource. A refusal here shows that the signing key is actually enforced and not bypassed by a public bucket policy. The step is done when both altered URLs fail and the storage access policy is confirmed not to grant public read.
Document the key owner and rotation plan
Write down who holds the private key, where the public half is registered, how the key is replaced, and how a replacement is tested before the old key is removed. Ask your cloud or platform team to confirm the rotation mechanism and the audit trail for key use on your platform, since these details differ by cloud and by how the key was generated. Store the runbook with the other Medplum operations documents. The step is done when the runbook names an owner, a rotation procedure, and a test that repeats steps 4 to 6 after any change.
How to generate and distribute signing keys without leaking them
Decide who owns signing key generation before the first deployment, because the key is the secret that makes presigned links trustworthy. On AWS S3 and CloudFront, the Medplum CLI generates the signing key for you, which removes one manual step but does not decide where the output lives. On GCP, Azure and Ubuntu, your team generates the key by hand. In every case, assign a named owner in your platform or security team, record the generation date, and keep the generation step in a runbook or infrastructure code so it can be repeated. Confirm the exact key format, file type and rotation procedure for your chosen cloud in the Medplum presigned URLs documentation before you generate anything, since the steps differ by platform.
Store the signing material in your team's secrets manager, such as AWS Secrets Manager or Parameter Store, Google Secret Manager, Azure Key Vault or OpenBao, and deliver it to the server as a SecureString or equivalent secret, never as a value in a JSON config file, a Helm values file or a Git repository. Restrict read access to the small group that runs the Medplum server, and give the server's runtime identity read permission only for that one secret. Audit reads and changes to the secret, and alert on access from unexpected principals. Developers should be able to use temporary development keys in local environments but should not hold production signing material on their laptops.
Every replica and server instance must load the same signing key, or links generated by one instance will fail verification on another. Plan for this when you scale out, and when you roll a new version of the server, make sure all instances pick up the same secret before traffic moves. Rotation is the harder part: plan a window in which old and new links are handled, test the procedure in a non-production environment first, and document the rollback path. Remember that a key that leaks must be replaced quickly, so define who can trigger a rotation and how quickly that can happen. Illustrative example: a team with three server replicas should confirm that a link signed on one replica verifies on all three before cutover.
Why temporary signing keys are a production risk
Medplum signs presigned URLs with a key, and that key decides whether a document or image link still works after a restart and whether every server can verify it. The cards below cover the failure modes that appear when a temporary key leaks into a production setup, and the control that addresses each one.
Startup-generated temporary key
If no signing key is configured, Medplum generates a temporary key at startup. Medplum describes this as a local development convenience. A key created at boot is lost on restart, so links issued before the restart stop verifying. In a multi-instance deployment, each server may hold a different key, so a link signed by one instance fails on another. Confirm that a persistent signing key is configured for every environment before users receive any links.
Presigned URL docsUnmanaged key generation and distribution
Signing keys are generated automatically through the Medplum CLI for AWS S3 and CloudFront, but must be created manually for GCP, Azure and Ubuntu. A manual step is easy to skip or repeat inconsistently across environments. Check that each environment has a documented key creation procedure, that every server receives the same key through your secrets store, and that a key rotation plan exists before go-live.
Key setup stepsOver-long URL lifetimes
A presigned URL grants access to the bound object to anyone who holds it, for as long as it remains valid. A long expiry window means a copied link, forwarded email or cached file keeps working well after the user's session has ended. Ask your team to set the shortest expiry that still suits the clinical workflow, and to test that an expired link is refused and that a fresh one is issued after sign-in.
Full presigned URLs in logs
A presigned URL carries its own authorization in the query string, so a log line that records the full URL exposes the document to anyone with log access. Reverse proxies, load balancers, CDN access logs and application traces can all capture it. Review each log source in the path, strip or redact query parameters where possible, and restrict who can read logs that contain binary access events.
Broad access to the signing key
Anyone who can read the signing key can mint valid URLs for any object the storage backend holds, without passing through Medplum's access checks. Limit read access to the key to the service identities that run the server, keep it in a secrets manager instead of a configuration file or repository, and make sure engineers who do not operate the deployment cannot retrieve it. Review that list on every staffing change.
Questions teams ask before running binary storage in production
Can our team configure presigned URL signing keys without a partner?
Yes, if your engineers already run the cloud platform you chose and have a clear owner for secrets. The work splits into two parts: the cloud resources that hold documents, images and video, and the signing keys Medplum uses to grant temporary access to them. On AWS, the Medplum CLI generates signing keys for S3 and CloudFront automatically. On GCP, Azure and Ubuntu, you generate and place the keys manually, so the work leans more on your own key handling practices. A partner is most useful when the cloud footprint is large, when several teams share the account, or when security sign-off requires documented evidence of how each key was created and stored.
What drives the effort of binary storage and signing key setup?
Effort rises with the number of moving parts you must own. The main drivers are:
- The cloud footprint: how many accounts, regions and storage buckets your Medplum deployment spans.
- Key handling: whether keys are generated by tooling or by hand, where they are stored, and who can read them.
- CDN delivery: whether you front binary content with a content delivery network, which adds its own signing configuration.
- Existing secrets tooling: whether your organization already has a vault or parameter store that Medplum configuration can read from, or whether you need to build that path first.
Each driver multiplies the others, so a single-region Ubuntu install with one bucket is far simpler than a multi-region cloud deployment with CDN-delivered video.
What do we need to provide before binary storage work starts?
Before work starts, you need access to the cloud accounts or infrastructure where storage will live, and a named owner for the storage buckets and their data. Storage ownership matters because documents and images are protected health information in most healthcare settings, so bucket policies, retention rules and access logging must match your data governance. You should also plan for security sign-off on how signing keys are created, stored, rotated and revoked, since the people who approve that design are often outside the platform team. Ask your security reviewers early which evidence they expect, so the design can produce it.
How long does binary storage and presigned URL setup take?
The duration depends on your environment, not on a fixed number. Teams with existing cloud accounts, secrets tooling and approved storage patterns move faster than teams that must first obtain account access, define bucket ownership and agree on key handling with security. Single-server installs have fewer steps than cluster deployments with a CDN. Ask for a duration in any quote only after the written scope names the storage backends, regions, delivery path and approval steps, because those choices set the schedule. Any timeline you receive should list which of those items it assumes.
Is it safe to rely on the temporary signing key Medplum creates at startup?
No, not outside development. If no signing key is configured, Medplum generates a temporary signing key at startup, and Medplum describes this as a local development convenience. A temporary key changes when the server restarts, so presigned links issued before a restart stop working and the behavior can differ between instances. In a production environment, configure a managed signing key for your storage backend and confirm that every server instance reads the same key. Treat the presence of an unconfigured key as a deployment check, not a fallback.
What changes after go-live for signing keys and storage?
Operations work continues after launch, mainly in key rotation and upgrades. Plan a rotation procedure that replaces a signing key without breaking active links, and record who can perform it and how it is logged. Upgrades can also touch storage settings, so check the storage and signing configuration as part of each upgrade plan. Medplum ships patch versions weekly and targets security patches within 7 days for critical vulnerabilities (CVSS 9.0 or higher), so your rotation and upgrade runbook should be fast enough to apply those updates. Confirm the exact rotation steps for your chosen backend with the vendor documentation before you commit to a schedule.
Do CDN and key management choices change the security review?
Yes. A content delivery network in front of binary storage adds a second place where signed access is checked, and each signing configuration needs its own review. Key management also affects the review: keys held in a managed secrets service are easier to audit than keys copied into configuration files. Ask your security team whether they require key access logging, separation between the people who deploy Medplum and the people who hold signing keys, and documented revocation. Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers, so the storage and key controls in your deployment belong to your side of that split.
What to confirm in your own environment
Presigned URL behavior depends on the cloud, the Medplum version and how your storage is wired. The checks below connect the support status of each path to the operational questions you will need answered before binaries go into production.
Support status of each storage path
Signing keys are generated automatically through the Medplum CLI for AWS S3 and CloudFront, but must be created manually for GCP, Azure and Ubuntu. The Terraform deployments for GCP and Azure are marked Beta. Confirm with the current Medplum self-hosting docs which path you are on, whether its key steps are documented for your version, and whether your team accepts Beta status for a production binary store.
Presigned URL docsSigning key generation and rotation
Without a configured signing key, Medplum generates a temporary key at startup, which the docs describe as a local development convenience. Confirm that your deployment sets a persistent key, who generates it, where it is stored, and how you rotate it. Confirm how signed links behave during a rotation and whether a restart invalidates links users already hold.
CDN and object lifetime settings
On AWS, the CDN layer sits in front of S3 and changes how long a signed link stays valid and how quickly a revoked link stops working. On other clouds, confirm whether a CDN is in the path at all. Ask the team to test expiry for a document, an image and a video file, and record the lifetime that applies to each.
Data residency of stored binaries
Binaries such as scanned records, images and recorded video may carry more regulated data than the database. Confirm the region of each bucket or container, whether the CDN caches copies outside that region, and whether backups or replicas are placed in other regions. Record the answer for your residency and privacy reviews.
Backup and restore with the database
Object storage and PostgreSQL hold different halves of one record, so a restore of only one leaves broken references. Confirm how binary objects are backed up, whether their versions are retained, how object metadata is matched to database rows after a restore, and how long a full restore takes in a test.
Signed URL behavior on your version
Presigned URL handling can change between releases. Before you rely on a behavior, check that the chosen Medplum version matches the docs for expiry, key format and access checks, and test it on a staging server running the same version you plan to deploy to production.
Medplum releasesWhat a scoped binary storage engagement covers
A fixed-scope binary storage engagement covers four pieces of work: reviewing the storage design, setting up presigned URL signing keys and their secrets handling in your infrastructure, testing the behavior of the resulting URLs, and documenting the setup for your security team. The scope, deliverables and timeline are agreed in writing before work starts, so the boundaries are known before any configuration changes are made. Each piece is tied to a decision your team has to own, such as which storage backend holds documents, images and video, which cloud account holds the signing material, and who is allowed to rotate it.
The design review starts with the storage backend and the signing model for each cloud or Ubuntu host in scope. For AWS S3 and CloudFront, the Medplum CLI generates signing keys automatically. For GCP, Azure and Ubuntu, keys are generated manually, so the engagement includes creating them, placing them in your secrets store and confirming that the Medplum server reads them from the intended location. The testing phase checks that presigned URLs expire after their set lifetime, and that the server refuses a URL once any part of its signed query has been altered. It also confirms that no temporary key generated at startup is in use in a non-development environment. Your team should confirm the exact signing and expiry settings against the Medplum presigned URLs documentation before scoping, since those details can change between versions.
DeployOpen prepares systems, configuration and evidence for your security and compliance reviewers, but does not issue audit reports, attestations or certifications. Those come from independent auditors and certification bodies, and the documentation delivered is written so that your own assessor can test it. Before signing, ask the provider to name the artifacts they will hand over, such as the configuration baseline, key inventory, rotation procedure, test results with retest evidence and an operations runbook, and confirm who keeps access to the signing keys after handover. Compliance responsibility for the deployment remains with your organization.
How DeployOpen scopes and supports Medplum binary storage
DeployOpen plans and implements self-hosted Medplum binary storage inside your own cloud accounts or data centers, including the presigned URL signing keys that gate access to documents, images and video. Work starts with a written scope so the storage backend, key handling and verification steps are agreed before anything is built.
How we scope
- Inventory which binary types, sizes and access patterns your deployment must serve, such as documents, images and video.
- Confirm the target cloud or on-premises storage backend and the signing key process for that platform.
- Agree in writing who generates, stores, rotates and distributes signing keys, and who approves that design.
- Engagements are fixed-scope, with deliverables and timelines agreed before work starts. Ongoing support is available as a retainer.
How we build
- Configure the storage bucket or volume, access policies and private networking within your infrastructure.
- Replace the development-only temporary signing key with a managed key that the server loads at startup.
- Test expiry, access denial for unauthorized users and key rotation in a non-production environment first.
- Document the configuration, key locations and change steps so your platform team can review them.
How we hand over
- Deliver the configuration, a runbook for key generation and distribution, and the test results.
- Walk your security and platform engineers through how signing keys are issued, stored and revoked.
- Record the controls and evidence your compliance team can use in its own review of the deployment.
How we support
- Plan key rotation and storage changes alongside Medplum version upgrades, which your team runs on its own schedule.
- Retest presigned URL behavior after infrastructure or Medplum version changes, under a retainer where agreed.
- Ask for a written support scope that states response expectations, since these are not set in the company facts.

