Skip to main content
Directus provides a powerful file storage abstraction that works with local filesystems and cloud storage providers, offering features like on-the-fly image transformations, chunked uploads, and comprehensive metadata management.

Storage Architecture

Directus uses a driver-based storage system that abstracts file operations across different storage backends.

Storage Manager

The StorageManager class coordinates storage drivers and locations:

Supported Storage Drivers

Directus supports multiple storage backends out of the box:

Local Storage

Store files on the server filesystem:

Amazon S3

Store files in AWS S3 or S3-compatible services:

Google Cloud Storage

Integrate with GCS:

Azure Blob Storage

Use Microsoft Azure:

Cloudinary

Leverage Cloudinary’s media management:

Supabase Storage

Driver Operations

All storage drivers implement a consistent interface:

Reading Files

Writing Files

File Operations

Chunked Uploads (TUS Protocol)

Directus supports resumable uploads via the TUS protocol for large files:

File Upload API

Upload files via the REST API:

Multipart Upload

Image Transformations

Transform images on-the-fly using query parameters:

Transformation Options

  • width / height - Resize dimensions
  • fit - Resize mode (cover, contain, inside, outside)
  • quality - JPEG/WebP quality (1-100)
  • format - Output format (jpg, png, webp, tiff, avif)
  • transforms - JSON array of transformations

Advanced Transformations

Encode as URL parameter:

File Metadata

Files in Directus include comprehensive metadata:

Folder Organization

Organize files using folders:

Multiple Storage Locations

Configure multiple storage locations for different use cases:
Specify storage location when uploading:

Security

Access Control

Control file access with permissions:

Download Tokens

Generate temporary download links:

Best Practices

Place a CDN in front of your /assets endpoint for better performance and reduced server load.
Create a logical folder structure (e.g., by year, category, or project) to keep assets organized.
Use local storage for development, cloud storage for production, and specialized services like Cloudinary for optimized delivery.
Configure FILES_MAX_UPLOAD_SIZE based on your storage capacity and use TUS for large files.