Skip to main content
Supabase Storage provides a simple interface to store and serve large files. Built on top of PostgreSQL, it leverages Row Level Security for access control.

Features

Supabase Storage offers powerful file management capabilities:
  • Unlimited Storage: Store any number of files of any size
  • CDN Integration: Files are automatically cached for fast delivery
  • Image Transformations: Resize, crop, and optimize images on-the-fly
  • Resumable Uploads: Upload large files with automatic retry
  • Access Control: Secure files with Row Level Security policies
  • Public and Private Buckets: Control file visibility
  • S3 Compatible: Use S3-compatible tools and libraries

Core Concepts

Buckets

Buckets are containers for organizing files, similar to folders:

Objects

Objects are the individual files stored in buckets:

Public vs Private Buckets

  • Public Buckets: Files are accessible via public URLs without authentication
  • Private Buckets: Files require authentication and RLS policies

Quick Start

Create a Bucket

  1. Go to Storage in your Supabase dashboard
  2. Click “New bucket”
  3. Enter a name and configure settings
  4. Click “Create bucket”

Upload a File

Get Public URL

Download a File

Storage API

File Organization

Organize files using folder structures:

File Metadata

Set custom metadata on uploads:

Storage Limits

Configure limits per bucket:
  • File Size Limit: Maximum size per file
  • Allowed MIME Types: Restrict file types
  • Total Bucket Size: Maximum total storage

Security

RLS Policies for Storage

Control access to files using PostgreSQL policies:

Signed URLs

Generate temporary URLs for private files:

Use Cases

User Avatars

Store and serve user profile pictures with public access

Document Storage

Store private documents with user-specific access control

Media Library

Build a media library with image transformations

File Sharing

Share files via temporary signed URLs

Best Practices

Prevent overwrites by using UUIDs or timestamps in filenames:
Configure appropriate cache control for better performance:
Always validate file types on both client and server:
Use folder structures to organize files logically:

Monitoring

Track storage usage in your dashboard:
  • Total storage used
  • Files per bucket
  • Bandwidth consumption
  • API requests

Next Steps

Upload Files

Learn about different upload methods

Download Files

Retrieve and serve files

Image Transformations

Resize and optimize images

Access Control

Secure files with RLS policies