Repository navigation
Description
Describe the bug
When starting Supabase with npx supabase start, custom Auth email templates configured via auth.email.template.* sometimes fall back to the built-in default templates.
This happens if Auth (GoTrue) starts before Kong’s template endpoint (:8088) is ready. Auth logs connection errors, loads default templates, and continues using them even after Kong becomes healthy. Custom templates are only applied after manually restarting the Auth container.
To Reproduce
- Configure custom email templates using
auth.email.template.*withcontent_pathinsupabase/config.toml - Run
npx supabase start - Trigger a signup confirmation email
- Observe that the default Supabase confirmation email is sent
- Restart the Auth container:
docker restart supabase_auth_<project> - Trigger the signup email again
- Observe that the custom email template is now used
Expected behavior
Auth should:
- Retry loading email templates once Kong becomes available, or
- Wait for Kong’s template endpoint to be reachable before initializing templates, or
- Reload templates dynamically instead of caching fallback defaults permanently
Custom email templates should be applied consistently after startup.
Screenshots
Not applicable. Issue reproduced via logs and Mailpit HTML email inspection.
System information
-
Ticket ID: not available (issue occurs during startup, not a CLI command failure)
-
Version of OS: Linux
-
Version of CLI:
2.70.5 -
Version of Docker: Docker Engine 25.x
-
Versions of services: output of
npx supabase serviceskong, auth, db, rest, realtime, storage, studio, inbucket, analytics, edge-runtime
Additional context
Relevant Auth startup logs:
{"error":"templatemailer: template type \"confirmation\": Get \"http://supabase_kong_<project>:8088/email/confirmation.html\": dial tcp 172.18.0.5:8088: connect: connection refused","event":"templatemailer_template_body_http_error","level":"error","mail_type":"confirmation","time":"2025-12-29T00:26:28Z"}
Later in the same run:
supabase_kong_<project>is healthywget http://supabase_kong_<project>:8088/email/confirmation.htmlworks from inside both Kong and Auth containers- Emails are still sent using default templates
Workaround
docker restart supabase_auth_<project>
Activity
singh-inder commentedon Dec 29, 2025
Its happening with
gotrue:v2.184.0. I guess because of this change where templates cache is being loaded at startup supabase/auth#2261 and kong is not ready to serve requests at that point. As a temporary workaround, you can drop tov2.183.0.Then run the start command and it should use that version.
aantti commentedon Dec 30, 2025
@sweatybridge @hf
Add OTP input component and custom email templates
shermju commentedon Jan 17, 2026
This issue is really starting to get annoying. I hope they're working on a fix.
YO-SC commentedon Sep 19, 2026
Hello y'all.
I was running into the same "custom template silently falls back to default" behavior, but on Fedora linux. The error in Auth logs were different:
bind mount was fine (double-checked with podman inspect), but the kong process in the container was just getting permission denied on the file. turns out everything under ~/ is tagged user_home_t by SELinux, and the policy doesn't let container_t processes read that.
After an hour or two doing some reserach the fix was the following (on the root of your project):
chcon -Rt container_share_t ./supabase/templates/ supabase stop && supabase startAs far as I know, this situation in particularonly affects Podman rootless on SELinux-enforcing distros (which Fedora is one of those apparently).
Hope this helps somebody, sharing is caring.