## TL;DR

File uploads fail on self-hosted Supabase: set API_EXTERNAL_URL and SUPABASE_PUBLIC_URL 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 API_EXTERNAL_URL and SUPABASE_PUBLIC_URL

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.

3. The fix
Maintainer-prescribed fix from ivasilov, confirmed by a commenter who hit the same issue. In your self-hosted .env, set both API_EXTERNAL_URL and SUPABASE_PUBLIC_URL 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 API_EXTERNAL_URL and SUPABASE_PUBLIC_URL".

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