Dosu LogoDosu Logo
Ask
Join our Discord
Dokploy's SpacePublic
Dokploy
DocumentsDokploy's Space
Traefik TLS & Certificate Management
Traefik TLS & Certificate Management
Type
Topic
Status
Published
Created
Aug 1, 2026
Updated
Aug 1, 2026
Created by
Dosu Bot
Updated by
Dosu Bot

Traefik TLS & Certificate Management#

Overview#

Dokploy uses Traefik as its reverse proxy and handles TLS at two levels: static configuration (entrypoints, ACME resolver definition) and dynamic configuration (per-router tls settings). Understanding the interaction between the entrypoint-level certResolver default and the per-router override is critical to debugging certificate behavior.


Static Configuration: Entrypoint TLS Default#

The websecure entrypoint is configured with a default certResolver: "letsencrypt" at the entrypoint level in production :

websecure:
  http:
    tls:
      certResolver: letsencrypt

This means any router on websecure that does not explicitly set tls.certResolver will automatically use Let's Encrypt — including routers that set tls: {} with no resolver specified. This is a Traefik behavior: the entrypoint-level resolver acts as a fallback.

The ACME resolver itself is named letsencrypt, uses httpChallenge on the web entrypoint, and stores certificates in /etc/dokploy/traefik/dynamic/acme.json . The email is a placeholder (test@localhost.com) — this does not affect cert issuance but means renewal notices are not received.

The remote server config (getDefaultServerTraefikConfig) always enables the production resolvers and entrypoint default , regardless of NODE_ENV.


Per-Router certResolver: The Three Cases#

createRouterConfig() in domain.ts maps domain.certificateType to a router-level TLS config on the websecure entrypoint :

certificateTypeRouter tls fieldEffective behavior
letsencrypt{ certResolver: "letsencrypt" }Explicit ACME via Let's Encrypt
custom{ certResolver: "<domain.customCertResolver>" }Named custom resolver
nonetls: undefined (field omitted)Falls back to entrypoint default — the websecure entrypoint-level certResolver: letsencrypt still applies

Key implication: Setting certificateType: "none" on a domain does not disable TLS certificate acquisition. Because tls is omitted from the router, the entrypoint-level default kicks in and Traefik will still attempt to obtain a Let's Encrypt certificate. The router remains on websecure and uses the entrypoint's resolver.


No ACME Cleanup on Certificate Type Change#

When a domain's certificateType is changed (e.g., from letsencrypt to custom or none), the domain.update tRPC mutation calls manageDomain() to rewrite the Traefik YAML config . This correctly updates the router's tls field.

However, there is no code that modifies acme.json at any point. The ACME storage file is only touched on startup (chmod to 600) and is written entirely by Traefik itself. When a domain stops referencing certResolver: letsencrypt, its certificate entry persists in acme.json indefinitely. Traefik stops renewing it (no router references the cert), but the entry is never cleaned up.

This applies equally to domain deletion. The domain.delete mutation removes the router from the YAML, but acme.json is left untouched .

Manual cleanup: edit /etc/dokploy/traefik/dynamic/acme.json, remove the domain's entry, then restart the Traefik container.


Dual-Router HTTPS Pattern#

When https=true and no customEntrypoint is set, Dokploy generates two routers for a domain :

  • {appName}-router-{key} on web: only the redirect-to-https@file middleware; no tls block.
  • {appName}-router-websecure-{key} on websecure: all real middlewares + TLS config.

If customEntrypoint is set, a single router is created for that entrypoint . TLS is only added when the entrypoint is websecure or when customEntrypoint is set and https=true .


Key Files#

FilePurpose
packages/server/src/setup/traefik-setup.tsStatic config generation, ACME resolver, entrypoint defaults
packages/server/src/utils/traefik/domain.tsPer-domain router config, createRouterConfig(), manageDomain(), removeDomain()
packages/server/src/utils/traefik/file-types.tsHttpRouter type — tls.certResolver field definition
packages/server/src/utils/traefik/types.tsMainTraefikConfig — entrypoint-level tls.certResolver
/etc/dokploy/traefik/dynamic/acme.jsonTraefik-managed ACME certificate store (600 permissions required)
Documents
API Key Management
Authentication Secret Management
Backup Command Execution
Backup File Management
Build Type Schema and UI Validation
Client IP Preservation
Container Log Streaming
Database Management
Deployment Lifecycle Management
Deployment List Rendering
Docker Compose Build Caching
Docker Compose File Management
Docker Compose Networking
Docker Container Terminal
Docker Registry Management
Docker Remote Build Execution
Docker Swarm Deployment
Docker Swarm Networking
Docker Swarm Resource Configuration
Dokploy Access Control
Dokploy Core Infrastructure
Dokploy Installation & Uninstallation
Dokploy Monitoring
Domain DNS Validation
Git Provider Configuration
GitHub Credential Security
Hostname Validation
Preview Deployment Access Control
Preview Deployment Management
Railpack Build Integration
Redirect Configuration
Remote Command Execution
Remote Server Setup
Resource Cleanup and Lifecycle Management
Schedule and Service Permission Model
SCIM and SSO Integration
Server Settings Management
Session Management
Sidebar Navigation
Static Site Serving
Tailwind CSS & Shadcn UI
Terminal Styling
Timezone-Aware Scheduling
Traefik Access Log Parsing
Traefik Configuration
Traefik Docker Network Routing
Traefik Domain Routing
Traefik TLS & Certificate Management
Webhook Endpoint Architecture
AGENTS
CONTRIBUTING
Dokploy API Changes (December 2025 - February 2026)
README
README
TERMS_AND_CONDITIONS
copilot-instructions
pull_request_template