How to store images, videos, audio, documents, backups, and application files on your own infrastructure using MinIO, Docker, and S3 APIs.
Introduction
Modern applications generate and consume enormous amounts of data. From profile pictures and product images to videos, audio recordings, PDF documents, Excel reports, database backups, and AI datasets, developers need a reliable way to store and deliver files.
Cloud object storage services such as Amazon S3, Google Cloud Storage, and Azure Blob Storage provide scalable solutions. However, depending entirely on public cloud storage can introduce challenges involving recurring costs, data residency, infrastructure control, and vendor dependency.
What if you could build your own cloud storage platform that works similarly to Amazon S3 but runs on your own server?
That is where MinIO comes in.
MinIO is an S3-compatible object storage platform designed for high-performance workloads. It allows developers and organizations to manage object storage on their own infrastructure, including dedicated servers, virtual machines, and private cloud environments.
In this tutorial, we will explore how to create a self-hosted S3-compatible storage service using MinIO and integrate it into real-world applications.
1. What Is MinIO?
MinIO is an object storage system that exposes an API compatible with Amazon S3.
Unlike traditional file storage, which organizes data using directories and filesystem paths, object storage organizes data into buckets containing objects.
Each object typically includes:
The file content
A unique object key
Metadata
Content type
Additional attributes such as version information
For example, an application might store files using the following structure:
Here, my-cloud-storage represents a bucket, while images/users/user-1001.jpg is an object key.
The apparent folders are key prefixes rather than conventional filesystem directories.
Why is MinIO useful?
MinIO provides several important capabilities:
S3-compatible APIs for application integration.
Self-hosted storage with infrastructure control.
Support for images, videos, audio, documents, and binary files.
Access control using credentials and policies.
Presigned URLs for temporary access.
Object versioning and lifecycle management.
Erasure coding in supported distributed configurations.
Integration with backup, analytics, and AI workloads.
Important: MinIO is not automatically faster or cheaper than Amazon S3. Actual performance and cost depend on hardware, networking, storage architecture, operational requirements, and workload characteristics.
Also, MinIO's product editions, licensing, distribution, and management-console capabilities have evolved over time. Verify the current release and license before selecting it for a new commercial deployment.
2. MinIO vs Amazon S3 vs Traditional File Storage
Before building our storage platform, let's compare the available approaches.
Feature
MinIO
Amazon S3
Local Filesystem
Hosting
Self-hosted
AWS-managed
Your server
S3-compatible API
Yes
Native
No
Infrastructure control
High
Limited
High
Scalability
Depends on deployment
AWS-managed
Depends on design
File access
HTTP/S3 API
HTTP/S3 API
Filesystem or custom API
Storage billing
Hardware and operations
Usage-based
Hardware and operations
Built-in managed durability
Self-managed
AWS-managed
Not inherently
Application integration
S3 SDKs
S3 SDKs
Custom code
Operational maintenance
Your responsibility
Mostly AWS
Your responsibility
When should you choose MinIO?
MinIO can be a strong option when:
You operate your own dedicated servers.
You want to centralize file storage across multiple projects.
You need an S3-compatible backend for existing applications.
You have significant storage workloads.
You require control over where data is stored.
You want to build an internal storage platform.
Amazon S3 may be more suitable when you prefer fully managed infrastructure, global service integrations, and minimal storage administration.
3. Real-World Use Cases
Let's consider a software company operating several applications.
Project A: E-commerce Platform
Stores product images, category banners, invoices, and promotional videos.
Project B: Learning Management System
Stores recorded courses, lecture audio, student assignments, certificates, and PDF materials.
Instead of maintaining separate file storage systems, all four projects can use a centralized MinIO deployment.
Each project can have separate buckets, access credentials, and permissions.
Example:
text
storage.example.com
|
v
MinIO Server
|
├── ecommerce-media
├── learning-media
├── advertising-assets
├── blog-media
├── private-documents
└── database-backups
This simplifies storage administration and makes application migrations easier.
However, a single storage server also creates a shared failure domain. Production environments should include redundancy, backups, monitoring, and recovery planning.
4. Designing a Self-Hosted S3-Compatible Storage Architecture
A typical production-oriented architecture looks like this:
text
Internet
|
v
Cloudflare / DNS
|
v
NGINX Reverse Proxy
|
HTTPS / TLS
|
v
MinIO S3 API
|
+--------+--------+
| |
v v
Public Buckets Private Buckets
| |
v v
Images/Videos Documents/Backups
|
v
Applications
├── Django
├── FastAPI
├── Node.js
├── Laravel
└── Mobile Apps
Applications communicate with MinIO using S3-compatible SDKs.
For example:
text
Application:
https://app.example.com
S3 API Endpoint:
https://storage.example.com
Public Media URL:
https://media.example.com
Private Object:
s3://private-documents/invoices/invoice-1001.pdf
For public files, a CDN or caching reverse proxy can sit in front of the object storage API.
Private documents should remain inaccessible without authorization.
5. Hardware Requirements
You do not need an enterprise server to start experimenting with MinIO.
A small VPS or local machine is sufficient for development.
Example configurations
Resource
Development
Small Production
Larger Deployment
CPU
2 vCPU
4–8 cores
Workload-dependent
RAM
4 GB
8–16 GB
Workload-dependent
Storage
50–100 GB SSD
1–4 TB SSD/NVMe
Multiple dedicated drives
Network
100 Mbps
1 Gbps
10 Gbps+
Operating System
Ubuntu Linux
Ubuntu Linux
Linux
Deployment
Docker
Docker/systemd
Supported distributed architecture
These are illustrative planning configurations, not official minimum requirements.
For reliable production storage, prioritize:
Dedicated storage volumes
SSD or NVMe performance
Reliable network connectivity
Disk-health monitoring
Independent backups
Capacity planning
Redundant infrastructure where required
A single-server deployment is useful for development and smaller workloads, but it should not be confused with a highly available storage cluster.
6. Install MinIO Using Docker Compose
Let's build a working self-hosted object storage server.
For this example, assume:
text
Operating System: Ubuntu Server
Domain: storage.example.com
S3 API Port: 9000
Console Port: 9001
Storage Directory: /srv/minio/data
Step 1: Install Docker
On Ubuntu, install Docker Engine and the Compose plugin using Docker's official repository instructions.
Verify the installation:
text
docker --version
docker compose version
Step 2: Create directories
text
sudo mkdir -p /opt/minio
sudo mkdir -p /srv/minio/data
cd /opt/minio
Ensure the data directory is mounted on the intended persistent disk and has permissions appropriate for the container user.
Replace the image tag with a verified, supported release appropriate to your licensing and deployment requirements.
The health check assumes the selected image contains curl; otherwise use a supported probe or an external health monitor.
Binding ports to 127.0.0.1 prevents direct public access and allows NGINX to serve as the public HTTPS entry point.
Step 5: Start MinIO
text
docker compose up -d
Check the running container:
text
docker compose ps
View logs:
text
docker compose logs -f minio
Test the API:
text
curl http://127.0.0.1:9000/minio/health/live
A successful health response indicates the API process is responding, but it does not prove that the deployment is redundant or that backups are healthy.
Step 6: Configure the management interface
Depending on the selected MinIO release or edition, console capabilities and administrative workflows may differ.
Where the selected release includes a compatible browser-based console, you can access it through port 9001.
Otherwise, use supported administrative tooling such as the MinIO Client (mc) and the available management interfaces.
Do not expose administrative interfaces publicly without strong authentication and network restrictions.
7. Configure NGINX Reverse Proxy and HTTPS
Rather than exposing port 9000 directly, we can place NGINX in front of MinIO.
Then configure a valid TLS certificate using Let's Encrypt, Certbot, acme.sh, or your existing certificate management process.
Your final endpoint should be:
text
https://storage.example.com
Why is HTTPS important?
S3 authentication uses signed requests. Credentials, object contents, and metadata must be protected in transit.
HTTPS also protects uploaded documents and media against interception or modification.
For large files, verify proxy timeouts, upload-size limits, request streaming behavior, and multipart upload support.
If you use Cloudflare, review request-size limits, caching behavior, and upload architecture. Large uploads may need a direct-to-origin endpoint rather than a proxied request path.
The content type must match the value used when signing the request.
For browser uploads, configure bucket CORS rules to allow the required origins, methods, and headers.
For genuinely large videos, implement multipart uploads with resumability and retry handling.
Production systems should also validate uploaded objects after completion, enforce quotas, and scan untrusted uploads where appropriate.
15. Store Images, Videos, Audio, and Documents
MinIO is object storage, so it can store virtually any file format as an object.
File Type
Examples
Common Use
Images
JPG, PNG, WebP, AVIF
Websites, profiles, products
Videos
MP4, WebM
Courses, advertisements
Audio
MP3, WAV, AAC
Podcasts, voice recordings
Documents
PDF, DOCX, XLSX
Reports, invoices
Archives
ZIP, TAR, GZ
Backups
Data
JSON, CSV, Parquet
Analytics, datasets
AI Files
Models, datasets, checkpoints
AI/ML workloads
MinIO stores the bytes and metadata. It does not automatically resize images, transcode videos, generate thumbnails, or convert documents.
Those features require additional services.
For example:
text
User Upload
|
v
MinIO Raw Upload Bucket
|
v
Background Worker
|
├── Image Resizing
├── Video Transcoding
├── Thumbnail Generation
├── Antivirus Scanning
└── Metadata Extraction
|
v
MinIO Processed Media Bucket
|
v
CDN / Application
A background processing architecture using Celery, Redis, and FFmpeg can work well for Python-based applications.
16. Deliver Media Through a CDN
MinIO is responsible for object storage, but a high-traffic application also needs efficient content delivery.
Imagine an advertising platform serving millions of image requests.
If every request reaches the storage server, bandwidth usage and server load can increase significantly.
A CDN can cache frequently accessed public objects closer to users.
Example:
text
User Browser
|
v
CDN / Edge Cache
|
| Cache Miss
v
NGINX / Storage Gateway
|
v
MinIO Object Storage
For frequently changing content, use shorter cache lifetimes or versioned object keys.
Never cache confidential objects in a public CDN without a carefully designed access-control mechanism.
Also, avoid exposing S3 credentials or administrative APIs through the public media hostname.
17. MinIO Security Best Practices
Self-hosting gives you control over infrastructure, but also makes you responsible for securing it.
Use separate credentials
Create different service identities for each application.
For example:
text
blog-service
→ Access: blog-media only
advertising-service
→ Access: advertising-assets only
backup-service
→ Access: database-backups only
Apply least-privilege policies
An application that only reads images should not receive permission to delete objects or modify bucket policies.
Enable HTTPS
Encrypt all traffic between applications, clients, reverse proxies, and storage services.
Keep private buckets private
Never rely on difficult-to-guess object URLs as an authorization mechanism.
Enable versioning where appropriate
Versioning can help recover from accidental overwrites and deletions.
However, it also increases storage consumption.
Consider Object Lock
Supported Object Lock configurations can help prevent unauthorized or accidental object modification or deletion during a retention period.
Object Lock is not a complete ransomware defense. Protect credentials, infrastructure, and backup copies separately.
Maintain independent backups
Erasure coding, replication, and backups solve different problems.
Erasure coding protects against certain drive failures. Replication helps maintain additional copies. Backups support recovery from deletion, corruption, compromise, and other incidents.
A production system should have an independently recoverable backup strategy.
18. High Availability and Data Durability
A common misconception is that installing MinIO automatically creates highly available storage.
That is not true.
Consider a single-server installation:
text
Server A
|
└── MinIO
|
└── Single Storage Volume
If the server or storage volume fails, the application may lose access to its files.
For higher availability, use an appropriately supported distributed deployment with multiple failure domains.
Conceptually:
text
Load Balancer
|
+----------+----------+
| | |
Storage Storage Storage
Node A Node B Node C
| | |
Drives Drives Drives
This diagram illustrates the concept, not a supported MinIO deployment specification. Actual node counts, drive layouts, quorum requirements, and expansion rules depend on the chosen release and architecture.
For production planning, evaluate:
Node and disk failure tolerance
Storage quorum
Network redundancy
Rack and power failure domains
Backup and restore procedures
Monitoring and alerting
Disaster recovery objectives
High availability should be designed around measurable recovery time and recovery point objectives.
19. Monitoring a Self-Hosted Storage Service
Once multiple applications depend on the same object storage system, monitoring becomes essential.
Useful metrics include:
Storage Metrics
Total capacity
Used capacity
Available capacity
Disk utilization
Object count
Performance Metrics
Request rate
Read/write throughput
Upload and download latency
Error rates
Infrastructure Metrics
CPU usage
Memory usage
Network traffic
Disk I/O
Container and process health
Operational Metrics
Failed uploads
Authentication failures
Capacity warnings
Backup status
Certificate expiration
Depending on the deployed MinIO version, Prometheus-compatible metrics can be integrated into a monitoring platform.
A common monitoring stack is:
text
MinIO
|
v
Prometheus
|
v
Grafana
|
v
Alertmanager
|
├── Email Alerts
├── Slack Alerts
└── Telegram Alerts
Set capacity alerts well before disks are full. Object storage systems may require free capacity for normal operations, healing, and maintenance.
20. Build a Centralized Storage Service for Multiple Projects
Now let's go beyond a simple MinIO installation.
Suppose you want to create an internal storage platform that serves many independent applications.
Instead of giving every application unrestricted access to MinIO, build a storage management service.
Proposed architecture
text
Applications
|
+-------------+-------------+
| | |
Django Laravel Next.js
| | |
+-------------+-------------+
|
v
Storage API
(FastAPI)
|
+-------------+-------------+
| | |
Authentication Metadata Quota Control
| | |
+-------------+-------------+
|
v
MinIO S3
|
+----------+----------+
| | |
Media Documents Backups
Storage API responsibilities
A centralized service could provide:
Application registration and authentication.
Bucket provisioning and access-policy management.
File upload authorization.
Presigned URL generation.
File metadata tracking.
Storage quotas per project.
Usage statistics and billing reports.
Audit logs.
File retention and deletion policies.
Administrative dashboards.
Example API endpoints
text
POST /api/v1/files/upload-url
POST /api/v1/files/complete
GET /api/v1/files
GET /api/v1/files/{id}
GET /api/v1/files/{id}/download-url
DELETE /api/v1/files/{id}
GET /api/v1/buckets
POST /api/v1/buckets
GET /api/v1/usage
GET /api/v1/projects
A database such as PostgreSQL can store metadata about uploaded objects.
This makes it possible to build a storage dashboard similar in concept to cloud-provider storage management interfaces.
However, the metadata database and the object store must be kept consistent. Use idempotent upload-completion workflows, reconciliation jobs, and clear deletion semantics.
21. Can You Build a Commercial S3-Like Service with MinIO?
Technically, MinIO can serve as the object storage backend for a storage platform.
But a commercial S3-like service requires much more than installing MinIO.
You would also need:
Customer and tenant management
Tenant isolation
Access-key lifecycle management
Usage metering
Storage quotas
Billing and payment integration
Rate limiting
Abuse prevention
High availability
Disaster recovery
Customer support
SLA management
Security auditing
For example, a storage service could offer several plans:
Plan
Storage
Monthly Bandwidth
Developer
10 GB
50 GB
Startup
100 GB
500 GB
Business
1 TB
5 TB
Enterprise
Custom
Custom
These are illustrative product tiers, not MinIO pricing.
Before commercializing such a service, carefully review the current MinIO license, edition restrictions, support options, and obligations associated with network services and software distribution.
For a multi-tenant platform, avoid assuming that buckets alone provide complete security isolation. Design tenant identity, policies, quotas, logging, and administrative separation explicitly.
22. MinIO vs Ceph vs Garage
MinIO is not the only option for building self-hosted object storage.
Other technologies may be better suited to particular requirements.
Technology
Main Strength
Considerations
MinIO
S3-compatible object storage and performance-focused workloads
Verify current licensing, deployment support, and operational requirements
Ceph Object Gateway
Integration with a broader distributed storage platform
More complex operations and cluster management
Garage
Lightweight distributed S3-compatible storage
Different feature coverage and operational tradeoffs
MinIO may be attractive for a dedicated S3-compatible object store.
Ceph can be appropriate when an organization also needs distributed block and file storage.
Garage can be interesting for lightweight, geographically distributed deployments.
The best choice depends on reliability requirements, operational expertise, licensing, hardware, and supported S3 functionality.
23. Common Mistakes to Avoid
Even a technically correct installation can become unreliable if the architecture is poorly planned.
Mistake 1: Using root credentials in every application
Create dedicated application credentials with limited permissions.
Mistake 2: Making every bucket public
Only publish files that are explicitly intended for anonymous access.
Mistake 3: Treating one server as highly available
A single storage server remains a single point of failure.
Mistake 4: Using object storage as a relational database
Store file content in object storage and searchable application metadata in a suitable database.
Mistake 5: Sending all large uploads through the application backend
Use presigned uploads and multipart transfers where appropriate.
Mistake 6: Ignoring backup and recovery testing
Redundancy does not replace backups.
Mistake 7: Assuming all S3 APIs behave identically
MinIO implements S3-compatible functionality, but not necessarily every AWS S3 feature or behavior. Test the specific APIs your application needs.
Mistake 8: Ignoring egress bandwidth
Self-hosting removes some cloud storage charges but introduces infrastructure, bandwidth, electricity, support, and maintenance costs.
24. Recommended Production Architecture
For an organization running multiple web applications, advertising systems, and media services, the following architecture provides a useful starting point:
text
Internet Users
|
v
Cloudflare CDN
|
v
Media Domain
|
v
NGINX Gateway
|
v
MinIO Cluster
|
+---------------+---------------+
| | |
Public Media Private Files Backups
| | |
v v v
Images/Videos Documents Backup Data
Internal Applications
|
v
Storage API Service
|
+----------+----------+
| |
PostgreSQL Redis/Queue
(Metadata) (Background Jobs)
| |
+----------+----------+
|
v
MinIO S3 API
Suggested technology stack
Layer
Technology
Object Storage
MinIO
API Backend
FastAPI or Django REST Framework
Metadata Database
PostgreSQL
Cache/Queue
Redis
Reverse Proxy
NGINX
CDN
Cloudflare or another CDN
Monitoring
Prometheus and Grafana
Background Processing
Celery
Image Processing
Pillow or libvips
Video Processing
FFmpeg
Deployment
Docker or Kubernetes
TLS
Let's Encrypt
This architecture can be expanded gradually rather than implementing every component on day one.
Start with the storage API, private access policies, backup strategy, and monitoring. Add processing pipelines, CDN caching, and multi-node redundancy as demand grows.
25. Final Thoughts
MinIO makes it possible to build an S3-compatible object storage environment on infrastructure you control.
For developers working with Django, FastAPI, Node.js, Laravel, or other modern frameworks, its S3 compatibility can simplify file storage integration.
It can serve as the foundation for:
Media storage platforms
Document management systems
Learning management systems
Advertising asset storage
Backup repositories
AI and machine learning datasets
Private cloud storage services
However, self-hosting is not simply a matter of installing a storage server. Reliability, security, performance, licensing, monitoring, and backup procedures all need careful consideration.
The key takeaway: MinIO can provide the object storage layer of your own S3-like platform, while your application architecture determines whether that platform is secure, reliable, scalable, and practical to operate.
For developers and businesses seeking greater control over their storage infrastructure, S3-compatible self-hosted storage is an architecture worth understanding.
Frequently Asked Questions
Q1. Can I replace Amazon S3 with MinIO?
For applications using supported S3 APIs, often yes. You typically configure a custom endpoint and credentials, then test any provider-specific behavior.
Q2. Can MinIO store images, videos, MP3, PDF, Word, and Excel files?
Yes. Object storage can hold these formats and many others.
Q3. Can I use MinIO with Django and Laravel simultaneously?
Yes. Multiple applications can access the same storage deployment using separate credentials, policies, and buckets.
Q4. Can I use Cloudflare CDN with MinIO?
Yes. Public media can be delivered through an appropriately configured CDN or reverse proxy. Private APIs and large uploads require additional care.
Q5. Does MinIO automatically compress or resize images?
No. Use separate processing tools such as Pillow, libvips, or FFmpeg.
Q6. Is MinIO free for commercial use?
This depends on the selected version, distribution, and applicable license. Review the current licensing terms before deploying it commercially.
Q7. Can I build my own storage dashboard?
Yes. You can build a custom management dashboard using MinIO-compatible APIs, administrative tooling, and your own metadata and authorization services.
Q8. Can MinIO handle millions of files?
It can support large object workloads when appropriately designed and deployed. Actual scalability depends on hardware, object sizes, request patterns, and the supported deployment architecture.