Simplify your Django deployment with MinIO
Want to make your Django projects easier? Discover how MinIO can streamline local S3 storage, enhancing your development and deployment process. Find out how to seamlessly integrate MinIO with Django and connect local and cloud environments for smoother, more reliable applications.

Simplify your Django deployment with MinIO
Want to make your Django projects easier? Discover how MinIO can streamline local S3 storage, enhancing your development and deployment process. Find out how to seamlessly integrate MinIO with Django and connect local and cloud environments for smoother, more reliable applications.
In this article, we’ll explore how MinIO simplifies replicating AWS S3 bucket functionality on your local machine – giving developers an easy, cost-free way to test file storage, uploads, and permissions before deploying to the cloud.
What is MinIO?
MinIO is an open-source object storage service that emulates the AWS S3 API, allowing developers to create multiple buckets, upload files, and manage them through a user-friendly dashboard.
By integrating MinIO into your local development environment, you can:
- Test S3 storage functionality without real AWS credentials.
- Simplify local-to-cloud transitions.
- Ensure consistent storage behavior across environments.
MinIO for Django development is ideal for teams that want a lightweight, local alternative to AWS S3. For a deeper understanding of MinIO, visit the official MinIO documentation.
Docker configuration for MinIO
To leverage MinIO in your local setup, you'll need to configure two additional containers in your docker-compose.yml file:
- MinIO – The main container that will simulate your S3 service.
- MinIO Client – The additional container that will create your buckets automatically.
Here's a sample setup:
volumes:
minio-data:
minio:
image: minio/minio:latest
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
minio-client:
image: minio/mc:latest
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host rm expo;
/usr/bin/mc config host add --quiet --api s3v4 local http://minio:9000 minio minio123;
/usr/bin/mc rb --force local/<your-bucket-name>/;
/usr/bin/mc mb --quiet local/<your-bucket-name>/;
/usr/bin/mc policy set public local/<your-bucket-name>;
"
depends_on:
- minio
This setup creates a single MinIO server running on port 9000 and automatically generates a bucket using the client. The configuration utilizes volumes to ensure data persistence. If you prefer to clear your bucket upon stopping the containers, simply remove the volume references from the minio container configuration.
Django configuration with MinIO
To integrate MinIO with Django, you'll need to set up custom storage classes and modify your settings file. This involves configuring Django custom storage classes to ensure cohesive interaction with MinIO.
Custom storage
The default S3Boto3Storage requires adjustments to work seamlessly with MinIO. Since we're using Docker, the MinIO container is accessible within the Docker network at minio:9000, but externally, it's available at localhost:9000. To handle this and ensure proper path handling for browsers, we'll create custom storage classes:
class StaticS3Boto3Storage(S3Boto3Storage):
location = settings.STATICFILES_LOCATION
def __init__(self, *args, **kwargs):
if settings.MINIO_ACCESS_URL:
self.secure_urls = False
self.custom_domain = settings.MINIO_ACCESS_URL
super(StaticS3Boto3Storage, self).__init__(*args, **kwargs)
class S3MediaStorage(S3Boto3Storage):
def __init__(self, *args, **kwargs):
if settings.MINIO_ACCESS_URL:
self.secure_urls = False
self.custom_domain = settings.MINIO_ACCESS_URL
super(S3MediaStorage, self).__init__(*args, **kwargs)
Django settings
In your Django settings.py file, configure the following to use S3 with MinIO:
STATIC_URL = "/static/"
STATICFILES_LOCATION = "static"
STATICFILES_STORAGE = "blogs.storage.StaticS3Boto3Storage"
MEDIA_URL = "/media/"
DEFAULT_FILE_STORAGE = "blogs.storage.S3MediaStorage"
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
AWS_S3_ENDPOINT_URL = os.getenv("AWS_S3_URL")
MINIO_ACCESS_URL = os.getenv("MINIO_ACCESS_URL")
And in your .env file:
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
AWS_STORAGE_BUCKET_NAME=<your-bucket-name>
AWS_S3_URL=http://minio:9000
MINIO_ACCESS_URL=localhost:9000/<your-bucket-name>
Ready to connect backend skills with modern infrastructure? Check out Using CloudFront Functions to replace NGINX – a hands-on DevOps use case from our engineers.
How we use MinIO in Kellton Europe?
At Kellton Europe, we integrate MinIO in various parts of our software delivery process. Here’s how:
- Dedicated buckets for dynamic dev environments – perfect for isolated testing.
- Secure pre-deployment validation – ensuring bucket permissions and credentials are production-ready.
- CI/CD integration – enabling automated storage testing and S3 workflow validation.
This approach helps our clients achieve faster feedback cycles and safer deployments.
Summary
By incorporating MinIO into your local Django development environment, you can significantly simplify the process of testing and deploying applications that rely on S3 storage. This approach not only reduces the complexity of managing different configurations but also enhances the reliability of your deployments. The MinIO vs AWS S3 comparison often highlights MinIO's advantages in local development scenarios due to its open-source nature and ease of use.
For those interested in seeing this setup in action, see an example project available on GitHub. If you need professional assistance implementing MinIO, Django, or other web development solutions, our experienced development team at Kellton Europe is here to help.
FAQ
What is MinIO and why should I use it with Django?
MinIO is an open-source object storage service that emulates the AWS S3 API. Using MinIO with Django lets developers test file uploads, storage, and permissions locally — without relying on AWS. It’s fast, lightweight, and ideal for creating S3-compatible storage in local or staging environments before deployment.
How do I set up MinIO for local Django development?
You can install MinIO using Docker with a simple docker-compose.yml setup. Then, configure your Django project to use custom storage classes based on S3Boto3Storage. This allows your app to connect to http://localhost:9000 for local S3 emulation. Once configured, Django treats MinIO just like AWS S3 — but faster and free to use locally.
What are the main benefits of using MinIO instead of AWS S3 during development?
MinIO offers S3-compatible storage without cloud dependencies. It lets developers test locally, avoid AWS costs, and speed up development with quick bucket setup and cleanup — a lightweight S3 alternative for Django projects.
Can I use the same Django configuration for MinIO and AWS S3?
Yes — one of MinIO’s biggest advantages is API compatibility with AWS S3. Your Django storage configuration (using S3Boto3Storage) works for both, with just endpoint and credential changes in .env. This means you can develop locally with MinIO and deploy to S3 in production without changing your codebase.

Sebastian Spiegel
Backend Development Director
Inspired by our insights? Let's connect!
You've read what we can do. Now let's turn our expertise into your project's success!
