# Node Red deployable file

**URL:** https://discourse.nodered.org/t/node-red-deployable-file/3161
**Category:** General
**Created:** [15 September 2018 06:20 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161 "2018-09-15T06:20:06Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![prashantabellad](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@prashantabellad](https://discourse.nodered.org/u/prashantabellad)
#### Post date: [15 September 2018 06:20 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/1 "2018-09-15T06:20:06Z")

</div>

Hi,  
I am developing node-red flows for an application. How to create a deployable file similar to WAR or .exe file. Also how to deploy the same?

---

<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: [15 September 2018 09:56 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/2 "2018-09-15T09:56:45Z")

</div>

Do you want NR itself in the package? You need to decide between that and having a default NR installation at each destination. Personally, I'd probably recommend a complete package since you can then be certain of the versions and configuration.

To do a complete package, you will need a local NR installation. Create a folder, in it do `npm init` then `npm install node-red --save`. Then create a sub-folder for the userDir. That's the folder that you will use to install nodes for use in your flows (though you can also use the parent folder but then a user can't manage that from the Node-RED admin ui - can also be an advantage in some cases). You will need to set up a command to start Node-RED with the correct userDir, that's in the docs. You will also need to change the default flows.json filename because the standard includes the device name which you won't want. Finally, you will have to decide how you want NR to actually run. npm again gives you a simple option for starting manually but you will need a script of some kind if you want it to always be running - either to create and configure a systemd startup script (for Linux/Mac) or the scheduler on Windows. Alternatively, you could install PM2 along side Node-RED and pre-configure so that once started, it will continue to run.

Everything is predicated on `npm` so you will want to look at how to use that to its full. It allows you to create a package that can then be installed easily on other devices.

---

<div class="post-metadata">

### Author: ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)
#### Post date: [15 September 2018 13:48 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/3 "2018-09-15T13:48:25Z")

</div>

I think you are looking for something like 'Electron' -- one of our contributors has a template project showing how to do this:

