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.

How can I deploy a Payload app in a droplet?

default discord avatar
japineda162 years ago
3

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
    badjab3262 years 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
    jmikrut
    2 years ago

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

    env

    variable that points directly to your production Payload config



    generally our production start command includes setting the

    PAYLOAD_CONFIG_PATH

    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

    /dist/payload.config.js
  • default discord avatar
    japineda162 years ago

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

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.