https://github.com/ddev/ddev-minio
MinIO addon for DDEV
https://github.com/ddev/ddev-minio
ddev ddev-get minio
Last synced: about 1 year ago
JSON representation
MinIO addon for DDEV
- Host: GitHub
- URL: https://github.com/ddev/ddev-minio
- Owner: ddev
- License: apache-2.0
- Created: 2023-08-13T16:43:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T19:58:00.000Z (about 1 year ago)
- Last Synced: 2025-04-10T20:43:03.532Z (about 1 year ago)
- Topics: ddev, ddev-get, minio
- Language: Shell
- Homepage:
- Size: 677 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ddev-minio - use MinIO object storage in DDEV

[](https://github.com/ddev/ddev-minio/actions/workflows/cron_tests.yml)
[](https://github.com/semantic-release/semantic-release)

This repository provides MinIO add-on to [DDEV](https://ddev.readthedocs.io).
It's based on [MinIO official image](https://hub.docker.com/r/minio/minio) and [DDEV custom compose files](https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/)
## Installation
For DDEV v1.23.5 or above run
```bash
ddev add-on get ddev/ddev-minio
```
For earlier versions of DDEV run
```bash
ddev get ddev/ddev-minio
```
Then restart the project
```bash
ddev restart
```
## Configuration
### MinIO console
Login to MinIO console `https://.ddev.site:9090` login with credentials `ddevminio:ddevminio` and create a bucket.
### File access
Project docker instances can access MinIO api via `http://minio:10101`
DDEV Router is configured to proxy the requests to `https://.ddev.site:10101` to MinIO S3 Api.
Example URLs for accessing files are
| Bucket | File path | Internal URL | External URL |
|----------|------------------------|--------------------------------------------------|-----------------------------------------------------------------|
| `photos` | `vacation/seaside.jpg` | `http://minio:10101/photos/vacation/seaside.jpg` | `https://.ddev.site:10101/photos/vacation/seaside.jpg` |
| `music` | `tron/derezzed.mp3` | `http://minio:10101/music/tron/derezzed.mp3` | `https://.ddev.site:10101/music/tron/derezzed.mp3` |
## Connecting from PHP
### Installation
Since MinIO is S3 compatible you can use [AWS PHP SDK](https://packagist.org/packages/aws/aws-sdk-php). Install it with composer:
```bash
ddev composer require aws/aws-sdk-php
```
### Basic usage
```php
'http://minio:10101',
'credentials' => [
'key' => 'ddevminio',
'secret' => 'ddevminio',
],
'region' => 'us-east-1',
'version' => 'latest',
'use_path_style_endpoint' => true,
]);
$bucketName = 'ddev-minio';
if (!$s3->doesBucketExist($bucketName)) {
$s3->createBucket([
'Bucket' => $bucketName,
]);
}
$s3->putObject([
'Bucket' => $bucketName,
'Key' => 'ddev-test',
'Body' => 'DDEV Minio is working!',
]);
$object = $s3->getObject([
'Bucket' => $bucketName,
'Key' => 'ddev-test',
]);
echo $object['Body'];
```
## Commands
Addon exposes the following commands
| Command | Usage | Description |
|---------|--------------|---------------------------------|
| `minio` | `ddev minio` | Launches the MinIO Console |
| `mc` | `ddev mc` | Launches the MinIo admin client |
___
**Based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/mongodb)**
**Developed and maintained by [Oblak Studio](https://github.com/oblakstudio)**