Skip to main content
Supabase Storage is a robust, scalable solution for managing files of any size. Built on industry-standard S3 protocol, it provides specialized bucket types for different use cases with fine-grained access controls and global CDN delivery.

Architecture

Supabase Storage consists of several components:
  • Storage API: RESTful API for file operations (built with Node.js)
  • PostgreSQL: Stores file metadata and access policies
  • S3-compatible backend: Actual file storage (supports AWS S3, Cloudflare R2, etc.)
  • Global CDN: Delivers files with low latency from 285+ cities worldwide
  • Image Transformation: On-the-fly image processing and optimization
Storage integrates with PostgreSQL Row Level Security, allowing you to use the same authorization logic as your database.

Bucket Types

Supabase Storage offers three specialized bucket types:

Files Buckets

Traditional object storage for images, videos, documents, and general-purpose content. Use cases: User avatars, media libraries, document storage, file uploads Features:
  • Global CDN delivery
  • Image optimization and transformation
  • Row-level security integration
  • Resumable uploads (TUS protocol)
  • S3-compatible API

Vector Buckets

Specialized storage for vector embeddings with similarity search capabilities. Use cases: AI-powered search, semantic similarity, RAG systems, embedding storage Features:
  • Optimized vector indexing (HNSW, Flat)
  • Multiple distance metrics (cosine, euclidean, L2)
  • Metadata filtering
  • Direct SQL queries via foreign tables

Analytics Buckets

Purpose-built for large-scale analytical workloads using Apache Iceberg. Use cases: Data lakes, analytics pipelines, time-series data, log storage Features:
  • Apache Iceberg table format
  • SQL-accessible via Postgres
  • Partitioned data organization
  • Cost-effective historical data storage

Working with Files

Creating Buckets

Create a bucket via the Dashboard or programmatically:
Or using SQL:

Uploading Files

Resumable Uploads

For large files, use resumable uploads (TUS protocol):

Downloading Files

Listing Files

Deleting Files

Image Transformation

Transform images on-the-fly using URL parameters:
Available transformations:
  • width: Resize width
  • height: Resize height
  • resize: Resize mode (cover, contain, fill)
  • quality: Image quality (1-100)
  • format: Output format (webp, jpeg, png, avif)
  • blur: Apply Gaussian blur (1-100)
  • sharpen: Sharpen image (1-100)

Access Control

Public vs Private Buckets

Storage Policies

Use Row Level Security to control file access:

Policy Helper Functions

S3 Compatibility

Access Storage using S3-compatible tools:
Or use S3 SDKs:

File Organization

Folder Structure

Naming Conventions

Performance Optimization

CDN Caching

Lazy Loading Images

Progressive Image Loading

Best Practices

Use RLS

Always protect buckets with Row Level Security policies.

Optimize Images

Use image transformations to serve optimized formats and sizes.

Set Size Limits

Configure appropriate file size limits for your buckets.

Organize Files

Use consistent folder structures and naming conventions.

Next Steps

Image Transformations

Learn about on-the-fly image processing

Access Control

Secure your files with RLS policies

CDN & Caching

Optimize file delivery with CDN

S3 Compatibility

Use S3-compatible tools and SDKs