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.

Recommended platforms to deploy a Payload app

default discord avatar
juansebastianmendoza2 years ago
28

What platforms do you recommend me to deploy a Payload and NextJS app based on the

nextjs-custom-server

template from this repo:

https://github.com/payloadcms/nextjs-custom-server

?



I tried Vercel but I don't know why everything related to Payload is not working...

  • discord user avatar
    seanzubrickas
    2 years ago

    Hey Juan - our team and a number of our community members use Digital Ocean to host Payload, and then Vercel for the frontend, but there are a number of different combinations you could use. It's whatever works best for your specific situation.



    If you look through the threads there are quite a few discussions about this as well

  • default discord avatar
    juansebastianmendoza2 years ago

    I see but one thing that still confuses me is, in my case I have both my frontend code and my server code in the same repo. How do I deploy only the server code on Digital Ocean? should I just target the repo and Digital Ocean will do the magic? 👀

  • discord user avatar
    jarrod_not_jared
    2 years ago
    @258416232506589186

    What you are experiencing is to be expected. That example uses a custom server (the server.ts file) to boot up Next, when you use a custom server with Next you cannot deploy on Vercel.



    That being said, we normally split the two out, backend (Payload) and frontend (Next) and deploy the backend to Digital Ocean or similar - and then the frontend to Vercel or similar. This workflow works really well.



    Maybe we should call this out explicitly in the Readme of this repo to avoid confusion down the road.



    Splitting your frontend and backend should be fairly easy to do, lmk if you have questions!

  • default discord avatar
    juansebastianmendoza2 years ago

    I got it now. And calling this out in the Readme would definitely be very helpful for beginners. And a quick YouTube tutorial showing all this procedure would be much appreciated as well, just in case :D

  • default discord avatar
    taun21602 years ago

    +1 for more beginner tutorials.

  • default discord avatar
    thedunco2 years ago

    Alternatively,

    @360823574644129795

    recently made a very nice video tutorial for hosting Payload on Northflank and Railway (I use Railway and it's fantastic; you can provision a Mongo instance right beside it and it automatically adds all the Mongo env vars -- great for a development environment or smaller projects).



    https://discord.com/channels/967097582721572934/967105150068092968/1082037639395422351

    But yes, I'd recommend either Netlify or Vercel to host the frontend, whatever it may be.

  • default discord avatar
    christopher.nowlan2 years ago
    @258416232506589186

    I would split the project into backend and frontend. Makes its much easier to deploy. Then you can deploy the front end on Vercel as

    @281120856527077378

    suggested. I have deployed a couple of backend projects to a AWS Lightsail instances running Plesk through a bitbucket pipeline using rsync. Bit of a process to set up, but once done deploying updates to staging/production is as easy committing to staging/production branch

  • default discord avatar
    thebiltheory2 years ago

    I've just tried Railway with a Payload Instance inside a Turborepo. Seamlessly noice. 👌


    However I was wondering what where your recommendation for persistent media?


    What are alternatives to S3 buckets?

  • discord user avatar
    alessiogr
    2 years ago

    For any kind of images, I'm currently using ImageKit - works very nice

  • default discord avatar
    thebiltheory2 years ago

    I'll check it out. Do you have a tutorial on how you implemented it?

  • discord user avatar
    alessiogr
    2 years ago

    Pretty simple, I'm just using the cloud storage plugin - my imagekit PR wasn't merged yet though:

    https://github.com/payloadcms/plugin-cloud-storage/pull/32

    You can use it directly from my PR branch:

    https://github.com/AlessioGr/plugin-cloud-storage/tree/imagekit

    so pretty much just install that and set the imagekit endpoint, public & private key accordingly

  • default discord avatar
    thebiltheory2 years ago

    I'll git it a shot! You might wanna update the README with the additional adapter in your PR before you get a comment on it



    Thank you

    @360823574644129795
  • discord user avatar
    alessiogr
    2 years ago

    Done! I've added ImageKit to my readme ^^

  • discord user avatar
    alessiogr
    2 years ago

    resolved it!



    How are you installing it in your project, by the way? Didn't find a reliable way to add branches not added to npm without copying it over manually

  • default discord avatar
    thebiltheory2 years ago
    ...
    "@payloadcms/plugin-cloud-storage": "https://github.com/AlessioGr/plugin-cloud-storage.git#imagekit",
    ...


    Like this but I have declaration issues.

  • discord user avatar
    alessiogr
    2 years ago

    Ahhh hm, didn't know that works! What declaration issues?

  • default discord avatar
    thebiltheory2 years ago

    These


    Error: Cannot find module '@payloadcms/plugin-cloud-storage'

    Cannot find module '@payloadcms/plugin-cloud-storage' or its corresponding type declarations.ts(2307)

    import imageKitAdapter
    const imageKitAdapter: any
    Module '"@payloadcms/plugin-cloud-storage/imagekit"' has no exported member 'imageKitAdapter'.ts(2305)
  • discord user avatar
    alessiogr
    2 years ago

    Ah weird - no idea why. I've always had issues adding a github project directly into the package.json - tried various ways there.


    Prob best to just copy the plugin manually into your project - that's how I'm doing it currently.

  • default discord avatar
    thebiltheory2 years ago

    Any news from the Payload team to review your PR?

  • discord user avatar
    alessiogr
    2 years ago

    🤷‍♂️

    @967118574445547650

    since you've been working on the plugin lately, what do you think about

    https://github.com/payloadcms/plugin-cloud-storage/pull/32

    ?


    Currently using it in production just fine - I think what could mainly be weird with my PR is the introduction of an extra "cloudImageID" field

  • discord user avatar
    denolfe
    2 years ago

    To be completely honest, it's been all hands on deck to get Cloud out, and we haven't had a chance to look this over.

  • discord user avatar
    alessiogr
    2 years ago

    oh sure no worries - cloud comes first! 😄

  • default discord avatar
    thebiltheory2 years ago

    Talking about the Cloud. When will we able to test it out?

  • default discord avatar
    tinouti2 years ago

    They're announcing it on Monday, not sure if that also means availability on Monday or if it'll be a bit later though.

  • default discord avatar
    g.djonovic2 weeks ago

    is this still a way to go in 2025? cant find some good guidelines how and where to host payloadcms backend + frontend.

  • default discord avatar
    maximilliangeorgelast week
    @703645874651267172

    I hate to be this guy, but I want to warn you not to use Payload Cloud. I decided to use Payload Cloud for a recent project, expecting everything to work out of the box, but S3 uploads fail 3 times out of 4 with the error "Error: Empty file" and there's no real way for me to debug it since it's all plug and play. You really need to roll your own.

  • default discord avatar
    g.djonoviclast week

    thanks, any info is good. Was not considering payload cloud. Looking into Vercel as it seems to be preferred option as I see from other posts/articles/tutorials but not sure yet about limitations. I guess it will be trial and error.

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.