Skip to content

Unable to self-host Supabase storage without granting Postgres DB privilege #836

@mintydev789

Description

@mintydev789

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Self-hosting Supabase storage didn't work for me straightaway, seemingly because of a missing Postgres permission on the database for the supabase_storage_admin user.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Try to start the Supabase self-hosted Docker Compose setup.
  2. Check the logs of the supabase-storage container. It should display this error: permission denied for database <NAME>.
  3. Run this command in the Postgres DB: GRANT CREATE ON DATABASE :"db_name" TO supabase_storage_admin;
  4. Restart the containers (preferably after running the reset script), and the error should be gone.

I have my own repo with the Supabase setup here (though I disabled PostgREST, Realtime and Auth). Also, I'm assuming that there wasn't a Supabase update in the last 2-3 months that resolves this issue anyways. The only container I explicitly updated to the latest version is the storage container.

Expected behavior

The storage container should be able to run without the CREATE privilege on the database, as that violates the principle of least privilege.

System information

  • OS: Linux
  • Version of Node.js: v24.11.1

Additional context

As a side note, I don't think the storage container should depend on the REST container. I just commented out the dependency and it ran just fine, so I don't get why it's set up that way to begin with. I think it should be easy for developers to pick which services they want to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions