# Auto start node-red in ubuntu

**URL:** https://discourse.nodered.org/t/auto-start-node-red-in-ubuntu/17627
**Category:** General
**Created:** [7 November 2019 09:59 UTC](https://discourse.nodered.org/t/auto-start-node-red-in-ubuntu/17627 "2019-11-07T09:59:07Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![khoat0](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khoat0/32/46207_2.png) [@khoat0](https://discourse.nodered.org/u/khoat0)
#### Post date: [9 August 2021 12:14 UTC](https://discourse.nodered.org/t/auto-start-node-red-in-ubuntu/17627/6 "2021-08-09T12:14:54Z")

</div>

I found another support :

# Autostart Node-RED on Boot

To make Node-RED autostart when you boot or restart your Virtual Machine, you need to create a new _systemd_ file for the nodered.service:

```auto
sudo nano /etc/systemd/system/nodered.service

```

Then, add the following (if you’re using root, you can leave the file as it is – otherwise comment the root and configure the non-root user option):

```auto
[Unit]
Description=Node-RED
After=syslog.target network.target

[Service]
ExecStart=/usr/local/bin/node-red --max-old-space-size=128 -v
Restart=on-failure
KillSignal=SIGINT

# log output to syslog as 'node-red'
SyslogIdentifier=node-red
StandardOutput=syslog

# non-root user to run as
#WorkingDirectory=/home/rui/
#User=rui
#Group=rui

# if using a root user
WorkingDirectory=/root/
User=root
Group=root

[Install]
WantedBy=multi-user.target

```

Your file should look like this, save it and exit (Ctrl+X, Y, Enter key).

 ![Digital Ocean Installing Node-RED autostart on boot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e76a247c66e89e5f328b5f02d3511fa2cf5fcb4f.png)

To enable the Node-RED service and run this file on boot, enter the command:

```auto
sudo systemctl enable nodered.service

```

Restart your Virtual Machine to test if Node-RED is automatically starting on boot:

```auto
sudo reboot

```

Wait approximately 2 to 3 minutes for your server to fully restart, when you open your server IP address Node-RED software should load automatically:

```auto
http://YOUR-Digital-Ocean-IP-Address:1880

```

 ![Digital Ocean Node-RED Installed testing](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6ca94b3c0ff2aa9350d85fd11b04d6773ed1c130.png)

That’s it! Your Node-RED software is prepared.

I succeeded, your instructions are sketchy ( [Running on Raspberry Pi : Node-RED (nodered.org)](https://nodered.org/docs/getting-started/raspberrypi)

---

_[View the full topic](https://discourse.nodered.org/t/auto-start-node-red-in-ubuntu/17627)._
