PHPackages                             pixelfusion/silverstripe-s3 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. pixelfusion/silverstripe-s3

ActiveSilverstripe-vendormodule[File &amp; Storage](/categories/file-storage)

pixelfusion/silverstripe-s3
===========================

Adds SilverStripe support for using the S3 adapter for Flysystem

1.0.2(1y ago)01.1k[1 issues](https://github.com/pixelfusion/silverstripe-s3/issues)BSD-3-ClausePHP

Since Apr 14Pushed 1y agoCompare

[ Source](https://github.com/pixelfusion/silverstripe-s3)[ Packagist](https://packagist.org/packages/pixelfusion/silverstripe-s3)[ RSS](/packages/pixelfusion-silverstripe-s3/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (8)Used By (0)

silverstripe-s3
===============

[](#silverstripe-s3)

SilverStripe module to store assets in S3 rather than on the local filesystem.

Note: This module does not currently implement any kind of bucket policy for protected assets. It is up to you to implement this yourself using AWS bucket policy.

Installation
------------

[](#installation)

Run this

```
composer require pixelfusion/silverstripe-s3

```

Environment setup
-----------------

[](#environment-setup)

The module requires a few environment variables to be set. Full details can be seen in the `SilverStripeS3AdapterTrait` trait. These are mandatory.

- `AWS_REGION`: The AWS region your S3 bucket is hosted in (e.g. `eu-central-1`)
- `AWS_BUCKET_NAME`: The name of the S3 bucket to store assets in.

If running outside of an EC2 instance it will be necessary to specify an API key and secret.

- `AWS_ACCESS_KEY_ID`: Your AWS access key that has access to the bucket you want to access
- `AWS_SECRET_ACCESS_KEY`: Your AWS secret corresponding to the access key

**Example YML Config when running outside of EC2:**

```
---
Only:
envvarset: AWS_BUCKET_NAME
After:
- '#assetsflysystem'
---
SilverStripe\Core\Injector\Injector:
Aws\S3\S3Client:
  constructor:
    configuration:
      region: '`AWS_REGION`'
      version: latest
      credentials:
        key: '`AWS_ACCESS_KEY_ID`'
        secret: '`AWS_SECRET_ACCESS_KEY`'
```

**Example YML Config when running CDN for S3:**

```
---
Only:
envvarset: AWS_BUCKET_NAME
After:
- '#assetsflysystem'
---
SilverStripe\Core\Injector\Injector:
Aws\S3\S3Client:
  constructor:
    configuration:
      region: '`AWS_REGION`'
      version: latest
      endpoint: '`AWS_CDN`'
      bucket_endpoint: true
      credentials:
        key: '`AWS_ACCESS_KEY_ID`'
        secret: '`AWS_SECRET_ACCESS_KEY`'
```

Make sure that you have the CDN URL under alternate domain names in your cloudfront distribution and the the A record for it has been set up pointing to your distribution.

Make sure your alternate domain name has an SSL certificate.

Installation
------------

[](#installation-1)

- Define the environment variables listed above.
- [Install Composer from https://getcomposer.org](https://getcomposer.org/download/)
- Run `composer require silverstripe/s3`

This will install the most recent applicable version of the module given your other Composer requirements.

**Note:** This currently immediately replaces the built-in local asset store that comes with SilverStripe with one based on S3. Any files that had previously been uploaded to an existing asset store will be unavailable (though they won't be lost - just run `composer remove silverstripe/s3` to remove the module and restore access).

Configuration
-------------

[](#configuration)

Assets are classed as either 'public' or 'protected' by SilverStripe. Public assets can be freely downloaded, whereas protected assets (e.g. assets not yet published) shouldn't be directly accessed.

The module supports this by streaming the contents of protected files down to the browser via the web server (as opposed to linking to S3 directly) by default. To ensure that protected assets can't be accessed, ensure you setup an appropriate bucket policy (see below for an untested example).

### Configuring S3

[](#configuring-s3)

The 'protected' S3 asset store should be protected using standard AWS IAM policies that disallow all access to anonymous users, but still allow the action `s3:GetObject` for both public and protected files. Protected files will be streamed from AWS, so they do not need to be accessed by users directly. Therefore, something similar to the following bucket policy may be useful.

Make sure you replace `` below with the appropriate values.

**Note:** The below policy has not been extensively tested - feedback welcome.

```
{
    "Policy": {
		"Version":"2012-10-17",
		"Statement":[
			{
				"Sid":"AddPerm",
				"Effect":"Allow",
				"Principal":"*",
				"Action":"s3:GetObject",
				"Resource":"arn:aws:s3:::/public/*"
			}
		]
	}
}
```

For developers
--------------

[](#for-developers)

Read [Setting up a local sandbox for developing the Silverstripe S3 module](doc/en/setting-local-dev-environment.md) if you wish to do some local development.

Uninstalling
------------

[](#uninstalling)

- Run `composer remove pixelfusion/silverstripe-s3` to remove the module.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~456 days

Recently: every ~656 days

Total

7

Last Release

580d ago

Major Versions

0.3.0 → 1.0.02021-06-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6a363b2d85dc3e82e73cc9e3a57fc15132920b166c5938ad63a54029b9f94b9?d=identicon)[tractorcow](/maintainers/tractorcow)

![](https://avatars.githubusercontent.com/u/2075127?v=4)[Pixel Fusion](/maintainers/pfdeploy)[@pfdeploy](https://github.com/pfdeploy)

---

Top Contributors

[![madmatt](https://avatars.githubusercontent.com/u/893117?v=4)](https://github.com/madmatt "madmatt (10 commits)")[![obj63mc](https://avatars.githubusercontent.com/u/443120?v=4)](https://github.com/obj63mc "obj63mc (8 commits)")[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (8 commits)")[![filiplikavcan](https://avatars.githubusercontent.com/u/1244233?v=4)](https://github.com/filiplikavcan "filiplikavcan (4 commits)")[![anthonyvanbeek](https://avatars.githubusercontent.com/u/3439745?v=4)](https://github.com/anthonyvanbeek "anthonyvanbeek (2 commits)")[![medv](https://avatars.githubusercontent.com/u/1631737?v=4)](https://github.com/medv "medv (1 commits)")

---

Tags

filesystems3awssilverstripe

### Embed Badge

![Health badge](/badges/pixelfusion-silverstripe-s3/health.svg)

```
[![Health](https://phpackages.com/badges/pixelfusion-silverstripe-s3/health.svg)](https://phpackages.com/packages/pixelfusion-silverstripe-s3)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[silverstripe/s3

Adds SilverStripe support for using the S3 adapter for Flysystem

20297.0k1](/packages/silverstripe-s3)[league/flysystem-async-aws-s3

AsyncAws S3 filesystem adapter for Flysystem.

2610.5M31](/packages/league-flysystem-async-aws-s3)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
