Automate certificate renewal on Docker and Compose deployments

Renewing certificates by hand for containers stops working as public TLS lifetimes shrink. This page covers how to automate renewal for Docker and Compose services, and what to check.

On this page

How can Docker and Compose certificate renewal be automated, and what do shorter lifetimes change here?

Teams running containers on Docker and Compose, usually behind a reverse proxy or terminating TLS inside the service itself, can automate renewal by pairing an ACME client with the proxy or application that reads the certificate files. The client renews the certificate into a host directory that is mounted into the container, and the service is then told to reload the file, either with a signal, a reload command run through docker exec, or a restart of the container. Shorter lifetimes change this platform because a certificate that was once renewed about once a year must now be renewed several times a year. The CA/Browser Forum Baseline Requirements version 2.3.2 set the maximum subscriber certificate validity to 200 days from 15 March 2026, and then to 100 days from 15 March 2027 and 47 days from 15 March 2029. A manual renewal step is no longer workable at those intervals, so the renewal and reload path has to run without a person.

Who has to act depends on who issues and consumes the certificates. The platform or DevOps team owns the Compose files, volume mounts and the renewal job, and the application team owns the reload behavior of each service, since not every image picks up a new certificate file without a restart. Teams should confirm which of their images read certificate files at startup and which reload them on a signal, and check that the reload command or restart is documented for the exact image and version they run. The sources listed on this page do not give a container-specific renewal procedure, so the proxy's and application's own documentation is the place to confirm the reload method. The CA/B Forum Baseline Requirements are the reference for the lifetime schedule, and that document is linked from this page as the next read.

Before any automation goes live, run a dry test on a staging stack: renew a certificate, confirm the mounted file changes inside the container, trigger the reload, and check that new connections use the new certificate while existing connections finish cleanly. Record how long the chain of renewal, copy and reload takes, and set alerts for renewal failures, because a missed renewal on a 47-day certificate will be discovered much sooner than one on a yearly certificate. Ask any vendor or managed hosting provider you depend on how they renew and reload certificates for the containers you run on their infrastructure, and get that answer in writing.

What the Baseline Requirements schedule changes for container certificates

This table lists the three dated steps in the CA/Browser Forum Baseline Requirements 2.3.2 schedule, with the maximum certificate lifetime and the validation reuse period at each step. Read each row as what a container team must change by that date, including how many renewals a year the new limit implies and which manual steps stop working. The schedule was adopted under ballot SC081 on 2025-04-11 and took effect on 2025-05-16.

Effective dateMaximum certificate validityDomain and IP validation reuseRenewals per year and what stops working by hand
15 March 2026200 days200 daysAbout 2 renewals a year per certificate. Manual copies of a certificate into a container image, once a year, no longer keep pace.
15 March 2027100 days100 daysAbout 4 renewals a year per certificate. Renewal on a calendar reminder, or a manual file replacement followed by a container restart, becomes too infrequent to rely on.
15 March 202947 days10 daysAbout 8 renewals a year per certificate. Any step that needs a person to replace a file or restart a container fails within a few weeks, so automated renewal and reload must be in place.
Adoption and effective date of SC081Adopted 2025-04-11Effective 2025-05-16Source for the schedule. Confirm the current text in the Baseline Requirements before relying on any row.

How Docker and Compose issue and reload certificates

On Docker and Compose, the first decision is how the certificate and private key reach the container. The sources for this page name three routes: mounting files from the host or a volume into the container, passing values through environment variables, or placing a reverse proxy container in front of the service so that the proxy holds the certificate and the application stays plain. Mounted files are the most common route for certificates that renew, because the renewal job can replace the file on the host and the container reads the new version. Environment variables are a poor fit for private keys: values set this way are visible in container metadata and in the output of docker inspect, and the sources do not describe a way to change them without recreating the container. Confirm where your image expects its certificate path and whether it reads the file at startup only.

The reload step is where Docker-specific behaviour matters most, and the sources listed on this page do not describe it for individual images. A mounted file that changes on the host does not by itself make a running process reload its certificate. Whether the service picks up the new file depends on the software inside the container: some re-read certificate files on a signal, some on a configuration reload, and some only when the container restarts. Check the vendor documentation of the image you run for its reload mechanism, the signal or command it accepts, and whether it watches the file. Also confirm which file the image reads when a bind-mounted path is replaced rather than edited in place, since a replaced file can break a reader that holds the old file open.

