logo elektroda
logo elektroda
X
logo elektroda

Hosting OpenBeken Webapp Locally with Docker on Various Operating Systems

taktlos  23 4629 Cool? (+3)
📢 Listen (AI):

TL;DR

  • A Docker image hosts the OpenBeken IoT Web App locally on Linux or Windows, letting an OpenBeken device redirect to a LAN-based file repository.
  • The app loads startup.js, which starts VueJS and then myComponent.vue, with each page implemented as a separate VueJS Single File Component.
  • Container setups expose port 7231 and come in four flavours, from node:18-alpine at 73 MB to alpine at 9 MB, with amd64, arm32, and arm64 support.
  • The result is local hosting with OTA updates, device filesystem management, configuration, and logging, while some variants need internet at container start or lack the standalone web app.
Generated by the language model.
Docker Image for OpenBeken IoT Web App Hosting

source code: OpenBekenIOT Web App

Designed for hosting an IoT web application, this Docker image initiates from a simple webpage at http://(IP):PORT/ on the device. The device redirects to a default repository, but with device configuration, local hosting on your LAN is possible for enhanced security.

Key Components:

Web App Structure:
The app root page loads startup.js, initiating VueJS.
startup.js further loads myComponent.vue, the core of the web app.
Each page of the app is a separate VueJS Single File Component (SFC).

Versatility in Hosting:
Redirects to a default repository, configurable for local hosting on LAN or from the device filesystem.

Rich Features:
Over-The-Air (OTA) updates for seamless enhancements.
Device filesystem management for efficient file handling.
Device configuration for personalized settings.
Logging capabilities for effective monitoring.

This Docker image streamlines the deployment of an OpenBeken IoT web application, offering flexibility in hosting options and a robust feature set for an enriched user experience.


Easy Local Web App Hosting with Docker!

Ready to effortlessly share files locally? This Docker image, crafted with Alpine, Node, and OpenBeken magic, makes it a breeze! Whether you're on Linux or Windows, turn your computer/server into a 24/7 host.

Simple Steps:


1. Get Ready:
Make sure Docker is installed on your system.

2. Run Docker Magic:
Log in with Docker execution privileges.

Run this command:
Code: Bash
Log in, to see the code


This downloads the image and launches the container, exposing port 7231. Adjust the port according to your preference, ensuring alignment with application settings.

Screenshot showing HTTP server configuration.

3. Change URI address of hosted files(In my case files are hosted on computer with hostname: server):
Please visit the specified page, and following that, proceed to adjust the settings on your device at the provided address (in this instance, it is the hostname of my IoT OpenBeken device).
Code: Bash
Log in, to see the code


Here, the address of our local server, which stores files for us, is entered.

OpenBeken IoT web application configuration page with a URL input box.

4. Check the results

With those steps completed, the configuration process should now be finished.



Upon successful execution of the plan, the following is expected in the web browser:
Screenshot of the OpenBeken IoT configuration interface highlighting the web app URL.

On the server side within the Docker/container environment:
Screenshot showing http server logs running in a Docker environment for the OpenBeken IoT application.

If there are significant updates to the web app, the Docker image will be promptly refreshed to ensure users can benefit from the latest features and improvements. If you have any further questions or need assistance in the future, feel free to reach out.

[EDIT]

Different flavours of images available:

Code: Bash
Log in, to see the code

Based on image: node:18-alpine
Based on npm http-server: YES
Image approx. size(compressed): 73 MB
Architecture available: amd64, arm32, arm64
Stand-alone version with Web App included: YES
Update of Web App by pulling new image: YES
Required Internet connection during container starts: NO

Code: Bash
Log in, to see the code

Based on image: alpine:3.15
Based on npm http-server: YES
Image approx. size(compressed): 29 MB
Architecture available: amd64, arm32, arm64
Stand-alone version with Web App included: YES
Update of Web App by pulling new image: YES
Required Internet connection during container starts: NO

Code: Bash
Log in, to see the code

Based on image: node:alpine
Based on npm http-server: YES
Image approx. size(compressed): 53 MB
Architecture available: amd64, arm32, arm64
Stand-alone version with Web App included: NO
Update of Web App by restart of container: YES
Required Internet connection during container starts: YES

Code: Bash
Log in, to see the code

