$ cd nodebb<\/pre>\nInitiate the installation by using the following command:<\/p>\n
$ .\/nodebb setup<\/pre>\nAnswer each of the questions. This will install modules from npm and then enter the setup utility.<\/p>\n
Now start NodeBB with this command:<\/p>\n
$ .\/nodebb start\r\n\r\nStarting NodeBB\r\n \".\/nodebb stop\" to stop the NodeBB server\r\n \".\/nodebb log\" to view server output\r\n \".\/nodebb help\" for more commands<\/pre>\n<\/span>Step 7: Create a systemd Unit File<\/span><\/h2>\nThis step will let us run NodeBB as a service within systemd. This allows us to have it start up on boot, as well as run independently of our terminal session.<\/p>\n
If it’s already running, stop NodeBB:<\/p>\n
$ .\/nodebb stop<\/pre>\nIn the next step, we will create a service unit file so that we can run NodeBB as a service.<\/p>\n
Open your text editor (we’ll use nano):<\/p>\n
$ nano \/etc\/systemd\/system\/nodebb.service<\/pre>\nand paste the configuration below:<\/p>\n
[Unit]\r\n Description=NodeBB\r\n Documentation=https:\/\/docs.nodebb.org\r\n After=system.slice multi-user.goal mongod.service\r\n \r\n [Service]\r\n Kind=forking\r\n Person=nodebb\r\n \r\n StandardOutput=syslog\r\n StandardError=syslog\r\n SyslogIdentifier=nodebb\r\n \r\n Setting=NODE_ENV=manufacturing\r\n WorkingDirectory=\/var\/www\/nodebb\r\n PIDFile=\/var\/www\/nodebb\/pidfile\r\n ExecStart=\/usr\/bin\/env node loader.js\r\n Restart=at all times\r\n \r\n [Install]\r\n WantedBy=multi-user.goal\r\n<\/pre>\nSave and exit the file. You now need to reload the daemon so that the system can take the new unit that we created for systemd.<\/p>\n
$ systemctl daemon-reload<\/pre>\nFinally, we can start the NodeBB instance with the command:<\/p>\n
$ systemctl start nodebb<\/pre>\nTo check the status for the NodeBB service you can execute the following command:<\/p>\n
$ systemctl status nodebb<\/pre>\n