> **[natcl/electron-node-red](https://github.com/natcl/electron-node-red)**
>
> Electron Node-RED template. Contribute to natcl/electron-node-red development by creating an account on GitHub.

---

<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: [15 September 2018 15:45 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/4 "2018-09-15T15:45:02Z")

</div>

Electron lets you create an executable client from a Node.JS application. So that would do the trick if you want your end users to run the Node-RED "application" as a thick client. But that isn't necessary as long as Node.js is installed on the client computer. You can still distribute a complete node.js package that includes node-red (and PM2 if desired) with any required nodes and the flows quite easily.

---

<div class="post-metadata">

### Author: ![prashantabellad](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@prashantabellad](https://discourse.nodered.org/u/prashantabellad)
#### Post date: [15 September 2018 16:39 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/5 "2018-09-15T16:39:15Z")

</div>

Thanks, will try the same.

The reason I am looking for an executable or deployable file is

- I want to deploy the solution on end user machine.

- I want the end-user to only able to view the node dashboard and not the node workflow page.

- I do not want end user to access workflow page so that he is not able to touch the code or the nodes

How can this be achieved?

Regards

Prashant

---

<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: [15 September 2018 17:05 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/6 "2018-09-15T17:05:01Z")

</div>

You will need to add a user login to the admin side. Look into the settings.js file. This will prevent users from making deploying any changes but they will still be able to see the flows. AFAIK, there is not yet a way to completely prevent the admin UI. This is due in future releases.

---

<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: [15 September 2018 17:20 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/7 "2018-09-15T17:20:34Z")

</div>

My version is slightly more up to date 😉

> **[dceejay/electron-node-red](https://github.com/dceejay/electron-node-red)**
>
> Electron Node-RED template. Contribute to dceejay/electron-node-red development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)
#### Post date: [15 September 2018 21:20 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/8 "2018-09-15T21:20:37Z")

</div>

Nice idea, I like that, I’ll be intrigued to hear how you get on, and what you decide to do.

---

<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: [15 September 2018 21:41 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/9 "2018-09-15T21:41:20Z")

</div>

You can use the `disableEditor` property your settings file to disable the editor - [https://github.com/node-red/node-red/blob/a8ec032553cc4fa51803b84fff411507c1b4dfa7/settings.js#L156](https://github.com/node-red/node-red/blob/a8ec032553cc4fa51803b84fff411507c1b4dfa7/settings.js#L156)

The HTTP Admin routes will still be available - but they can be disabled by setting `httpAdminRoot` to `false`.

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [16 September 2018 00:15 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/10 "2018-09-16T00:15:41Z")

</div>

What about using docker to do the distribution ? - Give no access to the commandline of the virtual machine and export/map a single virtual directory for data etc, use the other ideas re controlling admin UI access and only give the single port for user dashboard - then have the node autoupdate from a central repository if you want to change any of the nodes etc

Craig

---

<div class="post-metadata">

### Author: ![mapos](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mapos](https://discourse.nodered.org/u/mapos)
#### Post date: [16 September 2018 05:02 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/11 "2018-09-16T05:02:50Z")

</div>

we have the same requirement to deploy or update entire user package.  
i like the container idea, it would be the best solution, the electron one looks more complex and less flexible.  
however we run our NR on raspi and we exeperienced some problems on full gpio/i2c access from NR container. anyone had the same problem or suggestions how to fix?  
we already have influx db and other packaged on container in any case.  
how do achieve the container auto update from central repo?  
m

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [16 September 2018 05:10 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/12 "2018-09-16T05:10:12Z")

</div>

If you were going to do this for a reasonable number of systems/sites you would use one of the container orchestration packages dependant on what your bent is -

> **[Best Container Orchestration Software in 2019 | G2 Crowd](https://www.g2crowd.com/categories/container-orchestration)**
>
> Find the best Container Orchestration Software using real-time, up-to-date data from over 390 verified user reviews. Read unbiased insights, compare features & see pricing for 40 solutions. Request demos & free trials to discover the right product...

Craig

---

<div class="post-metadata">

### Author: ![mapos](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mapos](https://discourse.nodered.org/u/mapos)
#### Post date: [16 September 2018 05:39 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/13 "2018-09-16T05:39:49Z")

</div>

yep, got it  
i’ll try it out this way.  
i think that could also be better to use a container with a complete NR local installation.  
just wonder how all dependencies are managed in a local installation  
we see this as a way to both initially deploy a solution and maintain to user, but also as a way to recover from a system crash, or for HA solutions.  
using docker allows for a better hot swap solution using for example a dual HA raspi system.  
m

---

<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: [16 September 2018 07:27 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/14 "2018-09-16T07:27:45Z")

</div>

You may want to look at [resin.io](http://resin.io). they use containers for maintaining a fleet of devices and have a complete management back end for it..

---

<div class="post-metadata">

### Author: ![mapos](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mapos](https://discourse.nodered.org/u/mapos)
#### Post date: [16 September 2018 08:39 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/15 "2018-09-16T08:39:13Z")

</div>

Yes i know that solution, thats what is needed,  
we would however rather like to have an all-in house solution,  
we already have all the relevant networking, supervision/monitoring features, mainly looking for an easy and safe NR deployement/CC solution

---

<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: [16 September 2018 09:36 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/16 "2018-09-16T09:36:38Z")

</div>

If it's all in-house solution you want then you'll have to build it yourself ....  
The default deploy item in Node-RED is the flow file. It's up to you if you decide to deploy just that to an already existing and managed runtime (maybe inside a container), or the complete runtime container, or wrapped as an electron app, or anything in between.

---

<div class="post-metadata">

### Author: ![mapos](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mapos](https://discourse.nodered.org/u/mapos)
#### Post date: [16 September 2018 10:03 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/17 "2018-09-16T10:03:29Z")

</div>

I agree, and i think the candidate solution is between electron and a container or a mix ..  
the need is being able to keep under control the complete app, which is not only NR itself, so also networking and related monitoring, data bases, low level functions and perhaps specific drivers..  
also disaster recovery feature must be considered, which on remote and unmanned sites is not easy to grant.  
likely the container approach is the best, just need to be verified some specific points about NR and orchestration features.  
we are looking at a docker swarm type of solution, also because the iot approach lead to have a quite number of devices alive also for a single site...so this could be an advantage

---

<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: [16 September 2018 10:11 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/18 "2018-09-16T10:11:20Z")

</div>

Given the extra requirements you've now outlined, I'd agree that a container solution would be best. You might want to look at [kubernetes](https://kubernetes.io/) for the container orchestration part. It seems to be the most popular of the container orchestration tools & is well supported by cloud (Azure & AWS, etc) as well as on-premise solutions.

You will want to look at a DevOps toolchain for managing changes to the containers themselves and, if you need any local data stores, you may need to look at creating a data container as well as a master.

---

<div class="post-metadata">

### Author: ![mapos](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mapos](https://discourse.nodered.org/u/mapos)
#### Post date: [17 September 2018 07:08 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/19 "2018-09-17T07:08:14Z")

</div>

Agree, that the way im moving, in evaluating kubernetes. should start some tests this week ill give some feedback if of interest.  
the main issuse now, apart general architecture design, is to confirm feasibility of NR in a cotainer, and also find smart ways to easy update (not just flows) but the entire environment. there are many dependencies around it to be taken into account, such as openzwave, mraa, boot config, drivers and their compatibility with kernel versions, ui images etc, where solutions such as ansible or simply rsync scripts could help.

---

<div class="post-metadata">

### Author: ![prashantabellad](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@prashantabellad](https://discourse.nodered.org/u/prashantabellad)
#### Post date: [17 September 2018 10:25 UTC](https://discourse.nodered.org/t/node-red-deployable-file/3161/20 "2018-09-17T10:25:16Z")

</div>

Hi,  
Does anyone knows steps for node-red with docker.

- Install node-red on docker

- Deploy node-red application on docker

Regards,

Prashant

[Next page](https://discourse.nodered.org/t/node-red-deployable-file/3161.md?page=2)
