Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix file uploads fail on self-hosted Supabase: set API_EXTERNAL_URL and SUPABASE_PUBLIC_URL. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. File uploads fail on self-hosted Supabase: set APIEXTERNALURL and SUPABASEPUBLICURL
  2. 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.

  1. 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.

When to use

You are seeing this: Storage buckets exist and the dashboard works, but uploads from the client never land. Use this skill when you run into "File uploads fail on self-hosted Supabase: set APIEXTERNALURL and SUPABASEPUBLICURL".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>

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