# Enable Node-RED to run automatically at every boot and upon crashes on UBUNTU

**URL:** <https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911>\
**Category:** General\
**Created:** [13 February 2019 06:38 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911 "2019-02-13T06:38:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tramanah](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tramanah/32/9122_2.png) [@tramanah](https://discourse.nodered.org/u/tramanah)\
**Post date:** [13 February 2019 06:38 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/1 "2019-02-13T06:38:55Z")

</div>

HI, I did the follow the instruction from website as follows:

```auto
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start
sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop
sudo chmod +x /usr/bin/node-red-st*
sudo systemctl daemon-reload

```

I did enable Node-Red to run automatically at every boot and upon crashes with following syntax: -

```auto
sudo systemctl enable nodered.service

```

I did install in C:\ directory, its doesn't help seems. Please do advice.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 February 2019 07:00 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/2 "2019-02-13T07:00:11Z")

</div>

What error does it crash with?

---

<div class="post-metadata">

**Author:** ![tramanah](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tramanah/32/9122_2.png) [@tramanah](https://discourse.nodered.org/u/tramanah)\
**Post date:** [13 February 2019 07:03 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/3 "2019-02-13T07:03:04Z")

</div>

While i reboot, its doesn't start node-red automatically.

---

<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:** [13 February 2019 07:19 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/4 "2019-02-13T07:19:03Z")

</div>

What does  
sudo systemctl status nodered  
show?  
Can you give a link to the instructions you followed for the install please. Also I don't understand the reference to C: which would suggest you are using Windows.

---

<div class="post-metadata">

**Author:** ![tramanah](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tramanah/32/9122_2.png) [@tramanah](https://discourse.nodered.org/u/tramanah)\
**Post date:** [13 February 2019 07:34 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/5 "2019-02-13T07:34:15Z")

</div>

![status1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c84cde79288eedde1307b0eb8b749d0f660e04df.png)

I did follow as per numbered. Sorry about C:\ (my main pc in window base , actually got nothing to do with C drive)

 ![status%202](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2bbe052bad1af128871fb0ea0c73085c00a6f145.png)

---

<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:** [13 February 2019 08:24 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/6 "2019-02-13T08:24:54Z")

</div>

You can see the node-red log using  
`sudo journalctl -f -n 25 -u nodered -o cat`  
If possible please copy/paste terminal output rather than screenshot. It is easier to read and comment on. You can copy from the terminal using Ctrl-Shift-C.  
Also what do

```bash
node -v
npm -v

```

show. If that shows you are using node.js less than 4.x then that needs to be upgraded. The easiest way to install/upgrade on Ubuntu is to use the Pi install/upgrade script.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 February 2019 09:09 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/7 "2019-02-13T09:09:46Z")

</div>

Did you also continue reading the docs and make the necessary changes to the files ?

#### Changing the systemd environment - running as non-Pi user

To run as a user other than the default `pi` , you need to edit the nodered.service file. To edit this use sudo to edit the file `/lib/systemd/system/nodered.service` and change the lines as indicated by {your\_user} below

---

<div class="post-metadata">

**Author:** ![tramanah](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tramanah/32/9122_2.png) [@tramanah](https://discourse.nodered.org/u/tramanah)\
**Post date:** [13 February 2019 09:22 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/9 "2019-02-13T09:22:29Z")

</div>

Cheers, its working. I do miss out the changing the systemd environment - running as non Pi user.

Do appreciate everyone support.

---

<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:** [13 February 2019 13:55 UTC](https://discourse.nodered.org/t/enable-node-red-to-run-automatically-at-every-boot-and-upon-crashes-on-ubuntu/7911/10 "2019-02-13T13:55:05Z")

</div>

If node-red is installed using the Pi install script (which works well for Ubuntu) then the assumption is made that the install script is run by the user that will be the node-red user. In that case there will be no need to change the systemd script.