For a reverse proxy container, the renewal job usually updates the certificate files that the proxy mounts and then asks the proxy to reload. Plan this as a two-part task: the renewal tool writes the new certificate and key to the path the proxy reads, and a separate step triggers the proxy's reload or a controlled container restart. Test both paths on a staging Compose project before production, and record which containers depend on the proxy, since a restart affects every service behind it. The sources do not specify a standard Compose command for this reload, so check the proxy's documentation for the exact signal or command and confirm it works with the Compose version and host layout you use.

Which automation options apply to Docker and Compose

Some reverse proxy containers can request and renew certificates themselves over ACME, so the proxy is the only container that holds TLS keys. This keeps the renewal path short: the proxy obtains a certificate, stores it in its own data volume, and serves it without a separate reload step handled by you. The sources supplied for this topic do not document any specific proxy image, setting or command, so confirm the exact configuration in the proxy's own documentation before relying on it.

  • Container needs: a persistent volume for certificate storage, so renewed certificates survive container restarts.
  • Network reach: the proxy must be reachable on the challenge port the ACME validation method requires.
  • Scope limit: only the proxy holds the keys, so backends that terminate TLS themselves need their own renewal path.
  • Credentials: DNS-based validation needs API credentials for the DNS provider, stored as secrets rather than in image files.
  • Not covered by the sources: which proxy images support ACME, and their exact settings. Confirm this with each vendor's documentation.

Check that renewal completes well before expiry, and that a renewed certificate is actually served after the proxy updates its store.

Set-up steps for automated renewal in Compose

This sequence wires a certificate issuing client into a Docker Compose stack so that renewed certificates land in a mounted directory, the service reads the new file, and the service reloads without a manual restart. Each step ends with a check you can run before moving on. The order matters because each step depends on the output of the one before it.

  1. Confirm names and domains for each service

    Before you touch Compose, list every hostname that each container must present in its certificate, including any alternative names your clients use. Compare this list against the domains you control and confirm that DNS points to the host where the issuing client will run. Platform engineers should own this step because a mismatch here causes validation to fail later. You know it is done when each service has a written list of names and each name resolves to the expected address. Check the CA/Browser Forum Baseline Requirements (version 2.3.2) for the current subscriber certificate validity limits that apply to these names, since the maximum lifetime is shortening on a fixed schedule.

  2. Choose and configure the issuing client

    Select the ACME client your team will run, and install it on the Docker host or in its own container with access to the directory where certificates will be stored. Set the client to request certificates for the names confirmed in the previous step and to store the output in a predictable path. Ask your certificate authority which ACME directory URL and account settings it requires, because these differ between providers. You know this step is complete when the client can register an account and report a successful first issuance in its log. The exact configuration keys belong to the client you chose, so consult that client's documentation for the command and file format.

  3. Set the validation method

    Decide how the issuing client will prove control of each domain. The common options are an HTTP challenge served from a path your web server exposes, or a DNS challenge that requires write access to the zone. Choose the method that your network layout allows, and make sure the port or DNS credential the client needs is reachable from the container network. Record the method in your configuration so that a later renewal uses the same path. You know it is done when a test issuance for one non-production name succeeds with no manual intervention. The sources available for this topic do not describe specific challenge settings for Compose, so confirm them against your client's documentation.

  4. Mount the certificate directory into containers

    In your Compose file, add a bind mount or named volume that places the directory where the issuing client writes certificates into each container that needs it. Mount the directory read-only into service containers, and mount it read-write only into the issuing client's container. Confirm that the file permissions allow the service process to read the private key, and that the mount path matches what the service expects. You know it is done when docker compose exec into the service shows the certificate and key files at the expected paths with the correct ownership. Check the Compose documentation for the exact volume syntax supported by your Compose version.

  5. Configure the service to read the new file

    Point the service's TLS configuration at the mounted certificate and key files. For databases, the PostgreSQL SSL documentation describes how the server reads its certificate and key from configured file paths, and the MySQL encrypted connections documentation covers the equivalent for MySQL. Use those references to confirm which settings the service reads from its configuration, and set the paths to the mounted locations. Reload or restart the service once to confirm that it starts with the mounted certificate. You know this step is complete when a TLS client connecting to the service sees the expected certificate subject and expiry date. Keep in mind that the database documentation covers configuration reload patterns only; the Docker wiring is yours to design.

  6. Add a reload step after each renewal

    Configure the issuing client to run a hook or post-renewal command after it writes new files, and have that command signal the service to re-read its certificate without a full restart. The mechanism depends on the service: some services reload on a signal, and some expose a SQL or administrative command. Use the service's own documentation for the reload command, and test it manually on a non-production container first. Confirm that existing connections are not dropped by the reload, or plan a short maintenance window if they are. You know it is done when a forced renewal in a test environment results in the service presenting the new certificate with no container restart. Record the exact command so your renewal job runs it on every issuance.

  7. Test the full renewal path before relying on it

    Run one end-to-end renewal in a non-production environment: let the issuing client renew a certificate (or force a renewal), confirm the new file lands in the mounted directory, run the reload hook, and verify with a TLS client that the service serves the new certificate. Check the service logs for errors at each stage, and record the expiry date of the new certificate. Repeat the test after any change to the Compose file or the client configuration. You know the path works when the sequence completes unattended and the service continues to accept connections. Because maximum certificate lifetimes are shortening on a published schedule, schedule this test regularly rather than treating it as a one-time check.

