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
- Dashboard
- JavaScript
- SQL
- Go to Storage in your Supabase dashboard
- Click “New bucket”
- Enter a name and configure settings
- 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
Use Unique Filenames
Use Unique Filenames
Prevent overwrites by using UUIDs or timestamps in filenames:
Set Cache Headers
Set Cache Headers
Configure appropriate cache control for better performance:
Validate File Types
Validate File Types
Always validate file types on both client and server:
Organize with Folders
Organize with Folders
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
