payloadcms

cloud storage

Official
by payloadcms
payload
Cloud storage
v3
v4
4.0.0-canary.20261205 · prerelease
MIT

Overview

Summary generated from the README

The official Payload plugin that moves uploaded media from local disk to external storage. It is configured per upload collection with an adapter, and supports Azure, S3-style, Google Cloud Storage and Vercel Blob adapters or custom adapters. For Payload 3.0 the dedicated storage packages are recommended for those services, so this package suits custom or unsupported providers.

Features

  • Per-collection adapter configuration
  • Custom adapters for any storage service
  • Keeps file URLs and Payload access control by passing files through
  • Option to point file URLs directly at the cloud host
  • Folder prefix for uploads inside a bucket
  • Enabled flag and option to disable local storage

Use cases

  • Build a custom storage adapter for a provider without an official Payload storage package
  • Keep uploads off local disk on serverless or ephemeral hosting
  • Serve private media from a bucket while keeping Payload read access rules

From the author

The official cloud storage plugin for Payload CMS

Installation

npm i @payloadcms/plugin-cloud-storage

46.1k

Stars

4.5k

Forks

1821

Open Issues

Today

Last Updated

1.0M

Weekly Downloads

v3.94.2

npm Version

318.1 KB

Unpacked Size

3

Dependencies

Repository stars

46.1K+1.8K since Sep 6

Show data
Repository stars by day (UTC)
DateStars
Dec 5, 202646,136
Dec 4, 202646,125
Dec 3, 202646,106
Dec 2, 202646,087
Dec 1, 202646,068
Nov 30, 202646,059
Nov 29, 202646,037
Nov 28, 202646,035
Nov 27, 202646,022
Nov 26, 202646,012
Nov 25, 202645,993
Nov 24, 202645,976
Nov 23, 202645,958
Nov 22, 202645,947
Nov 21, 202645,937
Nov 20, 202645,926
Nov 19, 202645,901
Nov 18, 202645,868
Nov 17, 202645,852
Nov 16, 202645,831
Nov 15, 202645,820
Nov 14, 202645,807
Nov 13, 202645,792
Nov 12, 202645,779
Nov 11, 202645,763
Nov 10, 202645,742
Nov 9, 202645,731
Nov 8, 202645,722
Nov 7, 202645,704
Nov 6, 202645,681
Nov 5, 202645,670
Nov 4, 202645,647
Nov 3, 202645,629
Nov 2, 202645,611
Nov 1, 202645,603
Oct 31, 202645,592
Oct 30, 202645,574
Oct 29, 202645,561
Oct 28, 202645,543
Oct 27, 202645,519
Oct 26, 202645,492
Oct 25, 202645,472
Oct 24, 202645,449
Oct 23, 202645,430
Oct 22, 202645,405
Oct 21, 202645,259
Oct 20, 202645,239
Oct 19, 202645,213
Oct 18, 202645,192
Oct 17, 202645,165
Oct 16, 202645,148
Oct 15, 202645,122
Oct 14, 202645,100
Oct 13, 202645,082
Oct 12, 202645,057
Oct 11, 202645,032
Oct 10, 202645,023
Oct 9, 202645,003
Oct 8, 202644,983
Oct 7, 202644,959
Oct 6, 202644,935
Oct 5, 202644,924
Oct 4, 202644,907
Oct 3, 202644,891
Oct 2, 202644,876
Oct 1, 202644,859
Sep 30, 202644,846
Sep 29, 202644,829
Sep 28, 202644,805
Sep 27, 202644,787
Sep 26, 202644,769
Sep 25, 202644,737
Sep 24, 202644,709
Sep 23, 202644,691
Sep 22, 202644,669
Sep 21, 202644,641
Sep 20, 202644,628
Sep 19, 202644,609
Sep 18, 202644,595
Sep 17, 202644,570
Sep 16, 202644,548
Sep 15, 202644,523
Sep 14, 202644,501
Sep 13, 202644,488
Sep 12, 202644,470
Sep 11, 202644,447
Sep 10, 202644,427
Sep 9, 202644,402
Sep 8, 202644,384
Sep 7, 202644,364
Sep 6, 202644,352

