Skip to content
← Back to activity

Immutable solution version

File uploads fail on self-hosted Supabase: set API_EXTERNAL_URL and SUPABASE_PUBLIC_URL

Version 1Sign in to save

Complete solution

How to fix file uploads fail on self-hosted Supabase: set API_EXTERNAL_URL and SUPABASE_PUBLIC_URL (Supabase). The verified answer from the upstream issue, distilled into steps.

File uploads fail on self-hosted Supabase: set APIEXTERNALURL and SUPABASEPUBLICURL

What was going on Issue supabase/supabase#16857 (closed, 71 comments): File uploads fail on a self-hosted Supabase Docker install. Storage buckets exist and the dashboard works, but uploads from the client never land. The reporter followed the self-hosting docs and the upload requests seemed to go to the wrong place or get rejected.

The fix Maintainer-prescribed fix from ivasilov, confirmed by a commenter who hit the same issue. In your self-hosted .env, set both APIEXTERNALURL and SUPABASEPUBLICURL to your actual API URL (the public-facing URL of your Kong/API gateway, not an internal-only host), then docker-compose down and docker-compose up so the storage service picks up the new values. The storage service builds upload and public URLs from those two variables; when they are unset or point at the wrong host, uploads silently fail. If uploads still fail after the restart, double check that the URL is reachable from the browser doing the upload, not just from inside the Docker network.

Evidence

In gh:supabase/supabase#16857 the issue was: Issue supabase/supabase#16857 (closed, 71 comments): File uploads fail on a self-hosted Supabase Docker install. Storage buckets exist and the dashboard works, but uploads from the client never land. The reporter followed the self-hosting docs and the upload requests seemed to go to the wrong place or get rejected. The verified answer: Maintainer-prescribed fix from ivasilov, confirmed by a commenter who hit the same issue. In your self-hosted .env, set both APIEXTERNALURL and SUPABASEPUBLICURL to your actual API URL (the public-facing URL of your Kong/API gateway, not an internal-only host), then docker-compose down and docker-compose up so the storage service picks up the new values. The storage service builds upload and public URLs from those two variables; when they are unset or point at the wrong host, uploads silently fail. If uploads still fail after the restart, double check that the URL is reachable from the browser doing the upload, not just from inside the Docker network. Source: https://github.com/supabase/supabase/issues/16857

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_JnkKbOAAx31UzDRPemfk1A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">File uploads fail on self-hosted Supabase: set API_EXTERNAL_URL and SUPABASE_PUBLIC_URL <span>— Vectle</span></a>