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.

Question about deploying on web (shared) hosting

default discord avatar
baskin92 years ago
2

Hello everyone :),



I am a newb and not that familiar with Payload, so got stuck with my first deploy..



I have got a shared hosting with node.js support and trying to run Payload CMS right there. But after building the instance, uploading the two folders, build and dist, and running the command 'node dist/server.js', I have got an error 'Cannot find module express'.



So I install the express locally. Then it says I need Payload module, then bundler-vite, then db-mongodb etc, etc, etc..



Do I really need all that huge 800 MB folder with all the modules to run Payload CMS on a web hosting? Or, I am doing something wrong?



Any help would be appreciated a lot.

  • default discord avatar
    joshcoady2 years ago

    if you can run commands on your shared server, upload your package.json and package-lock.json and then then npm ci --production



    if you cant, then run npm ci --production on your local ... it will wipe out your node_modules and install only what is needed to run the site (no dev dependencies), which should be a little smaller. Then upload node_modules

  • default discord avatar
    baskin92 years ago

    Thank you very much for the advise! I will try this

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.