Shared by 12 plugins in payloadcms/payload.

npm weekly downloads

947.7K+394.4K since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 2026947,695
Dec 4, 2026924,901
Dec 3, 2026906,183
Dec 2, 2026927,844
Dec 1, 2026939,529
Nov 30, 2026950,713
Nov 29, 2026993,314
Nov 28, 20261,038,504
Nov 27, 20261,064,682
Nov 26, 20261,093,403
Nov 25, 20261,089,467
Nov 24, 20261,092,830
Nov 23, 20261,102,201
Nov 22, 20261,099,070
Nov 21, 20261,105,785
Nov 20, 20261,093,953
Nov 19, 20261,071,357
Nov 18, 20261,053,308
Nov 17, 20261,039,503
Nov 16, 20261,023,624
Nov 15, 20261,014,656
Nov 14, 20261,018,942
Nov 13, 20261,063,855
Nov 12, 20261,082,860
Nov 11, 20261,087,039
Nov 10, 20261,102,071
Nov 9, 20261,110,006
Nov 8, 20261,119,371
Nov 7, 20261,115,008
Nov 6, 20261,082,953
Nov 5, 20261,072,773
Nov 4, 20261,082,943
Nov 3, 20261,081,892
Nov 2, 20261,094,189
Nov 1, 20261,102,568
Oct 31, 20261,088,284
Oct 30, 20261,061,540
Oct 29, 2026874,195
Oct 28, 2026694,182
Oct 27, 2026681,221
Oct 26, 2026663,735
Oct 25, 2026634,906
Oct 24, 2026611,987
Oct 23, 2026450,064
Oct 22, 2026609,896
Oct 21, 2026735,060
Oct 20, 2026723,490
Oct 19, 2026700,730
Oct 18, 2026676,174
Oct 17, 2026663,924
Oct 16, 2026803,002
Oct 15, 2026784,341
Oct 14, 2026784,055
Oct 13, 2026774,304
Oct 12, 2026780,647
Oct 11, 2026771,304
Oct 10, 2026768,704
Oct 9, 2026753,454
Oct 8, 2026737,278
Oct 7, 2026734,898
Oct 6, 2026738,296
Oct 5, 2026729,588
Oct 4, 2026725,908
Oct 3, 2026711,985
Oct 2, 2026722,617
Oct 1, 2026713,876
Sep 30, 2026699,973
Sep 29, 2026687,070
Sep 28, 2026677,992
Sep 27, 2026662,087
Sep 26, 2026640,774
Sep 25, 2026609,244
Sep 24, 2026600,237
Sep 23, 2026593,747
Sep 22, 2026590,648
Sep 21, 2026589,082
Sep 20, 2026599,233
Sep 19, 2026606,085
Sep 18, 2026607,256
Sep 17, 2026598,040
Sep 16, 2026576,710
Sep 15, 2026579,806
Sep 14, 2026588,010
Sep 13, 2026572,108
Sep 12, 2026563,676
Sep 11, 2026565,026
Sep 10, 2026566,879
Sep 9, 2026572,562
Sep 8, 2026570,878
Sep 7, 2026557,238
Sep 6, 2026553,341

Each point is npm's rolling 7-day download count.

Health Score

