How to setup pm2 or supervisor

Hello guys.

I just would like to know how I can start my ghost blog using PM2 or Supervisor.

The only I found to start it was using the cli, which is “ghost start”


When you install Ghost via the CLI, there’s a question about systemd which is a process manager like pm2 and supervisor.

So I installed the ghost site using the command below
ghost install --no-setup-linux-user

so it does not require sudo.
I already have pm2 on my server and the other websites already use it.

I tried looking at the source code of the cli to understand how it starts the server but I was not able to figure it out.

I recommend using systemd because it’s officially supported and because it takes near zero memory since systemd is likely already running.

I used to use a cousin to pm2 called forever and switched everything over to systemd. I appreciated the memory savings as well as the consistency with how my custom services could be managed the same as everything else on the systemd.

From looking at the systemd file, the command you need is:

NODE_ENV=production PWD=/path/to/your/site /usr/bin/node /usr/bin/ghost run
1 Like

@markstos thank you so much buddy! It worked as expected =)