What has to be in place before renewal can run

Automated renewal on Docker and Compose only works when the container, its network path, its DNS names and its certificate files are all ready first. These four items and the key storage question are what to confirm before you write any renewal job.

A supported image or proxy version

Confirm that the container image or reverse proxy you run supports reloading a certificate file without a restart, and that the version you deploy includes that behavior. Support differs between products and between releases, so check the documentation for the exact version your Compose file pins. Renewal automation that depends on a reload command fails silently on a version that lacks it, so test the reload on a staging stack before production.

PostgreSQL SSL docs

Network reachability for validation

The validation method your ACME client uses determines which ports and paths must be reachable. HTTP-01 needs the public port 80 to reach the client that answers the challenge, while DNS-01 needs no inbound port but needs outbound access to the DNS provider. Check that any firewall, load balancer or container network rule in front of the stack allows the method you chose, and confirm this from outside the host.

DNS access for every name

Each hostname on the certificate must resolve to the host that will answer validation, and the account that automates renewal needs write access to the DNS zone if you use DNS-01. Inventory every name the certificate covers, including aliases used by services in the Compose file. A name missing from the inventory will fail validation at renewal time, not at deployment time.

Write permissions on the certificate volume

The process that writes renewed files must have write access to the mounted certificate volume, and the container must read the new file after it appears. Check the user ID inside the container against the owner and mode of the mounted files, because a permission mismatch leaves the old certificate in place without an obvious error. Confirm that a renewal writes the new key and certificate as a pair so the service never loads mismatched files.

Secure storage for private keys

Private keys must be readable only by the service account that needs them, and the volume holding them should not be copied into images or committed to version control. Decide where keys are stored, who can read them and how a compromised host is handled before renewal goes live. Renewal rotates the key as well as the certificate only if your client is configured to do so, so confirm that setting in the client's documentation.

Questions people ask about automating Docker certificates

Does Docker support ACME for certificate renewal?

Docker Engine and Docker Compose do not issue certificates or speak the ACME protocol themselves. Renewal is handled by an ACME client, which runs as a container or on the host, requests and renews the certificate, and writes the files to a path that a container can mount. The sources listed on this page do not describe any built-in Docker ACME feature, so confirm against the Docker documentation for the versions you run before relying on one. Teams usually pair a client with a reverse proxy that reads the mounted files, or with a service that reloads when the files change.

Which ACME client should I use with Docker Compose?

The choice depends on how TLS is terminated and which certificate authority you use. Compare clients on whether they run as a container, whether they support the challenge type your environment allows, whether they can run a hook after renewal, and whether they document a Docker deployment. The sources listed on this page do not rank clients, so compare each client's own documentation against your setup. Check the ACME client pillar on this site for how the common clients differ on protocol support and renewal behavior.

How often will certificates need to renew under the 200-day and 100-day limits?

Under the CA/Browser Forum Baseline Requirements, version 2.3.2, the maximum validity of a publicly trusted subscriber certificate is 200 days from 15 March 2026, and 100 days from 15 March 2027. From 15 March 2029 the limit is 47 days. The same version also sets shorter reuse periods for domain validation data. Renewal frequency therefore rises over time, and a container stack that renewed once a year will need to renew several times a year. Confirm the lifetime of the certificate your authority issues, since private certificates follow their own policy.

What happens when a certificate renewal fails in a Docker stack?

The old certificate stays in place until it expires, so a failed renewal usually shows up as a warning in the client logs before it becomes an outage. Check that the client container can reach the certificate authority, that its challenge endpoint is reachable, and that the mounted path is writable. Set up an alert on certificate expiry that does not depend on the renewal job itself, and test the reload step so that a new file is actually picked up by the proxy or service. The sources listed on this page do not set a retry schedule, so confirm the client's retry behavior in its documentation.

