Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

digpublisher's avatar

Laravel Docker and Minio setup issues

I am moving from Homestead to Docker and I have issues with setting up Minio. Created a new project with mysql and minio (didn't touch a thing) to produce docker-compose.yml:

version: '3' services: laravel.test: ... networks: - sail depends_on: - mysql - minio mysql: ... networks: - sail healthcheck: test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"] retries: 3 timeout: 5s minio: image: 'minio/minio:latest' ports: - '${FORWARD_MINIO_PORT:-9000}:9000' - '${FORWARD_MINIO_CONSOLE_PORT:-8900}:8900' environment: MINIO_ROOT_USER: 'sail' MINIO_ROOT_PASSWORD: 'password' volumes: - 'sail-minio:/data/minio' networks: - sail command: minio server /data/minio --console-address ":8900" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] retries: 3 timeout: 5s networks: sail: driver: bridge volumes: sail-mysql: driver: local sail-minio: driver: local EOF

sail up - all is well!

I setup 'minio' disk: installed s3 adapter (with dependencies): sail composer require league/flysystem-sftp-v3 "^3.0" -W

current composer.json: { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "type": "project", "require": { "php": "^8.0.2", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^9.2", "laravel/sanctum": "^2.14.1", "laravel/tinker": "^2.7", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-sftp-v3": "^3.0", }, "require-dev": { "fakerphp/faker": "^1.9.1", "laravel/sail": "^1.14", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^6.1", "phpunit/phpunit": "^9.5.10", }, ...

added to config/filesystem.php: . 'minio' => [ 'driver' => 's3', 'endpoint' => env('MINIO_ENDPOINT'), 'url' => env('MINIO_ENDPOINT'), 'use_path_style_endpoint' => true, 'key' => env('MINIO_KEY'), 'secret' => env('MINIO_SECRET'), 'region' => env('MINIO_REGION'), 'bucket' => env('MINIO_BUCKET'), ],

.env: . MINIO_ENDPOINT=http://127.0.0.1:9000 MINIO_KEY=sail MINIO_SECRET=password MINIO_REGION=local MINIO_BUCKET=my_bucket

Successfully logged into the minio web console, created a bucket, turned access to 'public' and access rules to 'readwrite', and added files - no issues! The laravel app can read files from the minio bucket but can't delete or upload. Of Course changing disk to 'local' and everything works fine. No exceptions - just a silent failure!

Please Help!

Next day. OK, just took a look at the docker log and at these lines: minio_1 Finished loading IAM sub-system minio_1 API: http://172.23.0.2:9000 http://127.0.0.1.9000 The dynamic address works! The localhost doesn't. How can I inquire minio about the dynamic entry point? or better, configure (in docker-compose.yml?) the localhost to work?

Thanks

0 likes
2 replies
arifhusaini97's avatar

Hi, have you found the solution for this problem? I am facing the same issue right now.

arifhusaini97's avatar

Never mind, I found the solution. The minio endpoint should be MINIO_ENDPOINT=minio:9000.

1 like

Please or to participate in this conversation.