Problem
When multiple DDEV projects run in a single freeform workspace, DDEV add-on services that use shared Traefik entrypoint ports conflict with each other. The last project to run ddev coder-routes (the post-start hook) wins, and the other projects' routing for that service is overwritten.
How DDEV port routing works
DDEV's ddev-router uses name-based (Host header) routing internally. All projects share the same Traefik entrypoint ports (e.g. port 8143 for xhgui). Routing to the correct project depends on the Host header matching the DDEV-internal hostname (e.g. p4.ddev.site).
In the Coder context, coder-routes writes Traefik rules that map Coder subdomain proxy URLs to DDEV services. For known services, it emits Host() rules with per-project slugs. For unknown add-ons, it emits PathPrefix('/') rules — but two projects sharing the same entrypoint port with the same PathPrefix('/') rule is undefined behavior (last writer wins).
Known services already fixed
The following services are handled with per-project Host() slugs and have matching coder_app resources in the template:
web (primary) → slug {project}
mailpit → slug mailpit-{project}
xhgui → slug xhgui-{project}
adminer (when enabled) → slug adminer-{project}
Still broken
Any user-installed DDEV add-on (e.g. ddev get ddev/ddev-selenium, ddev get ddev/ddev-redis-commander, custom services) that exposes a port will:
- Get a
PathPrefix('/') Traefik rule from coder-routes
- Share that Traefik entrypoint port with any other project that has the same add-on
- Have its routing silently overwritten when another project starts
Possible approaches
-
Extend the known-service list in coder-routes: For each popular add-on, detect the service name and emit a per-project Host() slug. Requires a corresponding coder_app in the template.
-
Dynamic coder_app registration: Explore whether Coder supports dynamically registering apps after workspace creation (it currently does not — coder_app resources are static Terraform).
-
Document as a limitation: Single-project workspaces are not affected. Users needing add-ons beyond the known set should use one project per workspace.
Workaround
Use one DDEV project per workspace if you need add-ons beyond xhgui, mailpit, and adminer.
Problem
When multiple DDEV projects run in a single freeform workspace, DDEV add-on services that use shared Traefik entrypoint ports conflict with each other. The last project to run
ddev coder-routes(the post-start hook) wins, and the other projects' routing for that service is overwritten.How DDEV port routing works
DDEV's ddev-router uses name-based (Host header) routing internally. All projects share the same Traefik entrypoint ports (e.g. port 8143 for xhgui). Routing to the correct project depends on the
Hostheader matching the DDEV-internal hostname (e.g.p4.ddev.site).In the Coder context,
coder-routeswrites Traefik rules that map Coder subdomain proxy URLs to DDEV services. For known services, it emitsHost()rules with per-project slugs. For unknown add-ons, it emitsPathPrefix('/')rules — but two projects sharing the same entrypoint port with the samePathPrefix('/')rule is undefined behavior (last writer wins).Known services already fixed
The following services are handled with per-project
Host()slugs and have matchingcoder_appresources in the template:web(primary) → slug{project}mailpit→ slugmailpit-{project}xhgui→ slugxhgui-{project}adminer(when enabled) → slugadminer-{project}Still broken
Any user-installed DDEV add-on (e.g.
ddev get ddev/ddev-selenium,ddev get ddev/ddev-redis-commander, custom services) that exposes a port will:PathPrefix('/')Traefik rule fromcoder-routesPossible approaches
Extend the known-service list in
coder-routes: For each popular add-on, detect the service name and emit a per-projectHost()slug. Requires a correspondingcoder_appin the template.Dynamic
coder_appregistration: Explore whether Coder supports dynamically registering apps after workspace creation (it currently does not —coder_appresources are static Terraform).Document as a limitation: Single-project workspaces are not affected. Users needing add-ons beyond the known set should use one project per workspace.
Workaround
Use one DDEV project per workspace if you need add-ons beyond xhgui, mailpit, and adminer.