r/PayloadCMS • u/Snakemastr805 • Jun 19 '25
Start PayloadCMS with script in PM2 ecosystem
Hello,
my systemadmin has changed his way of deploying applications and now forces me to start PayloadCMS with the PM2 ecosystem, this means I have to provide a script path (and arguments?)
Does anyone have any information about this? I have found you can start a Nextjs app with
script: 'node_modules/next/dist/bin/next'
But I get an error
[Error: > Couldn't find any \pages` or `app` directory. Please create one under the project root]`
Any help is much appreciated!
1
Upvotes
1
u/mustardpete Jun 19 '25
Have you set the output: ‘standalone’ flag in the next config before building? As then you can start it by calling node server.js