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.

Using an Uploads Collection with Digital Ocean (or Vercel) — how does it work?

default discord avatar
modgy.9 months ago
3

Hey everyone,



I have a question related to uploads. I'm building a gated content library for a client (funnily enough is a suggested use case for uploads -

https://payloadcms.com/docs/upload/overview#uploads:~:text=Gated%20Content%20library

)



I created a Media Collection locally (localhost) and uploaded a file. I see that as-per my schema it created an asset folder called 'media' and uploaded the file there. Bam (as

@364124941832159242

would say) nice and easy, so I love that.



My questions

are specifically about hosting this and how uploads would then work:



1. Let's say I hosted with Digital Ocean, and I upload a file, would Payload be able to create the media folder on the Digital Ocean server and upload the file to it without any additional configuration?


2. Assuming my frontend UI uses Next.js to

build

the site, would I have to trigger a build every time a file is uploaded or could I fetch the uploads in a more dynamic way?


3. It looks like the media folder created is created as part of my Git repo, so would I have to store all of the files on GitHub as well as on Digital Ocean? They are going to have 100's of GB's worth of files stored so that could become an issue.



Really hoping someone can help me understand this as I'm just trying to understand it before passing a cost onto the client. I don't want to get caught out!



Bump



Thanks

@364124941832159242

— I'm just looking further into using Digital Ocean to host Payload and my website, but the guide linked in the Payload docs is mostly just linking out to Digital Ocean articles. Is there anything more cohesive I could look at that I'm missing?



I have more questions regarding setting up Digital Ocean than I could suitably ask here. I'm not a dev ops person at all and have been comfortably letting Vercel handle all of this for me for years now so diving into SSH and running nginx etc is a little overwhelming for me.

  • default discord avatar
    Payload-Bot11 months ago
  • discord user avatar
    jmikrut
    11 months ago

    Hey

    @392646823015219203

    here are some answers for you!



    Let's say I hosted with Digital Ocean, and I upload a file, would Payload be able to create the media folder on the Digital Ocean server and upload the file to it without any additional configuration?

    Yes! It's worth noting though that DigitalOcean has a lot of different ways to deploy a Payload app. Some will -keep- your file system around, like Droplets, where others like the App Platform have a file system that completely re-inits once and a while (deleting your app folder) . You can host files on a Droplet no problem, but on the app platform, you'll need a third-party storage platform



    Assuming my frontend UI uses Next.js to build the site, would I have to trigger a build every time a file is uploaded or could I fetch the uploads in a more dynamic way?

    Nope, no rebuild necessary! Payload will serve the new files completely dynamically!



    It looks like the media folder created is created as part of my Git repo, so would I have to store all of the files on GitHub as well as on Digital Ocean? They are going to have 100's of GB's worth of files stored so that could become an issue.

    You will want to add your media folder to your

    .gitignore

    file. The uploads should be stored on your server, and not be included in your Git repository



    @294471989517746176

    you can use Vercel Blob Storage for files



    check this out - a one click deploy button for Payload on Vercel with Postgres + Blob Storage all configured for you



    https://github.com/payloadcms/vercel-deploy-payload-postgres
  • default discord avatar
    mrmacht10 months ago

    So with Payload V3 inside a nextjs app hosted on Vercel you would also need a third-party storage platform, right?

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.