Run node main.js linux startup

Hello,

I have a raspberry running as local server Spark, everything is working. but whenever I turn on the server have to type “node main.js” I want to know how do I put this command running on Linux startup. I did a test but gives error because run as administrator and should run as normal User. I hope that one’s friends can help me.

This can be resolved using a systemd service. See the link for an example. A quick google search for systemd will yield plenty of educational options.

Good luck,

Brent

1 Like