Traefik v2 to v3 migration: what breaks
Traefik v3 will not start with swarmMode or pilot in static config. Fix the incompatible deprecated install configuration option error, then migrate rules.
What changes between Traefik v2 and v3
A Traefik v2 to v3 migration is mostly a renaming job, and the famous rename is the ipWhiteList middleware becoming ipAllowList. Beyond that, v3 tightens the router rule syntax (PathPrefix loses its regex features, several matchers are renamed or removed) and drops a few providers and options outright; entrypoints, the ACME certificate storage, the Docker labels workflow, and your acme.json carry over. Other behavior changes too: v3 no longer auto-detects Content-Type when the backend omits it; use the ContentType middleware to restore that behavior. v3 also ships a compatibility mode that keeps v2 rule syntax working, so you can upgrade the binary first and rewrite rules one service at a time instead of in one risky evening.
This guide assumes the label-based Docker Compose setup from the Traefik reverse proxy guide. That page is v3-native; this one is for the box still running a traefik:v2 tag.
The renames and removals
ipWhiteListis nowipAllowList, for both the HTTP and the TCP middleware. The options inside are unchanged, sosourcerangekeeps its exact meaning. Current v3 releases, v3.7 included, still accept the old name as a deprecated alias and keep enforcing the list, logging a deprecation warning for it, so this one rename does not take anything down on the flip. Rename it anyway: the old name is deprecated, and v2.11 already understandsipAllowList, so the rename can go live before the upgrade.providers.docker.swarmMode=trueis gone. Swarm gets its own provider, configured asproviders.swarm.endpoint.- The
pilotsection is gone entirely. experimental.http3is gone. HTTP/3 is enabled on the entrypoint directly.tls.caOptionalis gone from the providers and from the forwardAuth middleware. If that middleware fronts a self-hosted Authentik SSO, delete thecaOptionalline and check header trust too: v3.6.14 deprecatedtrustForwardHeader, with trusted proxy IPs configured through the entrypoint'sforwardedHeaders.trustedIPsandtrustForwardHeader=trueon the middleware.- The InfluxDB v1 metrics provider, the Rancher provider, and the Marathon provider are gone.
- Tracing moved to OpenTelemetry. The dedicated tracing backends, the Jaeger and Zipkin integrations among them, are gone, and v3 exports OTLP (the OpenTelemetry protocol) instead.
- The deprecated
ssl*options inside the headers middleware (sslRedirect,sslHost, and the rest) are gone. Entrypoint redirections and the redirectScheme middleware replaced them.
These removals matter more than they look, because Traefik refuses to start when its static configuration contains an option it removed or does not know. A leftover pilot, swarmMode, experimental.http3, or provider tls.caOptional line stops the container at boot: Traefik first logs a line naming the leftover (for example, Docker provider tls.CAOptional option has been removed in v3), then fails with incompatible deprecated install configuration option found. Releases through v3.5.4 word that last message as incompatible deprecated static option found; v3.5.5 uses the newer wording. An option Traefik has simply never heard of, such as a typo, stops it with field not found and the node instead. These startup failures prevent Traefik itself from running, so that instance cannot return an HTTP 404. Clean the static configuration before you touch the image tag.
A middleware name Traefik genuinely does not know (a typo, or a name that was removed rather than aliased) fails differently: the router that references it loads with an error instead of a route, the dashboard marks it, and the API reports middleware "offce@docker" does not exist. This is a routing failure in a running Traefik instance: requests get a 404 when no other router matches. Removed static options instead prevent Traefik itself from starting, so any 404 in that case comes from another running HTTP server. Note that ipwhitelist is NOT in this category on current v3: it survives as a deprecated alias, so an unrenamed label keeps working with a deprecation warning.
The rule syntax changes
Rules are where real rewriting can happen. The changes in v3:
- Quoting is not one of them. Both versions take rule values in backticks or escaped double quotes and reject single quotes, so Host(
app.example.com) and an escaped-double-quote Host("app.example.com") stay valid as they are. PathPrefixno longer understands regular expressions or{id}-style placeholders. A v2 rule such as PathPrefix(/api/{version:v[0-9]+}) must become aPathRegexpmatcher written in Go regular expression syntax.- Matchers now take a single value. v2 allowed Host(
app.example.com,www.example.com); v3 wants Host(app.example.com) || Host(www.example.com). The exceptions areHeader,HeaderRegexp,Query, andQueryRegexp, which take a name plus a value;QueryandQueryRegexpalso accept just a name to match a parameter with no value. Rewrite v2 Query(foo=bar) as Query(foo,bar). HeadersandHeadersRegexpare renamed toHeaderandHeaderRegexp.HostHeaderis removed. UseHost, which matches the same thing in v3.- Two matchers are new:
PathRegexp, andQueryRegexp.ClientIP, for matching the client address inside a rule, already existed in v2.11; split multiple addresses into separate matchers joined by||.
The good news: a plain Host(app.example.com) rule written with backticks is already valid v3 syntax. Most small Compose setups use exactly that, which means most labels migrate with zero rule edits.
Audit your labels before you start
Start measuring the size of your migration with this search, which catches several common changes:
grep -rnE 'ipwhitelist|HostHeader|Headers\(|PathPrefix\(`[^`]*\{|Host\(`[^`]*`,' docker-compose*.ymlEvery hit is one line to review. ipwhitelist becomes ipallowlist. HostHeader becomes Host. Headers becomes Header. A {...} placeholder inside PathPrefix becomes a PathRegexp matcher. A comma inside Host() becomes two Host() matchers joined by ||. Zero hits does not prove your labels are valid v3 syntax: also review HeadersRegexp, placeholders inside Path, named regex groups inside HostRegexp, v2 Query arguments, and other multi-value matchers, including rules written with escaped double quotes. A screen full of hits is also a fair moment to ask whether this is still the right proxy for the box, and how Traefik compares with Nginx and Caddy sets that rewriting cost against what the other two ask of you per app.
What stays the same
Entrypoints and their HTTP-to-HTTPS redirect, the ACME resolvers with HTTP-01, TLS-ALPN-01, and DNS-01 challenges, exposedByDefault, the router and service labels, loadbalancer.server.port, and the dashboard all work in v3. For DNS-01 setups, the old delayBeforeCheck and disablePropagationCheck options move under dnsChallenge.propagation as delayBeforeChecks and disableChecks. Your certificates carry over too, because v3 keeps reading the acme.json that v2 wrote. Back the file up anyway before you start, since losing it can trigger reissuance; Let's Encrypt allows up to five certificates for the exact same set of identifiers every seven days, and hitting that limit depends on prior issuance for each set:
cp ./letsencrypt/acme.json ./letsencrypt/acme.json.v2-backupThe migration path
Step 1: pin what you run today. Change any traefik:latest or traefik:v2 tag to the installed patch version or image digest, for example traefik:v2.11.60 if that is the patch you run, and commit the whole compose directory to git. Every later step becomes reversible with a checkout. If recreating a single service with docker compose up -d <service> is not second nature yet, the Docker Compose basics guide covers the operations this migration leans on.
Step 2: clean the static configuration and turn on compatibility mode. Remove every option v3 dropped (pilot, swarmMode, tls.caOptional, experimental.http3), then tell v3 to treat rules as v2 syntax by default. In traefik.yml:
core:
defaultRuleSyntax: v2Or as a flag in the compose command: list: --core.defaultRuleSyntax=v2. Compatibility mode covers rule syntax only. It does not resurrect removed options, and it does not rename middlewares for you.
Step 3: apply the middleware renames while still on v2.11. Search your compose files for the old names: grep -rn ipwhitelist docker-compose*.yml. Edit every ipwhitelist label to ipallowlist and recreate those services with docker compose up -d. v2.11 already ships the IPAllowList middleware, so the renamed labels work before the flip, and the IPWhiteList deprecation warning leaves your v2 logs. Releases older than v2.11 do not know the new name, so if you pinned an older v2 in step 1, move to a pinned v2.11 patch first. (If one slips through, current v3 still honours the old name as a deprecated alias, so the list keeps enforcing; fix it in the next pass rather than at 2am.)
Step 4: flip the image tag. Set the Traefik image to traefik:v3.7.20, the patch listed for the official v3.7 image as of 28 November 2026, then:
docker compose up -d
docker compose logs -f traefikBecause compatibility mode is on, your v2 rules keep matching, and because the middleware renames already went live on v2.11, those routers come up clean. A healthy log has no field not found line and no does not exist line.
v3.7.17 also introduces a limit of 500 request header values for HTTP/1 and HTTP/2, with larger requests rejected before routing with 431 Request Header Fields Too Large. Adjust the entrypoint's http.maxHeaderValueCount option if an app needs more.
Starting with v3.7.18, BasicAuth rejects passwords longer than 1024 bytes with 401 Unauthorized; that limit is not configurable. With the default sanitizePath setting, v3.7.18 also normalises dot and empty path segments carrying path parameters: /foo/..;bar/baz is forwarded as /baz.
Be honest with yourself about the window this step opens. A router that references a middleware name v3 genuinely does not know (a typo, or a removed middleware name) is down from the moment the new Traefik starts until you fix its labels and recreate its app container. If a route truly cannot blink, drop the suspect middleware from that router's middlewares label before the flip and re-add it after, and decide in advance whether that route can live without it for the minute in between.
Step 5: migrate rules service by service. Work through one app at a time: rewrite its rule to v3 syntax, add traefik.http.routers.app.ruleSyntax=v3 to override the v2 default for that router, recreate just that service with docker compose up -d app, and test it before moving on. If one service has a rule you cannot rewrite yet, give that single router the escape hatch label traefik.http.routers.app.ruleSyntax=v2 and keep moving.
Step 6: turn compatibility mode off. When every rule is v3 syntax, delete defaultRuleSyntax and any ruleSyntax labels, restart Traefik, and confirm every router still shows green in the dashboard. Do not settle in with compatibility mode on: Traefik deprecated both options in v3.4 and removes them in the next major version, so they are a bridge, not a destination.
Before and after: one service's labels
Here is one app carrying every famous change at once: a multi-value Host, a PathPrefix placeholder, and an ipWhiteList middleware. The v2 block:
app:
image: app:1.4
restart: unless-stopped
networks:
- proxy
labels:
- traefik.enable=true
- traefik.http.routers.app.rule=Host(`app.example.com`,`www.example.com`) && PathPrefix(`/api/{version:v[0-9]+}`)
- traefik.http.routers.app.entrypoints=websecure
- traefik.http.routers.app.tls.certresolver=le
- traefik.http.routers.app.middlewares=office
- traefik.http.middlewares.office.ipwhitelist.sourcerange=10.0.0.0/24
- traefik.http.services.app.loadbalancer.server.port=8080And the same service migrated to v3:
app:
image: app:1.4
restart: unless-stopped
networks:
- proxy
labels:
- traefik.enable=true
- traefik.http.routers.app.rule=(Host(`app.example.com`) || Host(`www.example.com`)) && PathRegexp(`^/api/v[0-9]+`)
- traefik.http.routers.app.ruleSyntax=v3
- traefik.http.routers.app.entrypoints=websecure
- traefik.http.routers.app.tls.certresolver=le
- traefik.http.routers.app.middlewares=office
- traefik.http.middlewares.office.ipallowlist.sourcerange=10.0.0.0/24
- traefik.http.services.app.loadbalancer.server.port=8080Two labels changed and one was added. The rule split its multi-value Host into two matchers joined by || and swapped the placeholder for PathRegexp, and the middleware label swapped ipwhitelist for ipallowlist. The added ruleSyntax=v3 label overrides compatibility mode until step 6. The entrypoint, the certificate resolver, the router-to-middleware wiring, and the service port did not move.
Test each service with the dashboard
After every flip, open the dashboard's HTTP routers page. Every router should be green. A router with an error badge names its exact problem, which is usually a middleware that does not exist under its new name or a rule v3 cannot parse. Then confirm from outside, one hostname at a time:
curl -sI https://app.example.com/api/v1/statusA 200 or your app's normal redirect means routing and TLS both survived. A 404 from Traefik alone does not establish that no router matched: IPAllowList can reject a matched request with rejectStatusCode: 404. Check the dashboard for router errors, then check the hostname, path, entrypoint, TLS configuration, and middleware settings even if the router is green. Keep docker compose logs -f traefik open in a second terminal while you work, because every parsing failure lands there the moment a container restarts.
Rollback honesty
Keep the v2 compose file, its static configuration, and the acme.json backup until every service routes on v3 and has been exercised for real. Rolling back means checking out the pre-migration commit and running docker compose up -d, and it must be the whole file, not just the image tag, because v3-only syntax is wrong under v2 in exactly the way v2 syntax was wrong under v3: a PathRegexp matcher will not parse there. The renamed ipallowlist labels are fine on v2.11, but not on any older v2 release, which has never heard of the new name. If acme.json was lost or damaged along the way, restore the backup copy before starting v2 to avoid unnecessary certificate reissuance and the risk of hitting Let's Encrypt's limit for an exact set of identifiers.
FAQ
Do I have to rewrite every router rule for Traefik v3?
No. A plain Host(app.example.com) rule written with backticks is valid in both versions, and that covers most Compose setups. Rewriting is needed where a rule used v2-only features: regex or placeholders inside Path and PathPrefix, multi-value matchers, named regex groups inside HostRegexp, v2 Query arguments, or the removed Headers, HeadersRegexp, and HostHeader matchers.
What happened to ipWhiteList in Traefik v3?
It was renamed to ipAllowList, with the configuration inside unchanged, so a v2 label like traefik.http.middlewares.office.ipwhitelist.sourcerange=10.0.0.0/24 becomes the same line with ipallowlist in it. v2.11 already accepts the new name, so you can rename before you upgrade. Current v3 releases, v3.7 included, still accept the old name as a deprecated alias, so an unrenamed label keeps enforcing the allowlist with only a warning in the log. Treat that as borrowed time rather than a reason to skip the rename: deprecated names are the ones a release can drop, and a middleware name Traefik genuinely does not know fails loudly instead, with a router error and a 404. The dashboard shows the error, and a running Traefik instance returns 404 when no other router matches.
Can Traefik v3 still read v2 rule syntax?
Yes. Set core.defaultRuleSyntax: v2 in the static configuration to keep v2 syntax as the default while you migrate, and use the per-router ruleSyntax=v2 label for individual stragglers after you switch the default back. Treat both as temporary: Traefik deprecated them in v3.4 and removes them in the next major version.
Will my Let's Encrypt certificates survive the upgrade?
Yes. Traefik v3 keeps reading the acme.json file that v2 wrote, so certificates are not re-issued just because the binary changed. Copy the file somewhere safe before you begin anyway, because a rollback or a deleted volume that loses acme.json can trigger certificate reissuance. Let's Encrypt allows up to five certificates for the exact same set of identifiers every seven days; whether reissuance hits that limit depends on prior issuance for each set.
Why does Traefik v3 fail to start after the upgrade?
Almost always because the static configuration still contains an option v3 removed, and Traefik refuses to start on options it does not recognise. For the well-known leftovers (pilot, providers.docker.swarmMode, experimental.http3, and the providers' tls.caOptional) the log names the culprit and then says incompatible deprecated install configuration option found (incompatible deprecated static option found through v3.5.4, with the newer wording starting in v3.5.5); for anything v3 has never heard of, such as a typo, it says field not found with the node. Delete or replace each one, then start the container again.