Project: Traefik (Orchestration & Management / API Gateway)
File: acme.md

title: "Traefik Let's Encrypt Documentation" description: "Learn how to configure Traefik Proxy to use an ACME provider like Let's Encrypt for automatic certificate generation. Read the technical documentation." Automatic HTTPS {: .subtitle } You can configure Traefik to use an ACME provider (like Let's Encrypt) for automatic certificate generation. !!! warning "Let's Encrypt and Rate Limiting" Note that Let's Encrypt API has . These last up to one week, and can not be overridden. When running Traefik in a container this file should be persisted across restarts. If Traefik requests new certificates each time it starts up, a crash-looping container can quickly reach Let's Encrypt's ratelimits. To configure where certificates are stored, please take a look at the configuration. Use Let's Encrypt staging server with the configuration option when experimenting to avoid hitting this limit too fast. Traefik requires you to define "Certificate Resolvers" in the , which are responsible for retrieving certificates from an ACME server. Then, each is configured to enable TLS, and is associated to a certificate resolver through the . Certificates are requested for domain names retrieved from the router's . You can read more about this retrieval mechanism in the following section: . !!! warning "Defining an is a requirement for a certificate resolver to be functional." !!! important "Defining a certificate resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must it." ??? note "Configuration Reference" There are many available options for ACME. For a quick glance at what's possible, browse the configuration reference: ```yaml tab="File (YAML)" --8<-- "content/https/ref-acme.yaml" ``` ```toml tab="File (TOML)" --8<-- "content/https/ref-acme.toml" ``` ```bash tab="CLI" --8<-- "content/https/ref-acme.txt" ``` Certificate resolvers request certificates for a set of the domain names inferred from routers, with the following logic: If the router has a option set, then the certificate resolver uses the `main` (and optionally `sans`) option of `tls.domains` to know the domain names for this router. If no option is set, then the certificate resolver uses the , by checking the `Host()` matchers. Please note that ) for specifying multiple domain names for this router. Please note that: When multiple domain names are inferred from a given router, only one certificate is requested with the first domain name as the main domain, and the other domains as . As , any router can provide a name, as "main" domain or as "SAN" domain. Please check the for more details. ??? example "Enabling ACME" ```yaml tab="File (YAML)" entryPoints: web: address: ":80" websecure: address: ":443" certificatesResolvers: myresolver: acme: email: your-email@example.com storage: acme.json httpChallenge: entryPoint: web ``` ```toml tab="File (TOML)" [entryPoints] [entryPoints.web] address = ":80" [entryPoints.websecure] address = ":443" [certificatesResolvers.myresolver.acme] email = "your-email@example.com" storage = "acme.json" [certificatesResolvers.myresolver.acme.httpChallenge] entryPoint = "web" ``` ```bash tab="CLI" --entryPoints.web.address=:80 --entryPoints.websecure.address=:443 --certificatesresolvers.myresolver.acme.email=your-email@example.com --certificatesresolvers.myresolver.acme.storage=acme.json --certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web ``` !!! important "Defining a certificate resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must it." ??? example "Single Domain from Router's Rule Example" A certificate for the domain `example.com` is requested: --8<-- "content/https/include-acme-single-domain-example.md" ??? example "Multiple Domains from Router's Rule Example" A certificate for the domains `example.com` (main) and `blog.example.org` is requested: --8<-- "content/https/include-acme-multiple-domains-from-rule-example.md" ??? example "Multiple Domains from Router's `tls.domain` Example" A certificate for the domains `example.com` (main) and `.example.org` (SAN) is requested: --8<-- "content/https/include-acme-multiple-domains-example.md" Traefik automatically tracks the expiry date of ACME certificates it

By default, Traefik manages 90 days certificates, and starts to renew certificates 30 days before their expiry. When using a certificate resolver that issues certificates with custom durations, one can configure the certificates' duration with the option. !!! info "" Certificates that are no longer used may still be renewed, as Traefik does not currently check if the certificate is being used before renewing. When using LetsEncrypt with kubernetes, there are some known caveats with both the and providers. !!! info "" If you intend to run multiple instances of Traefik with LetsEncrypt, please ensure you read the sections on those provider pages. !!! warning "Defining one ACME challenge is a requirement for a certificate resolver to be functional." !!! important "Defining a certificate resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must it." Use the `TLS-ALPN-01` challenge to generate and renew ACME certificates by provisioning a TLS certificate. As described on the Let's Encrypt , when using the `TLS-ALPN-01` challenge, Traefik must be reachable by Let's Encrypt through port 443. ??? example "Configuring the `tlsChallenge`" ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: tlsChallenge: {} ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] [certificatesResolvers.myresolver.acme.tlsChallenge] ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.tlschallenge=true ``` Use the `HTTP-01` challenge to generate and renew ACME certificates by provisioning an HTTP resource under a well-known URI. As described on the Let's Encrypt , when using the `HTTP-01` challenge, `certificatesresolvers.myresolver.acme.httpchallenge.entrypoint` must be reachable by Let's Encrypt through port 80. ??? example "Using an EntryPoint Called web for the `httpChallenge`" ```yaml tab="File (YAML)" entryPoints: web: address: ":80" websecure: address: ":443" certificatesResolvers: myresolver: acme: httpChallenge: entryPoint: web ``` ```toml tab="File (TOML)" [entryPoints] [entryPoints.web] address = ":80" [entryPoints.websecure] address = ":443" [certificatesResolvers.myresolver.acme] [certificatesResolvers.myresolver.acme.httpChallenge] entryPoint = "web" ``` ```bash tab="CLI" --entryPoints.web.address=:80 --entryPoints.websecure.address=:443 --certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web ``` !!! info "" Redirection is fully compatible with the `HTTP-01` challenge. Use the `DNS-01` challenge to generate and renew ACME certificates by provisioning a DNS record. ??? example "Configuring a `dnsChallenge` with the DigitalOcean Provider" ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: dnsChallenge: provider: digitalocean delayBeforeCheck: 0 ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] [certificatesResolvers.myresolver.acme.dnsChallenge] provider = "digitalocean" delayBeforeCheck = 0 ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.dnschallenge.provider=digitalocean --certificatesresolvers.myresolver.acme.dnschallenge.delaybeforecheck=0 ``` !!! warning "`CNAME` support" `CNAME` are supported (and sometimes even ), but there are a few cases where they can be . If needed, `CNAME` support can be disabled with the following environment variable: ```bash LEGODISABLECNAME_SUPPORT=true ``` !!! warning "Multiple DNS Challenge provider" Multiple DNS challenge provider are not supported with Traefik, but you can use `CNAME` to handle that. For example, if you have `example.org` (account foo) and `example.com` (account bar) you can create a CNAME on `example.org` called `_acme-challenge.example.org` pointing to `challenge.example.com`. This way, you can obtain certificates for `example.com` with the `foo` account. !!! important A `provider` is mandatory. Here is a list of supported `providers`, that can automate the DNS verification, along with the required environment variables and their . Do not hesitate to complete it. Many lego environment variables can be overridden by their respective `_FILE` counterpart, which should have a filepath to a file that contains the secret as its value. For example, `CFAPIEMAILFILE=/run/secrets/traefikcf-api-email` could be used to provide a Cloudflare API email address as a Docker secret named `traefik_cf-api-email`. For complete details, refer to your provider's Additional configuration

| Provider Name | Provider Code | Environment Variables | | ||--|-|| | | `acme-dns` | `ACMEDNSAPIBASE`, `ACMEDNSSTORAGEPATH` | | | | `alidns` | `ALICLOUDACCESSKEY`, `ALICLOUDSECRETKEY`, `ALICLOUDREGIONID` | | | | `allinkl` | `ALLINKLLOGIN`, `ALLINKLPASSWORD` | | | | `arvancloud` | `ARVANCLOUDAPIKEY` | | | | `auroradns` | `AURORAUSERID`, `AURORAKEY`, `AURORAENDPOINT` | | | | `autodns` | `AUTODNSAPIUSER`, `AUTODNSAPIPASSWORD` | | | (DEPRECATED) | `azure` | `AZURECLIENTID`, `AZURECLIENTSECRET`, `AZURESUBSCRIPTIONID`, `AZURETENANTID`, `AZURERESOURCEGROUP`, ` | | | `azuredns` | `AZURECLIENTID`, `AZURECLIENTSECRET`, `AZURETENANTID`, `AZURESUBSCRIPTIONID`, `AZURERESOURCEGROUP`, ` | | | `bindman` | `BINDMANMANAGERADDRESS` | | | | `bluecat` | `BLUECATSERVERURL`, `BLUECATUSERNAME`, `BLUECATPASSWORD`, `BLUECATCONFIGNAME`, `BLUECATDNS_VIEW` | | | | `brandit` | `BRANDITAPIUSERNAME`, `BRANDITAPIKEY` | | | | `bunny` | `BUNNYAPIKEY` | | | | `checkdomain` | `CHECKDOMAIN_TOKEN`, | | | | `civo` | `CIVO_TOKEN` | | | | `cloudru` | `CLOUDRUSERVICEINSTANCEID`, `CLOUDRUKEYID`, `CLOUDRUSECRET` | | | | `clouddns` | `CLOUDDNSCLIENTID`, `CLOUDDNSEMAIL`, `CLOUDDNSPASSWORD` | | | | `cloudflare` | `CFAPIEMAIL`, `CFAPIKEY` | | | `cloudns` | `CLOUDNSAUTHID`, `CLOUDNSAUTHPASSWORD` | | | | `cloudxns` | `CLOUDXNSAPIKEY`, `CLOUDXNSSECRETKEY` | | | | `conoha` | `CONOHATENANTID`, `CONOHAAPIUSERNAME`, `CONOHAAPIPASSWORD` | | | | `constellix` | `CONSTELLIXAPIKEY`, `CONSTELLIXSECRETKEY` | | | | `cpanel` | `CPANELMODE`, `CPANELUSERNAME`, `CPANELTOKEN`, `CPANELBASE_URL` | | | | `derak` | `DERAKAPIKEY` | | | | `desec` | `DESEC_TOKEN` | | | | `digitalocean` | `DOAUTHTOKEN` | | | | `dnsmadeeasy` | `DNSMADEEASYAPIKEY`, `DNSMADEEASYAPISECRET`, `DNSMADEEASY_SANDBOX` | | | | `dnsHomede` | `DNSHOMEDE_CREDENTIALS` | | | | `dnsimple` | `DNSIMPLEOAUTHTOKEN`, `DNSIMPLEBASEURL` | | | | `dnspod` | `DNSPODAPIKEY` | | | | `dode` | `DODE_TOKEN` | | | | `domeneshop` | `DOMENESHOPAPITOKEN`, `DOMENESHOPAPISECRET` | | | | `dreamhost` | `DREAMHOSTAPIKEY` | | | | `duckdns` | `DUCKDNS_TOKEN` | | | | `dyn` | `DYNCUSTOMERNAME`, `DYNUSERNAME`, `DYN_PASSWORD` | | | | `dynu` | `DYNUAPIKEY` | | | | `easydns` | `EASYDNSTOKEN`, `EASYDNSKEY` | | | | `edgedns` | `AKAMAICLIENTTOKEN`, `AKAMAICLIENTSECRET`, `AKAMAIACCESSTOKEN` | | | | `efficientip` | `EFFICIENTIPUSERNAME`, `EFFICIENTIPPASSWORD`, `EFFICIENTIPHOSTNAME`, `EFFICIENTIPDNS_NAME` | | | | `epik` | `EPIK_SIGNATURE` | | | | `exoscale` | `EXOSCALEAPIKEY`, `EXOSCALEAPISECRET`, `EXOSCALE_ENDPOINT` | | | | `fastdns` | `AKAMAICLIENTTOKEN`, `AKAMAICLIENTSECRET`, `AKAMAIACCESSTOKEN` | | | | `freemyip` | `FREEMYIP_TOKEN` | | | | `gcore` | `GCOREPERMANENTAPI_TOKEN` | | | | `gandiv5` | `GANDIV5PERSONALACCESS_TOKEN` | | | | `gandi` | `GANDIAPIKEY` | | | | `glesys` | `GLESYSAPIUSER`, `GLESYSAPIKEY`, `GLESYS_DOMAIN` | | | | `godaddy` | `GODADDYAPIKEY`, `GODADDYAPISECRET` | | | | `gcloud` | `GCE_PROJECT`, Application Default Credentials | | | `googledomains` | `GOOGLEDOMAINSACCESS_TOKEN` | | | | `hetzner` | `HETZNERAPIKEY` | | | | `hostingde` | `HOSTINGDEAPIKEY`, `HOSTINGDEZONENAME` | | | | `hosttech` | `HOSTTECHAPIKEY` | | | | `httpnet` | `HTTPNETAPIKEY` | | | | `hurricane` | `HURRICANE_TOKENS` | | | `hyperone` | `HYPERONEPASSPORTLOCATION`, `HYPERONELOCATIONID` | | | | `ibmcloud` | `SOFTLAYERUSERNAME`, `SOFTLAYERAPI_KEY` | | | | `iijdpf` | `IIJDPFAPITOKEN` , `IIJDPFDPMSERVICE_CODE` | | | | `iij` | `IIJAPIACCESSKEY`, `IIJAPISECRETKEY`, `IIJDOSERVICE_CODE` | | | | `infoblox` | `INFOBLOXUSERNAME`, `INFOBLOXPASSWORD`, `INFOBLOX_HOST` | | | | `infomaniak` | `INFOMANIAKACCESSTOKEN` | | | | `internetbs` | `INTERNETBSAPIKEY`, `INTERNETBS_PASSWORD` | | | | `inwx` | `INWXUSERNAME`, `INWXPASSWORD` | | | | `ionos` | `IONOSAPIKEY` | | | | `ipv64` | `IPV64APIKEY` | | | | `iwantmyname` | `IWANTMYNAMEUSERNAME` , `IWANTMYNAMEPASSWORD` | | | | `joker` | `JOKERAPIMODE` with `JOKERAPIKEY` or `JOKERUSERNAME`, `JOKERPASSWORD` | | | | `liara` | `LIARAAPIKEY` | | | | `lightsail` | `AWSACCESSKEYID`, `AWSSECRETACCESSKEY`, `DNS_ZONE` | | | | `linode` | `LINODE_TOKEN` | | | | `liquidweb` | `LIQUIDWEBPASSWORD`, `LIQUIDWEBUSERNAME`, `LIQUIDWEBZONE` | | | | `loopia` | `LOOPIAAPIPASSWORD`, `LOOPIAAPIUSER` | | | | `luadns` | `LUADNSAPIUSERNAME`, `LUADNSAPITOKEN` | | | | `mailinabox` | `MAILINABOXEMAIL`, `MAILINABOXPASSWORD`, `MAILINABOXBASEURL` | | | | `metaname` | `METANAMEACCOUNTREFERENCE`, `METANAMEAPIKEY` | | | | `mydnsjp` | `MYDNSJPMASTERID`, `MYDNSJP_PASSWORD` | | | | `mythicbeasts` | `MYTHICBEASTSUSERNAME`, `MYTHICBEASTS_PASSWORD` | | | | `namedotcom` | `NAMECOMUSERNAME`, `NAMECOMAPITOKEN`, `NAMECOMSERVER` | | | | `namecheap` | `NAMECHEAPAPIUSER`, `NAMECHEAPAPIKEY` | | | | `namesilo` | `NAMESILOAPIKEY` | | | | `nearlyfreespeech` | `NEARLYFREESPEECHAPIKEY`, `NEARLYFREESPEECH_LOGIN` | | | | `netcup` | `NETCUPCUSTOMERNUMBER`, `NETCUPAPIKEY`, `NETCUPAPIPASSWORD` | | | | `netlify` | `NETLIFY_TOKEN` | | | | `nicmanager` | `NICMANAGERAPIEMAIL`, `NICMANAGERAPIPASSWORD` | | | | `nifcloud` | `NIFCLOUDACCESSKEYID`, `NIFCLOUDSECRETACCESSKEY` | | | | `njalla` | `NJALLA_TOKEN` | | | | `nodion` | `NODIONAPITOKEN` | | | | `ns1` | `NS1APIKEY` | | | | `otc` | `OTCDOMAINNAME`, `OTCUSERNAME`, `OTCPASSWORD`, `OTCPROJECTNAME`, `OTCIDENTITY_ENDPOINT` | | | | `designate` | `OSAUTHURL`, `OSUSERNAME`, `OSPASSWORD`, `OSTENANTNAME`, `OSREGIONNAME` | | | | `oraclecloud` | `OCICOMPARTMENTOCID`, `OCIPRIVKEYFILE`, `OCIPRIVKEYPASS`, `OCIPUBKEYFINGERPRINT`, `OCIREGION`, `OCITENANCYOCID`, `OCIUSER_OCID` | | | | `ovh` | `OVHENDPOINT`, `OVHAPPLICATIONKEY`, `OVHAPPLICATIONSECRET`, `OVHCONSUMER_KEY` | | | | `plesk` | `PLESKSERVERBASEURL`, `PLESKUSERNAME`, `PLESK_PASSWORD` | | | | `porkbun` | `PORKBUNSECRETAPIKEY`, `PORKBUNAPI_KEY` | | | | `pdns` | `PDNSAPIKEY`, `PDNSAPIURL` | | | | `rackspace` | `RACKSPACEUSER`, `RACKSPACEAPI_KEY` | | | | `rcodezero` | `RCODEZEROAPITOKEN` | | | | `regru` | `REGRUUSERNAME`, `REGRUPASSWORD` | | | | `rfc2136` | `RFC2136TSIGKEY`, `RFC2136TSIGSECRET`, `RFC2136TSIGALGORITHM`, `RFC2136_NAMESERVER` | | | | `rimuhosting` | `RIMUHOSTINGAPIKEY` | | | | `route53` | `AWSACCESSKEYID`, `AWSSECRETACCESSKEY`, ` | | | `sakuracloud` | `SAKURACLOUDACCESSTOKEN`, `SAKURACLOUDACCESSTOKEN_SECRET` | | | | `scaleway` | `SCALEWAYAPITOKEN` | | | | `selectel` | `SELECTELAPITOKEN` | | | | `servercow` | `SERVERCOWUSERNAME`, `SERVERCOWPASSWORD` | | | | `shellrent` | `SHELLRENTUSERNAME`, `SHELLRENTTOKEN` | | | | `simply` | `SIMPLYACCOUNTNAME`, `SIMPLYAPIKEY` | | | | `sonic` | `SONICUSERID`, `SONICAPIKEY` | | | | `stackpath` | `STACKPATHCLIENTID`, `STACKPATHCLIENTSECRET`, `STACKPATHSTACKID` | | | | `tencentcloud` | `TENCENTCLOUDSECRETID`, `TENCENTCLOUDSECRETKEY` | | | | `transip` | `TRANSIPACCOUNTNAME`, `TRANSIPPRIVATEKEY_PATH` | | | | `safedns` | `SAFEDNSAUTHTOKEN` | | | | `ultradns` | `ULTRADNSUSERNAME`, `ULTRADNSPASSWORD` | | | | `variomedia` | `VARIOMEDIAAPITOKEN` | | | | `vegadns` | `SECRETVEGADNSKEY`, `SECRETVEGADNSSECRET`, `VEGADNS_URL` | | | | `vercel` | `VERCELAPITOKEN` | | | | `versio` | `VERSIOUSERNAME`, `VERSIOPASSWORD` | | | | `vinyldns` | `VINYLDNSACCESSKEY`, `VINYLDNSSECRETKEY`, `VINYLDNS_HOST` | | | | `vkcloud` | `VKCLOUDPASSWORD`, `VKCLOUDPROJECTID`, `VKCLOUD_USERNAME` | | | | `vscale` | `VSCALEAPITOKEN` | | | | `vultr` | `VULTRAPIKEY` | | | | `webnames` | `WEBNAMESAPIKEY` | | | | `websupport` | `WEBSUPPORTAPIKEY`, `WEBSUPPORT_SECRET` | | | | `wedos` | `WEDOSUSERNAME`, `WEDOSWAPI_PASSWORD` | | | | `yandex360` | `YANDEX360OAUTHTOKEN`, `YANDEX360ORGID` | | | | `yandexcloud` | `YANDEXCLOUDFOLDERID`, `YANDEXCLOUDIAMTOKEN` | | | | `yandex` | `YANDEXPDDTOKEN` | | | | `zoneee` | `ZONEEEAPIUSER`, `ZONEEEAPIKEY` | | | | `zonomi` | `ZONOMIAPIKEY` | | | External Program | `exec` | `EXEC_PATH` | | | HTTP request | `httpreq` | `HTTPREQENDPOINT`, `HTTPREQMODE`, `HTTPREQUSERNAME`, `HTTPREQPASSWORD` | | manual | `manual` | none, but you need to run Traefik interactively [^4], turn on debug log to see instructions and press <kbd>Enter</kbd>. | | . . , each domain or wildcard (record name) needs a token. So each update of record name must be followed by an update of the `HURRICANE_TOKENS` variable, and a restart of Traefik. !!! info "`delayBeforeCheck`" By default, the `provider` verifies the TXT record before letting ACME

You can delay this operation by specifying a delay (in seconds) with `delayBeforeCheck` (value must be greater than zero). This option is useful when internal networks block external DNS queries. Use custom DNS servers to resolve the FQDN authority. ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: dnsChallenge: resolvers: "1.1.1.1:53" "8.8.8.8:53" ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] [certificatesResolvers.myresolver.acme.dnsChallenge] resolvers = ["1.1.1.1:53", "8.8.8.8:53"] ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53 ``` supports wildcard certificates. As described in wildcard certificates can only be generated through a . `kid`: Key identifier from External CA `hmacEncoded`: HMAC key from External CA, should be in Base64 URL Encoding without padding format ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: eab: kid: abc-keyID-xyz hmacEncoded: abc-hmac-xyz ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] [certificatesResolvers.myresolver.acme.eab] kid = "abc-keyID-xyz" hmacEncoded = "abc-hmac-xyz" ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.eab.kid=abc-keyID-xyz --certificatesresolvers.myresolver.acme.eab.hmacencoded=abc-hmac-xyz ``` Required, Default="https://acme-v02.api.letsencrypt.org/directory" The CA server to use: Let's Encrypt production server: https://acme-v02.api.letsencrypt.org/directory Let's Encrypt staging server: https://acme-staging-v02.api.letsencrypt.org/directory ??? example "Using the Let's Encrypt staging server" ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: caServer: https://acme-staging-v02.api.letsencrypt.org/directory ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] caServer = "https://acme-staging-v02.api.letsencrypt.org/directory" ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory ``` Required, Default="acme.json" The `storage` option sets the location where your ACME certificates are saved to. ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: storage: acme.json ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] storage = "acme.json" ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.storage=acme.json ``` ACME certificates are stored in a JSON file that needs to have a `600` file mode. In Docker you can mount either the JSON file, or the folder containing it: ```bash docker run -v "/my/host/acme.json:/acme.json" traefik ``` ```bash docker run -v "/my/host/acme:/etc/traefik/acme" traefik ``` !!! warning For concurrency reasons, this file cannot be shared across multiple instances of Traefik. Optional, Default=2160 The `certificatesDuration` option defines the certificates' duration in hours. It defaults to `2160` (90 days) to follow Let's Encrypt certificates' duration. !!! warning "Traefik cannot manage certificates with a duration lower than 1 hour." ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: certificatesDuration: 72 ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] certificatesDuration=72 ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.certificatesduration=72 ``` `certificatesDuration` is used to calculate two durations: `Renew Period`: the period before the end of the certificate duration, during which the certificate should be renewed. `Renew Interval`: the interval between renew attempts. | Certificate Duration | Renew Period | Renew Interval | |-|-|-| | >= 1 year | 4 months | 1 week | | >= 90 days | 30 days | 1 day | | >= 7 days | 1 day | 1 hour | | >= 24 hours | 6 hours | 10 min | | < 24 hours | 20 min | 1 min | Optional, Default="" Preferred chain to use. If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name. If no match, the default offered chain will be used. ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: preferredChain: 'ISRG Root X1' ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] preferredChain = "ISRG Root X1" ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.preferredChain=ISRG Root X1 ``` Optional, Default="RSA4096" KeyType used for generating certificate private key. Allow value 'EC256', 'EC384', 'RSA2048', 'RSA4096', 'RSA8192'. ```yaml tab="File (YAML)" certificatesResolvers: myresolver: acme: keyType: 'RSA4096' ``` ```toml tab="File (TOML)" [certificatesResolvers.myresolver.acme] keyType = "RSA4096" ``` ```bash tab="CLI" --certificatesresolvers.myresolver.acme.keyType=RSA4096 ``` If Let's Encrypt is not reachable, the following certificates will apply: Previously generated ACME certificates (before downtime) Expired ACME certificates Provided certificates !!! important For new (sub)domains which need Let's Encrypt authentication, the default Traefik certificate will be used until Traefik is restarted. {!traefik-for-business-applications.md!}