How can I deploy a Payload app in a droplet?

default discord avatar
6 months ago

Hi! Today I tried to deploy a Payload app using docker and PM2 in ubuntu 16, in a DigitalOcean VPS, but I still getting issues, in case of PM2 when I ran "yarn build" and "pm2 start dist/server.js" it returns in "payload.config.js is not found" and in case when I ran docker compose it doesn't return any issue, but when I tried to access to the website it never loads.

  • default discord avatar
    6 months ago

    Using the javascript template specifically I had to go in and manually change the pathing for most of the commands. By default, they lead to 'src/' when the structure of the template was './'

  • discord user avatar
    Payload Team
    6 months ago

    yeah if you can't find your Payload config, make sure you have an


    variable that points directly to your production Payload config

    generally our production start command includes setting the


    like so:

        "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js",

    do you have something like this? and if so, is your config truly located where your env is telling it to be found? in the above case, it's

  • default discord avatar
    5 months ago

    I have added the URL of my app to env file and It works fine! It was the issue

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.