Based on image: alpine
Based on Apache Web Server: YES
Image approx. size(compressed): 9 MB
Architecture available: amd64, arm32, arm64
Stand-alone version with Web App included: NO
Update of Web App by restart of container: YES
Required Internet connection during container starts: YES

About Author
taktlos wrote 21 posts with rating 9 , helped 4 times. Been with us since 2008 year.

Comments

p.kaczmarek2 20 Dec 2023 08:08

That's a very useful guide for people who want to have Web App working on the closed network without access to the internet. Still, I think it's important to add, that if you just want to make your own... [Read more]

taktlos 20 Dec 2023 09:20

I completely agree. The premise of creating this image was to have devices based on OpenBeken firmware completely offline. OpenBeken frees us from the Tuya cloud, and a locally hosted container ultimately... [Read more]

p.kaczmarek2 20 Dec 2023 09:27

It should be fully possible to host that web app on the OBK device itself, but it would make updates problematic. Futhermore, I haven't tested the size of web app files in a long time, so they might have... [Read more]

taktlos 20 Dec 2023 10:44

I see which means this leads us to a small walkaround: Image: closed0beta/openbeken_webapp_http-server Contains all necessary files and depends on my updates Command to run: docker run -p... [Read more]

Angel0fDeath 06 Jan 2024 20:25

@taktlos It looks like this could be run on linux/amd only. Probably is good idea to be able to run on linux/arm also... [Read more]

taktlos 07 Jan 2024 10:26

Great suggestion! I've created an extra image for arm64, expanding platform support to two options: amd64 and arm64. [EDIT] Additional image for arm32 aka arm v7 due to Alpine version 3.15 Command... [Read more]

Angel0fDeath 07 Jan 2024 16:43

@taktlos As far as I know, Alpine 3.15 was outdated - I think at some point in November last year (2023). Nevertheless, the web page is not so complicated to require more. Works perfect, so everything... [Read more]

taktlos 07 Jan 2024 17:16

Ok then. ARMv6 and ARMv7 build(32-bit) based on: Alpine Linux version: 3.19.0 Nodejs version: v12.22.9 Node version: v21.4.0 Npm version: 10.2.5 Command to run: docker run -p 7231:80... [Read more]

Angel0fDeath 07 Jan 2024 18:30

@taktlos Something wrong with port publishing in the last version. https://obrazki.elektroda.pl/1913623100_1704648523_thumb.jpg without restart=always container stops after few seconds. With... [Read more]

taktlos 07 Jan 2024 19:38

All right, so the earlier obsolete version of Alpine Linux back in business. Alpine Linux version: 3.15 Nodejs version: 16.20.2-r0 Npm version: 8.1.3-r0 [Read more]

Angel0fDeath 07 Jan 2024 20:24

https://obrazki.elektroda.pl/5066074700_1704655680_thumb.jpg Yep. With outdated Alpine - everything is ok. I think the problem is with my docker - v 20.10.15 for wdmycoudex4100 dated May 2022....... [Read more]

jkwim 22 Jan 2024 19:12

Hi, Finally I am getting at incorporating the Webapp in a private network with no internet access. To go one step further, I want to know whether the "Logs" option can be implemented via the device... [Read more]

taktlos 23 Jan 2024 09:15

Hi, You have to ask person responsible for a web app development. Ie. github? This topic is about containeerized version only. [Read more]

jkwim 23 Jan 2024 17:22

I tried creating the files in LittleFS. https://obrazki.elektroda.pl/7881742300_1705998279_thumb.jpg I edited the paths so that everything gets referenced from / (no sub directories). As... [Read more]

Angel0fDeath 23 Jan 2024 19:37

@jkwim You most probably would like to check LittleFS size rather than firmware flash size. In web app -> logs run command lfs_size it will return size in bytes (hex). By me this returns 0x8000, which... [Read more]

p.kaczmarek2 23 Jan 2024 20:17

@jkwim please open another topic and we can look into that together, but long story short, LittleFS could have even 500kB or so, but it would need to be shifted to the OTA space, and then OTA would wipe... [Read more]

jkwim 25 Jan 2024 15:21

Opened a new topic as suggested: Hosting OpenBekenIOT Web App's 'Logs' function in the LittleFS of the Device (BK7231T) [Read more]

