Skip to content

MinIO Containers

Testcontainers can be used to automatically instantiate and manage MinIO containers.

Note

Upstream MinIO stopped publishing free community builds in late 2025 and archived the minio/minio repository in 2026; the minio/minio image is no longer available on Docker Hub. The module therefore also accepts Silo (pgsty/silo), a community-maintained, AGPL-licensed fork of MinIO by the Pigsty project, which is used in the examples below. See the Silo manifesto for background on the fork.

Usage example

Create a MinIOContainer to use it in your tests:

MinIOContainer container = new MinIOContainer("pgsty/silo:RELEASE.2026-09-16T00-00-00Z");

The MinIO Java client can be configured with the container as such:

MinioClient minioClient = MinioClient
    .builder()
    .endpoint(container.getS3URL())
    .credentials(container.getUserName(), container.getPassword())
    .build();

If needed the username and password can be overridden as such:

MinIOContainer container = new MinIOContainer("pgsty/silo:RELEASE.2026-09-16T00-00-00Z")
    .withUserName("testuser")
    .withPassword("testpassword");

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

 testImplementation "org.testcontainers:testcontainers-minio:2.0.5"
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>testcontainers-minio</artifactId>
    <version>2.0.5</version>
    <scope>test</scope>
</dependency>