Skip to main content
Build a REST app that performs S3 object-storage operations through an S3DemoController. You use Winter Boot for the application runtime and the Winter S3 module from Winter Modules for storage access. You test the whole flow locally with MinIO, an S3-compatible object storage server.

Prerequisites

You need PHP 8.5 or later with the swoole and pcntl extensions. You also need Docker to run MinIO. Start MinIO before you run the app:
MinIO listens on http://localhost:30900, and its console is at http://localhost:30901.

Project structure

The sample uses this layout:

Install dependencies

Require the framework and the modules package:

Source files

Switch between the source files. Each tab shows the exact file from the sample.
The single entry point. It points Winter Boot at the config directory and at the sample namespace.

Configuration

Switch between the two config files. application.yml enables the module, and s3-config.yml defines the primary connection to MinIO.
The full sample file registers S3Module and sets the server and app identity:
See Configuration for every application.yml key.

Run the app

Start the app, then call the endpoints to create a bucket, upload an object, and read it back. 1. Start the application:
2. Create a bucket:
3. Upload an object:
4. List objects:
5. Download the object:
6. Run the complete demo:
The demo creates its own bucket, runs create, upload, head, download, list, and delete in sequence, and returns one status entry per operation.

Next steps

  • Read the S3 module for the full S3Template API and IAM-role setup.
  • Browse all Libraries when you need Kafka, SQS, Redis, or Doctrine in the same app.