taktlos 28 Jan 2024 14:41

Different flavours of images available: closed0beta/openbeken_webapp_http-server:latest Based on image: node:18-alpine Based on npm http-server: YES Image approx. size(compressed): 73 MB Architecture... [Read more]

Angel0fDeath 28 Jan 2024 17:01

Well, that's a good work. Thank you. [Read more]

FAQ

TL;DR: 32 KB default LittleFS space can be expanded up to 512 KB, and Docker images as small as 9 MB let you serve OpenBeken fully offline—"The premise of creating this image was to have devices based on OpenBeken firmware completely offline" [Elektroda, Angel0fDeath, #20925110; Elektroda, taktlos, #20869677].

Why it matters: Self-hosting removes Tuya and cloud dependencies, boosting privacy and speed on any LAN.

Quick Facts

• Smallest image: 9 MB alpine/Apache build, pull tag http-server_minimal [Elektroda, taktlos, post #20933221] • Full offline image: 73 MB node:18-alpine, tag http-server [Elektroda, taktlos, post #20933221] • Supported CPU arches: amd64, arm32, arm64 for all variants [Elektroda, taktlos, post #20933221] • Default container port: 80 → host 7231 (adjustable with -p) [Elektroda, taktlos, post #20868576] • Default LittleFS size: 0x8000 = 32 KB; change with lfs_format [Elektroda, Angel0fDeath, post #20925110]

Which Docker image should I choose for local, offline hosting?

Use closed0beta/openbeken_webapp_http-server:latest. It embeds the full web app, needs no internet, and supports amd64/arm32/arm64 [Elektroda, taktlos, post #20933221]

How do I run the container so it auto-starts after a reboot?

  1. SSH to your host.
  2. Execute: docker run -d --restart unless-stopped -p 7231:80 closed0beta/openbeken_webapp_http-server:latest
  3. Verify with docker ps. This flag keeps the service up unless you stop it manually [Docker Docs].

Does the image work on Raspberry Pi or other ARM boards?

Yes. Multi-arch manifests cover arm32 and arm64. For older Pi Zero (ARMv6/v7) pull tag openbeken_webapp_http-server_arm32 [Elektroda, taktlos, post #20895559]

How can I update the web app without pulling a new image?

Use tag http-server_startup or http-server_minimal. Both download fresh files from GitHub on every container start, saving bandwidth and disk space [Elektroda, taktlos, post #20869772]

Can I host the app totally offline?

Yes. The http-server image contains all static files and needs zero internet once pulled. Point your device to http://:7231 in /cfg_webapp [Elektroda, taktlos, post #20868576]

Is there an alternative to Docker for static hosting?

You can deploy the same build on GitHub Pages (free) or Home Assistant’s built-in HTTP server for quick setups [Elektroda, p.kaczmarek2, post #20869616]

What’s the smallest image size available?

closed0beta/openbeken_webapp_http-server_minimal compresses to about 9 MB while still autoupdating from GitHub on boot [Elektroda, taktlos, post #20933221]

How do I enlarge LittleFS to store extra JS files?

Run lfs_format , e.g., lfs_format 0x80000 for 512 KB, then reboot. Note: the command consumes OTA space and OTA will wipe LFS on update [Elektroda, p.kaczmarek2, post #20925206]

Will a 512 KB LFS still allow OTA updates?

Yes, if the OTA file stays under the remaining 512 KB (current BK7231T OTA ≈ 494 KB) [Elektroda, Angel0fDeath, post #20925110] Larger firmware will fail to flash until you shrink LFS.

How can I attach two networks in QNAP Container Station?

Create an extra Virtual Switch, assign it to Adapter 3 (IoT LAN), then add a second network interface in Container Station. Greyed adapters mean they’re already bound; detach them from other containers first, then retry [QNAP KB].

Where are the web app’s entry files?

startup.js loads Vue and the Single-File Components; myComponent.vue acts as root. Each page is a separate .vue file [Elektroda, taktlos, post #20868576]

3-step quick-start recap?

  1. Install Docker.
  2. docker run -d --restart unless-stopped -p 7231:80 closed0beta/openbeken_webapp_http-server:latest
  3. On the OBK device, open /cfg_webapp and set http://:7231. Done—files now serve locally.
Generated by the language model.
%}