This plugin stores files uploaded through Payload upload collections in Amazon S3 instead of on the server file system. It is registered in the Payload config with an S3 client, and each upload collection sets its own bucket, prefix and PutObject options. Resized image variants are uploaded too. It targets Payload 1.x.
Send Payload CMS uploads to Amazon S3
Installation
npm i payload-s3-upload70
Stars
11
Forks
5
Open Issues
3 years ago
Last Updated
273
Weekly Downloads
v2.1.1
npm Version
21.1 KB
Unpacked Size
1
Dependencies
700 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 70 |
| Dec 4, 2026 | 70 |
| Dec 3, 2026 | 70 |
| Dec 2, 2026 | 70 |
| Dec 1, 2026 | 70 |
| Nov 30, 2026 | 70 |
| Nov 29, 2026 | 70 |
| Nov 28, 2026 | 70 |
| Nov 27, 2026 | 70 |
| Nov 26, 2026 | 70 |
| Nov 25, 2026 | 70 |
| Nov 24, 2026 | 70 |
| Nov 23, 2026 | 70 |
| Nov 22, 2026 | 70 |
| Nov 21, 2026 | 70 |
| Nov 20, 2026 | 70 |
| Nov 19, 2026 | 70 |
| Nov 18, 2026 | 70 |
| Nov 17, 2026 | 70 |
| Nov 16, 2026 | 70 |
| Nov 15, 2026 | 70 |
| Nov 14, 2026 | 70 |
| Nov 13, 2026 | 70 |
| Nov 12, 2026 | 70 |
| Nov 11, 2026 | 70 |
| Nov 10, 2026 | 70 |
| Nov 9, 2026 | 70 |
| Nov 8, 2026 | 70 |
| Nov 7, 2026 | 70 |
| Nov 6, 2026 | 70 |
| Nov 5, 2026 | 70 |
| Nov 4, 2026 | 70 |
| Nov 3, 2026 | 70 |
| Nov 2, 2026 | 70 |
| Nov 1, 2026 | 70 |
| Oct 31, 2026 | 70 |
| Oct 30, 2026 | 70 |
| Oct 29, 2026 | 70 |
| Oct 28, 2026 | 70 |
| Oct 27, 2026 | 70 |
| Oct 26, 2026 | 70 |
| Oct 25, 2026 | 70 |
| Oct 24, 2026 | 70 |
| Oct 23, 2026 | 70 |
| Oct 22, 2026 | 70 |
| Oct 21, 2026 | 70 |
| Oct 20, 2026 | 70 |
| Oct 19, 2026 | 70 |
| Oct 18, 2026 | 70 |
| Oct 17, 2026 | 70 |
| Oct 16, 2026 | 70 |
| Oct 15, 2026 | 70 |
| Oct 14, 2026 | 70 |
| Oct 13, 2026 | 70 |
| Oct 12, 2026 | 70 |
| Oct 11, 2026 | 70 |
| Oct 10, 2026 | 70 |
| Oct 9, 2026 | 70 |
| Oct 8, 2026 | 70 |
| Oct 7, 2026 | 70 |
| Oct 6, 2026 | 70 |
| Oct 5, 2026 | 70 |
| Oct 4, 2026 | 70 |
| Oct 3, 2026 | 70 |
| Oct 2, 2026 | 70 |
| Oct 1, 2026 | 70 |
| Sep 30, 2026 | 70 |
| Sep 29, 2026 | 70 |
| Sep 28, 2026 | 70 |
| Sep 27, 2026 | 70 |
| Sep 26, 2026 | 70 |
| Sep 25, 2026 | 70 |
| Sep 24, 2026 | 70 |
| Sep 23, 2026 | 70 |
| Sep 22, 2026 | 70 |
| Sep 21, 2026 | 70 |
| Sep 20, 2026 | 70 |
| Sep 19, 2026 | 70 |
| Sep 18, 2026 | 70 |
| Sep 17, 2026 | 70 |
| Sep 16, 2026 | 70 |
| Sep 15, 2026 | 70 |
| Sep 14, 2026 | 70 |
| Sep 13, 2026 | 70 |
| Sep 12, 2026 | 70 |
| Sep 11, 2026 | 70 |
| Sep 10, 2026 | 70 |
| Sep 9, 2026 | 70 |
| Sep 8, 2026 | 70 |
| Sep 7, 2026 | 70 |
| Sep 6, 2026 | 70 |
270−292 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 270 |
| Dec 4, 2026 | 266 |
| Dec 3, 2026 | 284 |
| Dec 2, 2026 | 303 |
| Dec 1, 2026 | 302 |
| Nov 30, 2026 | 295 |
| Nov 29, 2026 | 284 |
| Nov 28, 2026 | 315 |
| Nov 27, 2026 | 319 |
| Nov 26, 2026 | 316 |
| Nov 25, 2026 | 298 |
| Nov 24, 2026 | 298 |
| Nov 23, 2026 | 330 |
| Nov 22, 2026 | 309 |
| Nov 21, 2026 | 306 |
| Nov 20, 2026 | 287 |
| Nov 19, 2026 | 302 |
| Nov 18, 2026 | 336 |
| Nov 17, 2026 | 350 |
| Nov 16, 2026 | 324 |
| Nov 15, 2026 | 351 |
| Nov 14, 2026 | 369 |
| Nov 13, 2026 | 420 |
| Nov 12, 2026 | 405 |
| Nov 11, 2026 | 370 |
| Nov 10, 2026 | 352 |
| Nov 9, 2026 | 339 |
| Nov 8, 2026 | 340 |
| Nov 7, 2026 | 305 |
| Nov 6, 2026 | 333 |
| Nov 5, 2026 | 359 |
| Nov 4, 2026 | 377 |
| Nov 3, 2026 | 413 |
| Nov 2, 2026 | 448 |
| Nov 1, 2026 | 429 |
| Oct 31, 2026 | 418 |
| Oct 30, 2026 | 340 |
| Oct 29, 2026 | 270 |
| Oct 28, 2026 | 215 |
| Oct 27, 2026 | 182 |
| Oct 26, 2026 | 135 |
| Oct 25, 2026 | 150 |
| Oct 24, 2026 | 197 |
| Oct 23, 2026 | 159 |
| Oct 22, 2026 | 214 |
| Oct 21, 2026 | 242 |
| Oct 20, 2026 | 237 |
| Oct 19, 2026 | 241 |
| Oct 18, 2026 | 260 |
| Oct 17, 2026 | 209 |
| Oct 16, 2026 | 235 |
| Oct 15, 2026 | 223 |
| Oct 14, 2026 | 257 |
| Oct 13, 2026 | 262 |
| Oct 12, 2026 | 281 |
| Oct 11, 2026 | 247 |
| Oct 10, 2026 | 256 |
| Oct 9, 2026 | 286 |
| Oct 8, 2026 | 281 |
| Oct 7, 2026 | 426 |
| Oct 6, 2026 | 423 |
| Oct 5, 2026 | 403 |
| Oct 4, 2026 | 386 |
| Oct 3, 2026 | 357 |
| Oct 2, 2026 | 322 |
| Oct 1, 2026 | 428 |
| Sep 30, 2026 | 249 |
| Sep 29, 2026 | 257 |
| Sep 28, 2026 | 390 |
| Sep 27, 2026 | 396 |
| Sep 26, 2026 | 435 |
| Sep 25, 2026 | 600 |
| Sep 24, 2026 | 547 |
| Sep 23, 2026 | 590 |
| Sep 22, 2026 | 757 |
| Sep 21, 2026 | 660 |
| Sep 20, 2026 | 676 |
| Sep 19, 2026 | 818 |
| Sep 18, 2026 | 716 |
| Sep 17, 2026 | 668 |
| Sep 16, 2026 | 765 |
| Sep 15, 2026 | 588 |
| Sep 14, 2026 | 553 |
| Sep 13, 2026 | 708 |
| Sep 12, 2026 | 567 |
| Sep 11, 2026 | 533 |
| Sep 10, 2026 | 683 |
| Sep 9, 2026 | 574 |
| Sep 8, 2026 | 585 |
| Sep 7, 2026 | 727 |
| Sep 6, 2026 | 562 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/393192786-root)<a href="https://payloaddirectory.dev/plugins/393192786-root"><img src="https://payloaddirectory.dev/badge/393192786-root.svg" alt="Payload Directory"></a>README
This plugin sends uploaded files to Amazon S3 instead of writing them to the server file system.
Resized images are properly supported.
Payload team supports an official cloud storage plugin, different from this one.
The main difference is that this plugin allows configuring collection logic on the collection itself.
Payload implementation requires to define collection-specific stuff from plugins inside the global payload configuration file, which is (imho) bad design.
npm install payload-s3-upload --legacy-peer-deps
Payload requires legacy-peer-deps because of conflicts on React and GraphQL dependencies (see Payload docs).
import { S3Client } from '@aws-sdk/client-s3';
import { buildConfig } from 'payload/config';
import s3Upload from 'payload-s3-upload';
export default buildConfig({
// ...
plugins: [
s3Upload(new S3Client({
region: process.env.AWS_REGION,
credentials: {
accessKeyId: process.env.AWS_KEY,
secretAccessKey: process.env.AWS_SECRET,
},
})),
],
});
import { S3UploadCollectionConfig } from 'payload-s3-upload';
const Media: S3UploadCollectionConfig = {
slug: 'media',
upload: {
staticURL: '/assets',
staticDir: 'assets',
disableLocalStorage: true,
s3: {
bucket: 'my-bucket',
prefix: 'images/xyz', // files will be stored in bucket folder images/xyz
// prefix: ({ doc }) => `assets/${doc.type}`, // dynamic prefixes are possible too
commandInput: {
// optionally, use here any valid PutObjectCommandInput property
// https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/putobjectcommandinput.html
ACL: 'public-read',
},
},
adminThumbnail: ({ doc }) =>
`https://my-bucket.s3.eu-west-3.amazonaws.com/images/xyz/${doc.filename}`,
},
// create a field to access uploaded files in s3 from payload api
fields: [
{
name: 'url',
type: 'text',
access: {
create: () => false,
},
admin: {
disabled: true,
},
hooks: {
afterRead: [
({ data: doc }) =>
`https://my-bucket.s3.eu-west-3.amazonaws.com/images/${doc.type}/${doc.filename}`,
],
},
},
],
};
export default Media;
This plugin automatically uploads image variants in S3.
However, in order to retrieve correct URLs for the different sizes in the API, additional hooks should be implemented.
import { S3UploadCollectionConfig } from 'payload-s3-upload';
const Media: S3UploadCollectionConfig = {
slug: 'media',
upload: {
// ...
imageSizes: [
{
name: 'thumbnail',
width: 400,
height: 300,
crop: 'center'
},
{
name: 'card',
width: 768,
height: 1024,
crop: 'center'
},
{
name: 'tablet',
width: 1024,
height: null,
crop: 'center'
}
],
adminThumbnail: 'thumbnail',
},
hooks: {
afterRead: [
({ doc }) => {
// add a url property on the main image
doc.url = `${myBucketUrl}/${doc.filename}`
// add a url property on each imageSize
Object.keys(doc.sizes)
.forEach(k => doc.sizes[k].url = `${myBucketUrl}/${doc.sizes[k].filename}`)
}
]
},
fields: []
};
export default Media;
Please refer to the test files!
payload imagekit
Sync Payload media uploads to ImageKit and store selected ImageKit properties in the database
3744/wk24v3
cloud storage
Store Payload uploads in third-party cloud storage through a generic adapter interface
1001.0M/wk46.1kv3 v4
payload storage bunny
Storage adapter for with video streaming, signed URLs and CDN cache purging
753.9k/wk60v4
payload storage sanity
Store Payload media uploads in Sanity Content Lake with crops, focal points and video posters
721.2k/wk0v3
payload storage cloudinary
Cloudinary storage adapter for Payload uploads with transformation presets, dynamic folders and private signed files
58176/wk7v3
payload cloudinary plugin
Upload Payload media to Cloudinary through an Express middleware and a config plugin
4855/wk76v2