Storage
Configure file storage with S3 or local filesystem.
NextSaas includes a file storage system that supports S3-compatible providers (AWS S3, Cloudflare R2, MinIO, etc.) and local filesystem storage for development.
Setup
S3 Storage (Recommended for Production)
- Set up an S3-compatible storage service (e.g., Cloudflare R2, AWS S3).
- Create two buckets — one for public files and one for private files.
- Configure your
.env:
STORAGE_PROVIDER="s3"
S3_ENDPOINT="https://your-endpoint.com"
S3_REGION="auto"
S3_ACCESS_KEY_ID="your-access-key"
S3_SECRET_ACCESS_KEY="your-secret-key"
S3_PUBLIC_BUCKET="your-public-bucket"
S3_PRIVATE_BUCKET="your-private-bucket"
S3_PUBLIC_URL="https://your-cdn-url.com" # Optional: CDN URL for public filesLocal Storage (Development)
For quick development without setting up S3, use local filesystem storage:
STORAGE_PROVIDER="local"Local storage saves files under the project directory and serves them via the local dev server.
Buckets
NextSaas uses two storage buckets:
| Bucket | Use Case | Access |
|---|---|---|
public | User avatars, public assets | Direct URL access |
private | User documents, sensitive files | Presigned URLs with expiration |
Features
Avatar Upload
NextSaas comes with a built-in avatar upload workflow:
- Image Cropping: Users can crop images before upload using a drag-and-drop interface
- Automatic Resizing: Images are processed client-side before upload
- Public Storage: Avatars are stored in the public bucket for direct access
The avatar upload UI is integrated into the user profile section in the dashboard settings.
[!TIP] If you don't need file storage, you can leave the storage env vars unconfigured. The feature will be automatically disabled, and the related UI elements will be hidden.