# FTP static dashboard to web server

**URL:** <https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755>\
**Category:** Dashboard\
**Created:** [4 June 2020 08:07 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755 "2020-06-04T08:07:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bayesey](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bayesey](https://discourse.nodered.org/u/bayesey)\
**Post date:** [4 June 2020 08:07 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/1 "2020-06-04T08:07:25Z")

</div>

Hi

Is it possible to regularly send either a static version of the web page or an image of a node red dashboard to my web host?  
This means I could display my dashboard to the public without exposing my internal network.

Thanks

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [4 June 2020 09:37 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/2 "2020-06-04T09:37:15Z")

</div>

You can use for example Puppeteer in a Node.js script for this. The below script has been tested on a Raspberry Pi 4.

**Prerequisites**

- Chromium is installed (not required if running on i686 CPU and not on a Raspberry Pi)
- Puppeteer is installed: `npm install -g puppeteer`

```auto
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    executablePath: '/usr/bin/chromium-browser'
  });
  const page = await browser.newPage();
  await page.goto('http://localhost:1880/ui');
  await page.waitFor(5000);
  await page.screenshot({path: 'dashboard.png'});
  await browser.close();
})();

```

If you're running an i686 environment, you don't need to separately install Chromium and can remove the `executablePath` part and just call `await puppeteer.launch()`. This should create a `dashboard.png` screenshot in the folder you run the script in. You could call this script from Node-RED using the exec node and use a file watch node to trigger upload when the screenshot is updated.

You can adjust the `waitFor` time in milliseconds to be as long as needed for the dashboard to fully load.

---

<div class="post-metadata">

**Author:** ![bayesey](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bayesey](https://discourse.nodered.org/u/bayesey)\
**Post date:** [4 June 2020 09:38 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/3 "2020-06-04T09:38:50Z")

</div>

Thanks. I'll give that a try on my pi 3

---

<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:** [4 June 2020 09:39 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/4 "2020-06-04T09:39:37Z")

</div>

@ristomatti I don't think that is what @bayesey is asking for.

The question is whether it is possible to upload a Node-RED dashboard to a static webhost, to avoid having to expose Node-RED to the internet.

The short answer is - no. The Node-RED dashboard is not a static webpage that can be copied around like that. It is a full web application that requires the node-red runtime to serve the content and handle all of the interactions.

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [4 June 2020 09:44 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/5 "2020-06-04T09:44:23Z")

</div>

He mentioned an image of it would be enough. I figured creating a static copy would be difficult or even impossible so I went for the screenshot solution.

---

<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:** [4 June 2020 09:45 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/6 "2020-06-04T09:45:23Z")

</div>

> [@ristomatti](#):
>
> He mentioned an image of it would be enough

Ahh yes - time for another cup of tea.

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [4 June 2020 09:47 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/7 "2020-06-04T09:47:19Z")

</div>

If you get it working, you can find the full Puppeteer documentation here: [https://github.com/puppeteer/puppeteer/blob/v3.3.0/docs/api.md](https://github.com/puppeteer/puppeteer/blob/v3.3.0/docs/api.md)

There's likely an option for the browser window size for example if you want the screenshot to be of a specific size.

---

<div class="post-metadata">

**Author:** ![bayesey](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bayesey](https://discourse.nodered.org/u/bayesey)\
**Post date:** [4 June 2020 09:48 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/8 "2020-06-04T09:48:35Z")

</div>

A screenshot would be acceptable but a web page would be better. I can create a webpage displaying the screenshot on the web host.  
I guess another approach might be to run a python script that reads the values from a CSV created by node red and output a static page from that 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:** [4 June 2020 09:51 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/9 "2020-06-04T09:51:09Z")

</div>

you mean... create a dashboard ! 🙂

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [4 June 2020 09:51 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/10 "2020-06-04T09:51:52Z")

</div>

Well if it doesn't need to look like the dashboard, then you'll gave plenty of options to fetch the required data and display it in any way you want.

I would then likely create a http in node in Node-RED to expose an endpoint where you could fetch the data as JSON. Then you could get the data directly on the custom page using JavaScript.

---

<div class="post-metadata">

**Author:** ![bayesey](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bayesey](https://discourse.nodered.org/u/bayesey)\
**Post date:** [4 June 2020 09:53 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/11 "2020-06-04T09:53:23Z")

</div>

Pretty much, yes. Maybe I just query my particle photons variables on the cloud and create my own dashboard with plotly or something. Leave node red for my grafana dashboard at home.

---

<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:** [4 July 2020 09:53 UTC](https://discourse.nodered.org/t/ftp-static-dashboard-to-web-server/27755/12 "2020-07-04T09:53:26Z")

</div>

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