🇬🇧MinIO as a Cloud Option for Portfolio Projects and How to Use It Locally
🇧🇷–para ler este artigo em português clique aqui
Recently, I updated my portfolio with new projects and realized the need to store and organize files in the cloud across different buckets. To avoid deleting my files and incurring costs associated with paid services, I sought an alternative and found MinIO. I believe it could be an interesting option for integrating into your portfolio projects as well.
MinIO is an open-source object storage platform, highly compatible with the Amazon S3 API. It provides a fast and scalable storage solution, ideal for a variety of applications and projects. While MinIO can be run in distributed environments and the cloud, it is also possible to configure and use it locally. In this guide, we will cover how to install, configure, and use MinIO in a local environment.
Advantages of MinIO
- S3 Compatibility: MinIO is fully compatible with the Amazon S3 API, making it easy to integrate with tools and applications that already use this standard.
- Performance and Scalability: MinIO is designed to be fast and scalable, capable of supporting large data volumes and high transaction rates.
- Simplicity and Ease of Use: Installing and configuring MinIO is straightforward, making it an attractive solution for developers and teams needing a hassle-free storage solution.
- Open Source: As an open-source solution, MinIO offers flexibility for customization and integration with other tools without licensing costs.
- Security: MinIO provides encryption in transit and at rest, ensuring your data is protected from unauthorized access.
How to Use MinIO Locally
Documentation: MinIO Documentation
1. Installation
To start using MinIO locally, you need to install it. MinIO can be run in different environments, including Docker containers. Here’s a basic guide to install and start MinIO locally:
With Docker:
docker run -p 9000:9000 --name minio \
-e MINIO_ACCESS_KEY=YOURACCESSKEY \
-e MINIO_SECRET_KEY=YOURSECRETKEY \
minio/minio server /data
Replace YOURACCESSKEY
and YOURSECRETKEY
with your chosen access and secret keys.
Without Docker:
- Download the MinIO binary for your operating system here.
- Grant execution permission to the binary:
chmod +x minio
- Run MinIO with the command:
./minio server /data
MinIO will start and be available at http://localhost:9000.
2. Configuration
After installation, you can access MinIO’s web interface through your browser at http://localhost:9000. Use the access keys you defined during installation to log in. From the web interface, you can manage your buckets and objects.
3. Integration with Projects
To integrate MinIO with your projects, you can use the MinIO SDK or libraries compatible with the S3 API. Here’s an example of how to use MinIO in a Python project:
from minio import Minio
client = Minio(
"localhost:9000",
access_key="YOURACCESSKEY",
secret_key="YOURSECRETKEY",
secure=False
)
#create a bucket
client.make_bucket("my-bucket")
#upload a file
client.fput_object("my-bucket", "my-object", "path/to/file")
#list objects in the bucket
for obj in client.list_objects("my-bucket"):
print(obj.object_name)
Using MinIO locally is an effective way to manage and store data. With a simple installation and quick setup, you can integrate MinIO into your local projects and take advantage of its features. Whether using Docker or installing directly, MinIO provides a solution for storing objects and managing data in your projects.