pm2directus

How to start directus using pm2?


Documentation says:

Instead of starting the app using pm2 start hello.js, you can start Directus using pm2 start npm -- start

pm2 start npm -- start

I have tried

pm2 start npm /home/user/my-app/node_modules/.bin/directus start

https://docs.directus.io/guides/installation/ubuntu/


Solution

  • you can add the start script to your package.json file

    "scripts": {                                                   
      "test": "echo \"Error: no test specified\" && exit 1",       
      "start": "directus start"                                    
    },  
    

    Then start it using pm2 start npm -- start