Skip to main content

Setup MinIO as AWS S3 alternative in development with docker

Installation

  1. Make sure your local machine already have Docker installed.
  2. Run MinIO:
docker run \         
  -p 9000:9000 \
  -p 9001:9001 \
  --name minio-local \
  -v ${HOME}/projects/minio:/data1 \
  -e "MINIO_ROOT_USER=miniouser" \
  -e "MINIO_ROOT_PASSWORD=miniopass" \
  quay.io/minio/minio server /data1 --console-address ":9001"
  1. On your Laravel project, install the dependency
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
  1. Change the .env on your project
AWS_ACCESS_KEY_ID=miniouser
AWS_SECRET_ACCESS_KEY=miniopass
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=testing-saint
AWS_USE_PATH_STYLE_ENDPOINT=false
AWS_ENDPOINT="http://127.0.0.1:9000"

Further Reading

MinIO Documentation