I’ve verified that indeed we’ll face some issues when installing Node-RED on buster.
Therefore, I will attach my ways of solving this problem.
1. Using Docker
Node-RED support running in a docker container. So you can use docker to host a Node-RED service. On buster, for your reference, I’ll attach a link on how to install docker on Raspberry Pi:
Docker Doc - Install Docker Engine on Raspberry Pi OS (32-bit)
I followed their documentation and installed docker successfully.
(I logged in my EdgeBox via ssh)
- Uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
- Set up Docker’s
apt
repository.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/raspbian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/raspbian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
A screenshot of previous actions:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Verify that the installation is successful by running the
hello-world
image
sudo docker run hello-world
Note: If you encounter some errors regarding to permissions, please add the current user to docker
group
sudo usermod -aG docker $USER
newgrp docker
If this won’t work, restart a new terminal or reboot and try again.
-
For the rest part, I followed the Node-RED official document to run Node-RED in docker. The link:
Running under Docker
-
Using the following command to pull the docker image and start your container:
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered --security-opt=seccomp=unconfined nodered/node-red:latest
If you don’t know the meaning of this command, don’t worry, please follow the Node-RED documentation, they provide detail explanations and extra operations with docker.
One thing need to be mentioned, when using the docker run
command on buster
, I faced some wired errors, then I did some research, some people told that extra --security-opt=seccomp=unconfined
is needed.
nodered/node-red:3.0.0 does not run on raspberry pi / Raspbian
Still, it’s because the buster is too old…
- When the terminal pops the IP address and some other info, you should be able to access Node-RED via a web browser.
Another thing need to mention here, it seems that the default chromium
browser in buster
won’t work. I assume it’s the same problem that the version is too old. Then I switched to firefox
and everything went well.
The above screenshot I captured is running in native firefox in pi
.
sudo apt install firefox-esr -y
Here’s the chromium’s screenshot:
I’ve also tested it on my desktop. It also worked well(You need to manually type your pi’s IP address).