===How to run/work with production mode for NodeJS Apps=== **Important - Before running your app in production mode, kindly test your app in development mode first. Only after extensive testing, you may then use the production mode.** **Step 1 :** Log into N99panel. From under N99panel dashboard, click 'Node.js' {{:nj2:nj2-nodejs.png?direct&400|}} \\ **Step 2 :** Now click 'Node.js (app/production mode)' {{:nj2:s1-click-production-mode.png?direct&400|}} \\ **Step 3 :** Now click 'Add a Node App (apps mode)' {{:nj2:s2-click-add-node-app-prod-mode.png?direct&400|}} **Step 4 :** Fill in the form as under {{:nj2:s3-prod-mode-form.png?direct&400|}} \\ **Important points :**\\ - Select the User/VHost (website)\\ - Enter the ‘App Web path’ . This would be like /app1 or /app2 or it can even be the website root i.e. /\\ - Enter the ‘App Port’ . The port on which your App runs . You need to ensure that your App listens on interface 0.0.0.0 instead of 127.0.0.1 or localhost which typically are used\\ - Select the ‘App Mode/Initiation’. It will be one of - 'node' command - 'npm start' command - 'npm run dev' command - A command after 'npm' - Under the Production filesystem path, enter the folder containing the app w.r.t. /home/{username}/node_apps/ . So in our case it is app1 with App mode/initiation set to 'npm start' . But if our app had to be initiated via node command, then production filesystem path will be app1-project/index.js - Also finally select the Nodejs version that you wish to use with the App - If you app use .env file(s), please provide its full path under 'Env Files' box. You may enter multiple .env files, one on each line - Also if you wish, you can expose other directories of the user to your app. Lets say you are storing PDF files in /home/bluser/pdf-files , then in the box 'Other Directories' box you need to enter pdf-files . Multiple folders/directories can be exposed, one on each line. In production mode the Node app runs w.r.t. system path reference. **To put it simply you need to ensure that any file references in your code, are absolute and not relative.** Lets say your Node app start point is /home/bluser/node_apps/app1-project/index.js , and your index.js refers to contents.json , you would need to change it to /home/bluser/node_apps/app1-project/contents.json . With the above steps, you have mapped the web-server's VHost/Website’s URL part to the to the specified port of the App, which will be launched by our environment from the specified source folder **If your App is not working as expected, please visit the following article in order to debug it in production mode : [[:nodejs:production-mode-debug|How to debug NodeJS apps in production mode]]**\\ To manage the App process, you can do the same from within Dashboard » Node.js (apps mode) » Manage App State (apps mode)