S3 Buckets
podman:s3-setup creates the S3 buckets your app needs and applies a CORS policy to the ones browsers access directly. Talks to S3 over the API — no aws CLI or extra container needed.
Requirement: the AWS SDK
Needs aws/aws-sdk-php, not required by default (many apps don't use S3, and the SDK is large):
composer require aws/aws-sdk-php
Without it, podman:s3-setup fails with a clear error instead of a crash. Other commands are unaffected.
Credentials
Reuses your app's existing s3 disk config in config/filesystems.php (key, secret, region, endpoint, use_path_style_endpoint) — no second credential config. Works with AWS S3 and S3-compatible services that support signed URLs (MinIO, RustFS, Garage, and others).
Configuring buckets
Both are empty by default — podman:s3-setup is a no-op until you list buckets:
's3_buckets' => env('PODMAN_S3_BUCKETS', [
'local', 'conversions', 'segments', 'secrets',
]),
's3_cors_buckets' => env('PODMAN_S3_CORS_BUCKETS', [
'conversions', 'segments', 'secrets',
]),
s3_buckets— every bucket to create. Idempotent — existing buckets count as success.s3_cors_buckets— which of those get the CORS policy. Must be a subset ofs3_buckets.
Both accept a plain PHP array or a comma-separated string.
The CORS policy
Read from the s3 preset's cors.json (containers/stubs/s3/ if published, otherwise the vendor copy) — no quadlets//runtimes/, no podman:generate involved:
php artisan podman:publish s3
php artisan podman:s3-setup
Edit containers/stubs/s3/cors.json — standard S3 CORS JSON:
{
"CORSRules": [
{
"AllowedOrigins": ["*"],
"AllowedMethods": ["GET", "HEAD"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["Content-Length", "Content-Range", "Accept-Ranges", "ETag"],
"MaxAgeSeconds": 7200
}
]
}
Any bucket read directly by <img>, <video>, or fetch() needs this — server-side-only buckets (queued jobs) usually don't.
Usage
php artisan podman:s3-setup
Creates every s3_buckets entry, then applies CORS to s3_cors_buckets:
Creating buckets...
-> local
-> conversions
-> segments
-> secrets
Applying CORS policy...
-> conversions
-> segments
-> secrets
Done.