Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Configuring Minio for Local Dev with Seamless Payload Cloud S3 Integration

default discord avatar
sojosteplast year
3

Hey everyone! I'm working on a PayloadCMS project and need some advice on setting up file storage. For local development, I want to use a Minio S3 instance to handle uploads, but when deploying to Payload Cloud, I’d like it to switch seamlessly to the S3 storage provided by the platform.



My goal is to configure payload.config.js and environment variables so that it works with Minio locally (using access/secret keys and a custom endpoint) and then uses Payload Cloud’s S3 (with Cognito auth, I assume?) in production without breaking anything. Has anyone set this up before? What’s the best way to handle the conditional logic for switching between the two environments? Any tips or examples would be super helpful! Thanks!

  • default discord avatar
    nils06488last year

    All plugins have an

    enabled

    switch.



    Here one my configs. (I do not use a storage provider in dev)


      s3Storage({
        enabled: process.env.S3_ENABLED === 'true',
        collections: {
          media: true,


    You could use a

    STORAGE_PROVIDER

    variable to switch between your providers.

  • default discord avatar
    sojosteplast year

    Very helpful, thank you!



    While examining templates and code examples in other repositories, I couldn’t find any instances of working with the S3 storage from Payload Cloud or its specific configurations. Does this mean that for local development, it’s sufficient to have the

    @payloadcms/payload-cloud

    plugin connected, which will use the local file system as storage, and then, when deployed to production in Payload Cloud, a storage solution will be automatically set up to store all media files? Initially, I assumed I’d need to set up a local S3 instance and manage the storage connection through variables in Payload Cloud.

  • default discord avatar
    nils06488last year

    PayloadCMS falls back to local storage.

    https://payloadcms.com/docs/upload/storage-adapters

    I have not used Payload Cloud, yet.


    But setup should not be different from others.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.