I recently moved the CMS for my website from Prismic to self-hosting with Payload and I currently only have it running in my Coder development environment. I'm eventually going to stick it in a Docker container, but for now I don't want to fuss with that.

I just want to keep it running in Coder. But I also don't want to have to keep a terminal open, which is normally required when running npm start. By running the command below I'm able to effectively run npm start in detached mode, similar to running docker compose up -d .

bash

nohup npm start &

nohup tells the process to keep running, even when the current terminal session is closed and & runs the current command (npm start) in the background.