MinIO
What is MinIO?
MinIO is an open-source, S3-compatible object storage server. Laradock runs it locally so you can develop against AWS_*-style filesystem code (Laravel's s3 disk, presigned URLs, multipart uploads) without touching a real AWS bucket.
Start MinIO
- Laradock CLI
- Docker Compose
./laradock start minio
docker compose up -d minio
Stop MinIO
Stopping just pauses the container; your data is safe:
- Laradock CLI
- Docker Compose
./laradock stop minio
docker compose stop minio
To delete the container entirely (the data on disk is still untouched, it lives under DATA_PATH_HOST):
- Laradock CLI
- Docker Compose
./laradock remove minio
docker compose rm -sf minio
Configuration
Settings live in minio/defaults.env and can be overridden in your own .env:
| Variable | Default | What it does |
|---|---|---|
MINIO_PORT | 9000 | Host port for the S3 API endpoint. |
MINIO_CONSOLE_PORT | 9001 | Host port for the MinIO web console. |
MINIO_ROOT_USER | laradock | Root access key (used as both username and S3 access key). |
MINIO_ROOT_PASSWORD | laradock | Root secret key (used as both password and S3 secret key). |
Data is stored under DATA_PATH_HOST/minio/data (buckets/objects) and DATA_PATH_HOST/minio/config (server config), both mounted as volumes so they survive container restarts.
Unlike MySQL's root credentials, MinIO's root user/password aren't a one-time first-boot setting: MinIO reads MINIO_ROOT_USER/MINIO_ROOT_PASSWORD from the environment on every startup, so changing them in .env and restarting takes effect immediately, even against existing data.
Open the console and create a bucket
Open http://localhost:9001 and log in with MINIO_ROOT_USER / MINIO_ROOT_PASSWORD (laradock / laradock by default). Create a bucket from the console UI, or from the MinIO client (mc) if you've installed it in the workspace container by setting WORKSPACE_INSTALL_MC=true in .env and rebuilding workspace:
- Laradock CLI
- Docker Compose
./laradock workspace
docker compose exec workspace bash
Then, inside the workspace shell:
mc alias set local http://minio:9000 laradock laradock
mc mb local/your-bucket
The S3 API itself is on port 9000 (MINIO_PORT), not 9001, if you're testing the API directly with curl or an S3 client.
Point a Laravel app at it
AWS_URL=http://minio:9000
AWS_ACCESS_KEY_ID=laradock
AWS_SECRET_ACCESS_KEY=laradock
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket
AWS_USE_PATH_STYLE_ENDPOINT=true
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'endpoint' => env('AWS_URL'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
AWS_USE_PATH_STYLE_ENDPOINT=true is required for local MinIO (it doesn't support virtual-hosted-style bucket addressing out of the box), don't carry it over to a real AWS S3 config.
Backup and restore
MinIO stores every bucket and object as plain files under DATA_PATH_HOST/minio/data, so the simplest reliable backup is a filesystem copy of that folder while the container is stopped:
- Laradock CLI
- Docker Compose
./laradock stop minio
docker compose stop minio
cp -r "${DATA_PATH_HOST:-~/.laradock/data}/minio/data" ~/minio-backup
Then start it again:
- Laradock CLI
- Docker Compose
./laradock start minio
docker compose up -d minio
Restore the same way, in reverse: stop MinIO, replace the contents of DATA_PATH_HOST/minio/data with your backup, then start it again.
Start completely fresh (wipe all data)
To throw away every bucket, object, and server config and start MinIO from a clean, empty state (⚠️ this permanently deletes everything, back up first if you need anything):
- Laradock CLI
- Docker Compose
./laradock stop minio
./laradock remove minio
rm -rf "${DATA_PATH_HOST:-~/.laradock/data}/minio"
./laradock start minio
docker compose stop minio
docker compose rm -sf minio
rm -rf "${DATA_PATH_HOST:-~/.laradock/data}/minio"
docker compose up -d minio
DATA_PATH_HOST is whatever you have set in .env (~/.laradock/data by default). Deleting the minio folder removes both data (buckets/objects) and config (server state), so the next start is a genuinely fresh MinIO instance with no buckets and only the root user from .env.
Talk to this bucket from another Laradock project
Each Laradock project is its own isolated Docker network by default, so a second project's containers can't reach this MinIO by container name out of the box. Easiest fix: publish the port (already done, MINIO_PORT) and have the other project connect to your host machine's address instead of minio, for example AWS_URL=http://host.docker.internal:9000 (Docker Desktop) using this project's MINIO_PORT. Make sure the two projects use different MINIO_PORT/MINIO_CONSOLE_PORT values if they're both running at once.
Common issues
- App can't connect but the container is running. Use
AWS_URL=http://minio:9000(the container name), notlocalhost, that only works from your host machine, not from inside another container likephp-fpmorworkspace. - "Access Denied" from the S3 API. Double-check
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYin your app's.envmatchMINIO_ROOT_USER/MINIO_ROOT_PASSWORDexactly. mc: command not foundin workspace. SetWORKSPACE_INSTALL_MC=truein.envand./laradock rebuild workspace, it isn't installed by default.- Console loads but shows no buckets you expect. Confirm you're browsing the same MinIO instance your app writes to, if you've reset
DATA_PATH_HOSTor run multiple Laradock projects, buckets don't carry over. - Port already in use on your host. Change
MINIO_PORTorMINIO_CONSOLE_PORTin.envand restart:./laradock restart minio.
Need image resizing on top of your object store? See Thumbor. New to Laradock? Start at Getting Started.