# Linux SystemD help please

**URL:** <https://discourse.nodered.org/t/linux-systemd-help-please/69855>\
**Category:** General\
**Created:** [31 October 2022 18:22 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855 "2022-10-31T18:22:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyder0552](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spyder0552/32/14035_2.png) [@spyder0552](https://discourse.nodered.org/u/spyder0552)\
**Post date:** [31 October 2022 18:22 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855/1 "2022-10-31T18:22:08Z")

</div>

I am doing something really dumb but can't figure it out.  
I need to run numerous instances of Node-Red. As such, I have under my /home/myusername 2 folders "nr1" and "nr2".  
I have run npm i node-red in each of those sub folders and it installs node-red.  
In each of those, I have modified the settings.js file to set the ports to 1880 and 1881 as well as the home directory to be /home/myusername/nr1 and nr2.

So, if I manually issue /usr/bin/node /home/myusername/nr1/node\_modules/node-red/red.js Node-Red fires right up.  
Now here is the problem. I want to start these via systemd. So, I have created a "nr1.service" file with the following information:

[Unit]  
Description=Node-Red for NR1  
Documentation=[Documentation : Node-RED](http://nodered.org/docs)  
After=syslog.target network.target

[Service]  
Type=simple  
ExecStart=/usr/bin/node /home/administrator/nr1/node\_modules/node-red/red.js  
WorkingDirectory=/home/administrator/nr1  
Nice=10  
Restart=on-failure  
KillSignal=SIGINT  
ProtectSystem=full

[Install]  
WantedBy=multi-user.target

When I try to start the service, it says permission denied on /home/nr1. I checked my settings file and I did have that in there (was a typo). I have since changed it to be /home/myusername/nr1/ but that does not solve things.

Any ideas as to what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [31 October 2022 20:28 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855/2 "2022-10-31T20:28:59Z")

</div>

Hi, been a long day today for me so I can't quite focus on what might be wrong. However, if you check out my alternate installer on GitHub, it contains an annotated example service file that might help.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 October 2022 21:03 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855/4 "2022-10-31T21:03:09Z")

</div>

You also need

```auto
User=administrator
Group=administrator

```

or whatever user/group you want to run the service as.

---

<div class="post-metadata">

**Author:** ![spyder0552](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/spyder0552/32/14035_2.png) [@spyder0552](https://discourse.nodered.org/u/spyder0552)\
**Post date:** [1 November 2022 19:14 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855/5 "2022-11-01T19:14:38Z")

</div>

Everyone was close.  
Coming from a windows world to linux, remember to check your typing.

I had a small typo in my settings.js file that was goofing things up.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 November 2022 19:14 UTC](https://discourse.nodered.org/t/linux-systemd-help-please/69855/6 "2022-11-15T19:14:56Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
