# Node-Red running with balena

**URL:** <https://forums.balena.io/t/node-red-running-with-balena/34718>\
**Category:** Product support\
**Created:** [September 30, 2019, 1:13pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718 "2019-09-30T13:13:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [September 30, 2019, 1:13pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/1 "2019-09-30T13:13:16Z")

</div>

Hi,

Apologies for the onslaught of Newbie questions.

I’m having some issues getting my Node-Red up and running with Balena. When I git push my projects folder I am getting this error:

 ![image](https://global.discourse-cdn.com/balena/original/2X/2/2b0c21e16d87ebfd0ec16afdcae8e485c4078a6c.png)

I’m trying to use this article to set this up but it is outdated, and I don’t really understand how to use Dockerfiles so I am struggling to follow it properly.

Can anyone help me?

Thanks,  
Gregor

---

<div class="post-metadata">

**Author:** ![dansku](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dansku/32/1183_2.png) [@dansku](https://forums.balena.io/u/dansku)\
**Post date:** [September 30, 2019, 1:44pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/2 "2019-09-30T13:44:07Z")

</div>

Hey @gregorr1, could you share the url of the project you are trying to push?  
I would like also to invite you to install the balena-cli instead of using the git push method, you can check the steps to install it here: [https://github.com/balena-io/balena-cli/blob/master/INSTALL.md](https://github.com/balena-io/balena-cli/blob/master/INSTALL.md)

Thanks

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [September 30, 2019, 1:50pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/4 "2019-09-30T13:50:56Z")

</div>

Hi @dansku I’ve added the balena-cli now. What URL is it you’re looking for? Is it my application URL?

What is the command to try and push from balena-cli?

---

<div class="post-metadata">

**Author:** ![jviotti](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jviotti/32/220_2.png) [@jviotti](https://forums.balena.io/u/jviotti)\
**Post date:** [September 30, 2019, 2:04pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/5 "2019-09-30T14:04:39Z")

</div>

Hey there! My colleague is referring to the GitHub URL of the project you are trying to push, assuming it’s public. Regarding the push command, that should be `balena push` ([https://www.balena.io/docs/reference/cli/#push-applicationordevice](https://www.balena.io/docs/reference/cli/#push-applicationordevice))

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [September 30, 2019, 3:20pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/7 "2019-09-30T15:20:16Z")

</div>

The GitHub URL is private at the moment - I can send copies of our docker file etc. However, they are copied from this [article](https://knolleary.net/2018/09/27/deploying-node-red-applications-to-devices-using-resin-io/).

---

<div class="post-metadata">

**Author:** ![jviotti](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jviotti/32/220_2.png) [@jviotti](https://forums.balena.io/u/jviotti)\
**Post date:** [September 30, 2019, 3:35pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/8 "2019-09-30T15:35:38Z")

</div>

No worries! Lets try `balena push` as @dansku suggested above and see if that makes any difference!

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [September 30, 2019, 3:56pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/10 "2019-09-30T15:56:28Z")

</div>

Hi @jviotti we ran a balena push as suggested, but this gave the same errors. We have since removed this line from our docker file (copied from the article I sent previously):

```auto
pip3 install sense-hat rtimulib pillow

```

We now have successfully been able to push to the Balena.

The next step is now sorting out our docker file so that our Node-Red program starts automatically. Can you point me in the right direction?

Thanks

---

<div class="post-metadata">

**Author:** ![jviotti](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jviotti/32/220_2.png) [@jviotti](https://forums.balena.io/u/jviotti)\
**Post date:** [September 30, 2019, 4:51pm UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/11 "2019-09-30T16:51:32Z")

</div>

I’m glad you made it push! With regards to Node Red, have you checked our Node Red example project [https://github.com/balena-io-projects/balena-node-red](https://github.com/balena-io-projects/balena-node-red)?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 8:19am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/13 "2019-10-01T08:19:45Z")

</div>

Hi @jviotti, I’ve had a look at the example project but I’m not sure the best way to use this to solve my issues. The directories seem to be laid out very different from mine - I’m using the node-red projects feature to manage my git directory. I tried copying over some of the files that I saw for example the Dockerfile.template and the docker-compose.yml but when I ran the balena push it said it couldn’t find a dockerfile.

What is the best way to make sure I have all the necessary parts of the directory, without changing it so much that the node-red projects breaks?

Thanks,  
Gregor

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 8:25am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/14 "2019-10-01T08:25:16Z")

</div>

Hi,

Can you please share with us the content of your Dockerfile.template/docker-compose.yml that you use?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 8:33am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/15 "2019-10-01T08:33:29Z")

</div>

Currently, I’m just using a Dockerfile. When I copied the Dockerfile.template it wouldn’t let me push so I copied the contents to a file called “Dockerfile” and changed the device to raspberrypi4, this wouldnt push so I tried it with raspberrypi3 and it let me push to balena.

```
###
# Build step
###
FROM balenalib/raspberrypi3-debian-node:12-stretch-build as build

RUN JOBS=MAX npm install -g --production --unsafe-perm \
       node-red \
       node-red-admin \
       node-red-contrib-balena

###
# Runtime image
###
FROM balenalib/raspberrypi3-debian-node:12-stretch-run

RUN apt-get update && apt-get install -yq --no-install-recommends \
  rpi.gpio \
  python-dev \
  python-rpi.gpio \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

# Defines our working directory in container
WORKDIR /usr/src/app

# Copy over the files created in the previous step, including lib/, bin/
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules

# This will copy all files in our root to the working directory in the container
COPY . ./

# server.js will run when container starts up on the device
CMD ["bash", "/usr/src/app/start.sh"]
```

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 8:41am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/16 "2019-10-01T08:41:06Z")

</div>

So you can build it now then what is your issue here?  
Our example use docker-compose.yml so you might need to change the `COPY . ./` command to correct directory if you use Dockerfile instead, otherwise it will break the `CMD ["bash", "/usr/src/app/start.sh"]` as start.sh doesn’t exist

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 8:43am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/17 "2019-10-01T08:43:00Z")

</div>

Okay brilliant thanks, I’ve changed the COPY so I’ll try push that to the devices and see if it starts the Node-red.

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 9:13am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/19 "2019-10-01T09:13:39Z")

</div>

The node red still isn’t starting, I checked the logs on the balena dashboard and got this:

 ![image](https://global.discourse-cdn.com/balena/original/2X/0/0568dfcac537cddf0fe18d74166b84de6994cc02.png)

Any ideas how to fix this? I cant see a ResinApp.sh in my project folder so I’m not sure where it is from.

Thanks,  
Gregor

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 9:17am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/20 "2019-10-01T09:17:52Z")

</div>

Looks like Node-red isn’t installed properly, can you please share your Dockerfile or grant support access so I can have a look?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 9:26am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/21 "2019-10-01T09:26:18Z")

</div>

hi @nghiant2710 How do I grant support access?

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 9:29am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/22 "2019-10-01T09:29:54Z")

</div>

You can follow the guide in our docs here [https://www.balena.io/docs/learn/manage/actions/#grant-support-access-to-application](https://www.balena.io/docs/learn/manage/actions/#grant-support-access-to-application) to grant support access

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 9:31am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/23 "2019-10-01T09:31:07Z")

</div>

That should be it done now

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 1, 2019, 9:32am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/24 "2019-10-01T09:32:20Z")

</div>

Can you please send us your device UUID?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 1, 2019, 9:33am UTC](https://forums.balena.io/t/node-red-running-with-balena/34718/25 "2019-10-01T09:33:02Z")

</div>

Device uuid is f8c5a2f211ac5a4ef4015b3f93b234b8

I’ve also noticed that it keeps trying to update my device from release d48e7e6 to a2e744a, but it keeps reverting and trying again.

[Next page](https://forums.balena.io/t/node-red-running-with-balena/34718.md?page=2)
