A Drop-in Replacement for MinIO in Laravel Sail — shanesmith.io
Posts › A Drop-in Replacement for MinIO in Laravel Sail Share on /dev/null Share on Twitter/X

A Drop-in Replacement for MinIO in Laravel Sail

7 min read LaravelLaravel SailDockerCloudflareAWS

My local S3 container stopped building, immediately blocking my work.

Nothing in my code had changed, but the minio/minio image no longer resolved when I tried to build my Docker containers, so the local S3 bucket storage Laravel Sail had been relying on was gone!

If you use MinIO for local development, you may have hit the same thing. Here is what I did about it, what other developers suggested as an alternative to MinIO, and the swap I finally settled on.

Why this happened

MinIO's community edition GitHub repository now opens with a notice saying that it is no longer maintained, and points people to the company's AIStor products instead.

To make matters worse, Docker Hub now returns a 404 for the minio/minio repository, which is why minio/minio:latest in Sail's docker-compose.yml file stopped resolving entirely and my containers would no longer build.

As a result of this, many developers have moved onto other S3-compatible servers or community forks. Let's look at the options available to us, but first I'll explain my current setup.

My local environment

I use Laravel Sail locally, and Laravel Cloud with Cloudflare R2 buckets in production.

MinIO, Cloudflare R2 and Amazon S3 all use the same API, which is great because it means the only difference between environments is configuration.

The minio container existed just so I could test with bucket storage locally:

AWS_ACCESS_KEY_ID="sail"
AWS_SECRET_ACCESS_KEY="password"
AWS_DEFAULT_REGION="us-east-1"
AWS_BUCKET="local"
AWS_ENDPOINT="http://minio:9000"
AWS_USE_PATH_STYLE_ENDPOINT=true

Production uses the same variables pointed at Cloudflare R2, which is why replacing the local server should be painless.

What I asked the community

When I realised the MinIO image was gone, I asked what everyone else was doing about it on /dev/null:

My /dev/null commit asking what people are using instead of MinIO for a local S3-compatible data store, mentioning Garage, SeaweedFS and RustFS.

The replies were wide and varied, and between them they covered most of the realistic options. Let's consider those options now, and which one I ended up going with.

The alternatives to MinIO

RustFS

A /dev/null reply from @jonJKF saying RustFS is more or less a direct replacement, and that Floci simulates all of AWS.

RustFS looks like where the Laravel ecosystem is heading.

Laravel Sail itself now ships a rustfs stub in place of the old MinIO one, and the reply above says Lerd (a Podman-based local development tool for PHP) includes it by default.

Laravel Herd Pro also lists RustFS among the services you can add. If you are starting a new project, it is a strong choice.

The catch for an existing project is that it's a different server with its own configuration. Sail's stub uses RUSTFS_* variables, a separate console port and a different health check, so it is a bit more than a find and replace.

I wanted a drop-in replacement so I could get unblocked. I didn't want to waste time adjusting configuration, so I kept looking - with a mental note to return to RustFS if I came up empty.

Garage

A /dev/null reply from @sertxudev saying they use Garage with the Docker installation approach and have had no problems since installing it.

Garage came with a good first-hand endorsement by Sergio Peris and apparently works well in Docker.

Like RustFS, Garage requires that you rewrite your compose service to work with it, and spend time figuring out how to create an initial bucket and access key.

Because of this, I continued looking further a field.

LocalStack

A /dev/null reply from @as-rakot recommending LocalStack.

LocalStack was suggested by someone who had been through the same MinIO failure on a project.

Their one warning was that it has no dashboard for browsing the files stored within a bucket, so it is only useful during development.

While I only wanted it for local development, I've used the MinIO dashboard a few times and found it useful when I needed to check that files and folders were being created correctly.

I didn't want to throw away that advantage, so I kept looking for an option that included a dashboard.

Keep using what you have

Ricardo suggested forking MinIO and continuing to use it as it is. You can't get more drop-in replacement than continuing to use the exact same package!

A /dev/null reply from @ricardovfreixo saying anything that was once open source stays available at that version, so you can fork it or keep using it as is.

This is a fair point, and I agree with it in principle.

The problem in my case was practical: the image I was pulling no longer resolved at all. Pinning an old version or hosting my own fork would work, but then I'm maintaining a fork of a storage server for the sake of a local dev container, which is not where I want to spend my time.

What I decided to do

I went with Silo, an independent community fork of MinIO published as pgsty/silo. The deciding factor was that it keeps almost everything MinIO had.

Silo preserves S3 and storage-format compatibility, including the MINIO_* environment variables, the /minio/* routes (which is why the health check below still works) and existing .minio.sys data. The only things that are renamed are the binary and the container image.

Silo is also continuing to provide new builds, security fixes and the full web dashboard.

That means I didn't have to rework my local setup. It is a drop-in replacement for exactly the thing I needed it for, and I could move on with my day.

RustFS may well be the better long-term choice for a new Laravel Sail project, but I selected Silo because I wanted minimal refactoring, and I already had a working setup that I didn't want to touch.

Making the swap

In docker-compose.yml, change the image and the command. Everything else in the service stays exactly the same, including the service name, so even AWS_ENDPOINT="http://minio:9000" still works!

     minio:
-        image: 'minio/minio:latest'
+        image: 'pgsty/silo: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"
+        command: silo server /data/minio --console-address ":8900"
         healthcheck:
             test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]

That's it for Laravel Sail. The health check still hits /minio/health/live, the ports are the same, and the console is still on 8900. My application config, .env values and test suite were untouched.

It couldn't be easier!

Some things to consider

  • Silo is an independent fork and isn't affiliated with MinIO.
  • The README says to treat each release as a downstream upgrade: pin versions and read the release notes. My compose file uses :latest instead, which is likely to be fine for a throwaway dev container.
  • Silo says it keeps the same on-disk format, so an existing sail-minio volume should carry over. I haven't tested that, and since local data is normally disposable, sail down -v and starting fresh is the safe route anyway.
  • Make sure you are using this for local development only. Production is a different story, and for me that means using Cloudflare R2 or Amazon S3.

Tell me what you ran into

I'd love to hear how this went for you:

  • Did you hit any challenges moving off MinIO?
  • Which alternative did you end up using, and why?
  • Did you find anything that turned out to be less of a drop-in than advertised?

Mention me on /dev/null or Twitter/X and let me know. If there is a trick that saved you time, or something relevant that you feel everyone should know about, I'll happily add it to this post.