Do wildcard and internal names work with automated Docker renewal?

Whether a wildcard or internal name can be renewed automatically depends on the certificate authority and the validation method it accepts, not on Docker. Publicly trusted wildcard certificates generally need a DNS-based challenge, so the client needs API access to your DNS provider. Internal names issued by a private certificate authority follow that authority's own issuance rules. The sources listed on this page do not cover every authority's wildcard or internal name policy, so confirm both with your authority and your client before you design the renewal job.

Can my own team automate Docker certificate renewal, or do we need outside help?

A team comfortable with Compose files, mounted volumes and container logs can usually set up a single proxy with one client on its own. Outside help is worth considering when there are many services that read certificate files differently, when renewal must run without interruption, or when the stack must be reviewed for a compliance assessment. DeployOpen plans, implements and documents self-hosted platforms in the client's own infrastructure, and prepares evidence for compliance assessments, but it does not issue audit reports or certifications. Scope and deliverables are agreed in writing before any work starts.

What should a Compose file need to renew certificates safely?

A safe setup mounts the certificate directory read-only into the service that serves TLS, and mounts a separate, writable directory into the client that renews it. Use a clear reload step so the proxy or service reads the new files without a full container restart where its documentation allows. For illustrative purposes, a Compose entry might mount ./certs into both containers with different read and write flags. Confirm the exact keys, reload signal and file names against the documentation for each image you run.

How the renewal flow runs in a Compose stack

The flow starts with the ACME client or proxy container, which requests a new certificate from the certificate authority. The authority validates the request, and the issued certificate is written to a volume shared with the service container. The service then needs a reload to read the new file, so the step to check is that the reload actually happens after each write. Use this diagram to confirm that every hand-off is covered in your own Compose file before a shorter lifetime takes effect.

The renewal path from the ACME client through the shared volume to the service reload.

What the sources say about post-quantum certificates in containers

The sources listed on this page do not describe post-quantum certificate support for Docker or Compose. They cover the CA/Browser Forum Baseline Requirements for publicly trusted TLS certificates, including the schedule that reduces maximum subscriber certificate validity to 200 days from 15 March 2026, to 100 days from 15 March 2027 and to 47 days from 15 March 2029, along with the PostgreSQL and MySQL documentation. None of them say whether a container image, a reverse proxy running in a container, or a Compose file can carry or reload a post-quantum certificate, so no statement about that is made here.

For that question, check three places. First, the documentation for the image you run, since the image's TLS library and build determine which certificate types and key algorithms it can load. Second, the documentation for the reverse proxy or TLS-terminating server inside the container, which states which signature algorithms and certificate formats it supports and how it reads certificate files on reload. Third, the certificate authority that issues your certificates, which states which post-quantum certificate types it offers, if any, and on what dates. Record the version of each component, because support is tied to specific releases and a newer image may change the answer.

Until those sources confirm support, treat the containers' current certificate handling as the baseline for planning. Confirm the reload behaviour for each service in a test environment before depending on it, and do not describe any container, image or proxy as quantum-safe or compliant on the strength of this page. If a vendor has published nothing on the point, ask for that statement in writing as part of your review.

How DeployOpen works on this

DeployOpen plans and builds automated certificate renewal for containers that run behind a reverse proxy or terminate TLS themselves, on the Docker and Compose setups your team already runs. Each engagement starts from your current certificate lifetimes, renewal steps and reload behavior, and ends with a tested, documented system your own staff can operate.

How we scope

  • We inventory which containers terminate TLS, which sit behind a proxy, and where certificate files are mounted from.
  • We record current certificate validity periods and map them against the 200-day maximum that applies from 15 March 2026.
  • Scope, deliverables and timelines are agreed in writing before any work starts, as a fixed-scope engagement.

How we build

  • We set up automated issuance and renewal for each certificate, using the ACME client that fits your certificate authority.
  • We configure each container or proxy to read renewed certificate files and reload without restarting the whole Compose stack.
  • We test renewal end to end in a staging environment, including a forced renewal, before anything runs in production.

How we hand over

  • You receive the Compose files, renewal scripts and reload configuration, documented so your own engineers can maintain them.
  • We document each certificate's source, renewal schedule, mounted paths and the commands to check expiry and reload status.
  • We walk your platform team through a live renewal and the steps to take if a renewal fails.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • A retainer can cover monitoring of certificate expiry and renewal failures across your Docker and Compose hosts.
  • Changes to lifetimes, such as the 100-day schedule from 15 March 2027, can be planned and tested as part of ongoing support.

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.