100/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/official-plugin-cloud-storage.svg)](https://payloaddirectory.dev/plugins/official-plugin-cloud-storage)
HTML
<a href="https://payloaddirectory.dev/plugins/official-plugin-cloud-storage"><img src="https://payloaddirectory.dev/badge/official-plugin-cloud-storage.svg" alt="Payload Directory"></a>
Updated Dec 5, 2026Created Jan 5, 2021Published Nov 24, 2026

README

Payload Cloud Storage Plugin

This repository contains the officially supported Payload Cloud Storage plugin. It extends Payload to allow you to store all uploaded media in third-party permanent storage.

NOTE: If you are using Payload 3.0 and one of the following storage services, you should use one of following packages instead of this one:

ServicePackage
Vercel Blob@payloadcms/storage-vercel-blob
AWS S3@payloadcms/storage-s3
Azure@payloadcms/storage-azure
Google Cloud Storage@payloadcms/storage-gcs

This package is now best used for implementing custom storage solutions or third-party storage services that do not have @payloadcms/storage-* packages.

Installation

pnpm add @payloadcms/plugin-cloud-storage

Usage

import { buildConfig } from 'payload'
import { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage'

export default buildConfig({
  plugins: [
    cloudStoragePlugin({
      collections: {
        'my-collection-slug': {
          adapter: theAdapterToUse, // see docs for the adapter you want to use
        },
      },
    }),
  ],
  // The rest of your config goes here
})

Conditionally Enabling/Disabling

The proper way to conditionally enable/disable this plugin is to use the enabled property.

cloudStoragePlugin({
  enabled: process.env.MY_CONDITION === 'true',
  collections: {
    'my-collection-slug': {
      adapter: theAdapterToUse, // see docs for the adapter you want to use
    },
  },
}),

If the code is included in any way in your config but conditionally disabled in another fashion, you may run into issues such as Webpack Build Error: Can't Resolve 'fs' and 'stream' or similar because the plugin must be run at all times in order to properly extend the webpack config.

Features

Adapter-based Implementation

This plugin supports the following adapters:

However, you can create your own adapter for any third-party service you would like to use.

All adapters are implemented dev directory's Payload Config. See this file for examples.

Plugin options

This plugin is configurable to work across many different Payload collections. A * denotes that the property is required.

OptionTypeDescription
collections *Record<string, CollectionOptions>Object with keys set to the slug of collections you want to enable the plugin for, and values set to collection-specific options.
enabledboolean to conditionally enable/disable plugin. Default: true.

Collection-specific options:

OptionTypeDescription
adapter *AdapterPass in the adapter that you'd like to use for this collection. You can also set this field to null for local development if you'd like to bypass cloud storage in certain scenarios and use local storage.
disableLocalStoragebooleanChoose to disable local storage on this collection. Defaults to true.
disablePayloadAccessControltrueSet to true to disable Payload's access control. More
prefixstringSet to media/images to upload files inside media/images folder in the bucket.
generateFileURLGenerateFileURLOverride the generated file URL with one that you create.

Payload Access Control

Payload ships with access control that runs even on statically served files. The same read access control property on your upload-enabled collections is used, and it allows you to restrict who can request your uploaded files.

To preserve this feature, by default, this plugin keeps all file URLs exactly the same. Your file URLs won't be updated to point directly to your cloud storage source, as in that case, Payload's access control will be completely bypassed and you would need public readability on your cloud-hosted files.

Instead, all uploads will still be reached from the default /:collectionSlug/file/:filename path. This plugin will "pass through" all files that are hosted on your third-party cloud service—with the added benefit of keeping your existing access control in place.

If this does not apply to you (your upload collection has read: () => true or similar) you can disable this functionality by setting disablePayloadAccessControl to true. When this setting is in place, this plugin will update your file URLs to point directly to your cloud host.

disablePayloadAccessControl does not disable safe outbound fetching. If Payload needs to fetch files from a private or internal storage endpoint, configure the upload collection's skipSafeFetch option with an explicit allowlist for the trusted destination. Set skipSafeFetch: true only when every URL accepted by the collection is trusted.

Credit

This plugin was created with significant help, and code, from Alex Bechmann and Richard VanBergen. Thank you!!

Similar plugins

View on GitHubView on npmOfficial Payload plugin