Running on startup (PM2 preferably)

  • Hey everyone!

    I'm following the docs (I think they are a bit outdated in some places) and by the end of the installation it says I can start the server with a systemctl call like this:

    sudo service nodebb start

    But the service doesn't exist after the installation process. I tried using the service file provided in the docs, but the command is wrong (it needs to pass the start argument) and it doesn't work (no errors, but the server is not up).

    I'm setting it up on Digital Ocean, and I'm planning on using Nginx to manage SSL and other redirections we need to implement. On their guides, they recommend using PM2 and I actually quite like it. I managed to setup the NodeBB process using:

    pm2 start /opt/nodebb/nodebb -- start

    But using pm2 monit I can see the server constantly restarting with a SIGINT. The app is serving the page on the right port, everything is working fine, but the monitor shows that the app is constantly restarting. I tried using loader.js instead of nodebb start and it errors out after 15 restarts, and executing pm2 with -x (loader or nodebb) doesn't change anything.

    Is there a correct way of setting up NodeBB as a service, preferably using PM2?

  • Global Moderator

    You should just use app.js instead of loader or NodeBB if you're using pm2. Nobody here uses pm2 to run NodeBB because it's not very compatible with our clustering method.

Log in to reply

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.