Using Minio to work with S3 buckets locally

Using Minio to work with S3 buckets locally

Install and configure Minio

Minio is an open-source object storage server with an Amazon S3 compatible API. If you’re using Homestead as your working environment, you’re super lucky; Minio is pretty easy to install, barely an inconvenience. Follow the instructions on the Laravel docs above, and you should be ready for the next step.

Refactor the uploading code

Minio will allow you to work with the same ‘interface’ as S3 when uploading files. You only need to apply different configuration values to your environments. This is the Laravel way. This is the way xD. With that said, our code now looks like this.

Two little gotchas

You might run into some issues on the first try. From the docs, you should be able to access Minio on http://localhost:9600. If that doesn't work, try http://192.168.10.10::9600, and also change the .env to AWS_ENDPOINT=http://192.168.10.10:9600.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Geni Jaho

Geni Jaho

Full-stack web developer with a passion for software architecture and programming best practices.