Storage Quickstart
This guide shows the basic functionality of Supabase Storage. Find a full example application on GitHub or deploy it with Vercel for a preview.
note
File, Folder, and Bucket names must follow AWS object key naming guidelines and avoid use of any other characters.
Create a bucket#
You can create a bucket using the Supabase Dashboard. Since the storage is interoperable with your Postgres database, you can also use SQL or our client libraries. Here we create a bucket called "avatars":
- Go to the Storage page in the Dashboard.
- Click New Bucket and enter a name for the bucket.
- Click Create Bucket.
Upload a file#
You can upload a file from the Dashboard, or within a browser using our JS libraries.
- Go to the Storage page in the Dashboard.
- Select the bucket you want to upload the file to.
- Click Upload File.
- Select the file you want to upload.
Download a file#
You can download a file from the Dashboard, or within a browser using our JS libraries.
- Go to the Storage page in the Dashboard.
- Select the bucket that contains the file.
- Select the file that you want to download.
- Click Download.
Add security rules#
To restrict access to your files you can use either the Dashboard or SQL.
- Go to the Storage page in the Dashboard.
- Click Policies in the sidebar.
- Click Add Policies in the
OBJECTS
table to add policies for Files. You can also create policies for Buckets. - Choose whether you want the policy to apply to downloads (SELECT), uploads (INSERT), updates (UPDATE), or deletes (DELETE).
- Give your policy a unique name.
- Write the policy using SQL.
See also#
- Supabase Storage on GitHub
- Swagger API documentation
- Official JavaScript and Dart documentation