Auto Start Node server on Boot

Post Reply
Posts: 1
Joined: Wed Mar 29, 2023 9:44 pm

Auto Start Node server on Boot

Post by jasonz » Wed Mar 29, 2023 9:50 pm


I'm currently struggling with auto-starting a node server on boot.

I aim for the device to host a node server and auto-start it by running node server.js command on every boot.

Currently, i have a service file here: /etc/systemd/system/node.service
=== node.service ===
Description=My Node.js App

ExecStart=/usr/bin/node /path/to/your/app.js


I have reloaded daemons and enabled the service with
`sudo systemctl enable node.service`

And the log shows that
`Serving at port 3000`

But whenever i try to access, it shows:
`Cannot get /`

Any help would be appreciated.

Thank you so much!

Posts: 16
Joined: Thu Nov 18, 2021 1:44 pm

Re: Auto Start Node server on Boot

Post by nmichael » Mon Apr 03, 2023 6:17 pm

Is this on the PHL?
I don't know much about node servers, but the Node Red service is set up on the PHL in

Maybe there are some clues from that configuration?

Posts: 115
Joined: Mon Jun 24, 2019 12:51 pm

Re: Auto Start Node server on Boot

Post by tobiasherzke » Fri Apr 07, 2023 5:00 pm

If I understand you correctly, then your log on the PHL shows (1) that your nodejs app has actually started, and (2) that your nodejs app reacts to your connection by logging "Cannot get /". If this is not the reaction that you want, then you need to fix this inside your custom nodejs app, which is a topic not related to openMHA or PHL.

Post Reply