Running 2 servers at the same time

default discord avatar
taun2160
last month
5

Hi. How can I run the Payload server as well as the Nextjs server locally, simultaneously?



host:3000 & 4000



I'd like to fetch Payload data for Nextjs server.

  • discord user avatar
    seanzubrickas
    Payload Team
    last month

    Hey @taun2160 are you using one of our frontend repos?

  • default discord avatar
    christopher.nowlan
    last month

    @taun2160 yes. I usually have nextjs and payload in two separate repositories. I run PayloadCMS on port 8000 and Next JS on Port 3000

  • default discord avatar
    taun2160
    last month

    Thanks. How do you run them together? When I run another one on a different port the other server stops (I guess it stops when I close VSCode and open the other repo? Sounds illogical?)

  • discord user avatar
    seanzubrickas
    Payload Team
    last month

    What you should do is have two terminal consoles open in VSCode, one in your root directory for the frontend, one in the root of the backend, and then you can run them simultaneously

  • default discord avatar
    christopher.nowlan
    last month

    @taun2160 what @seanzubrickas is correct.

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

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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