Select Page

Laravel S3 upload with Sail and Minio

July 27, 2021

Are you planning to use S3 as your file storage but want to test it first in your local machine avoiding the hassle of AWS setup?

Enter Minio (min.io, MinIO, whatever). Basically, Minio is a storage that works like S3 and you can use S3 Adapters to use it on your local machine. If you decided to push through production you just have to replace your credentials.

This tutorials assumed that you already installed Sail in your project. If not, read more about it here.

 

Update docker-compose.yml

Add minio service:

Add named volume:

Update .env

Finally, run

 

./vendor/bin/sail build --no-cache
./vendor/bin/sail up -d --force-recreate

You can view the Minio console, a web app where you can see your uploaded files using by checking the logs in the container like so:

 

docker-compose logs -f minio

And just like that, you can now use Minio to mimic S3 behavior. In fact, you can just use Minio as your dedicated file storage, but make sure you understand its documentation first.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *