This guide provides instructions on how to deploy Node-RED using Docker, including how to manage flows and install additional libraries.
To start Node-RED using Docker, navigate to the Node-RED directory and use Docker Compose:
cd node-red
docker compose up
Flows are stored outside the container in the default Node-RED directory. To access your flows, navigate to:
/home/pi/.node-red/data/lib/flows
This location will typically be ~/.node-red/data/lib/flows
on your filesystem.
If you wish to install additional Node.js libraries:
-
Navigate to the Node-RED data directory:
cd ~/.node-red/data
-
Add your dependencies to the
package.json
file located in this directory. -
Run the following command to install the dependencies:
npm install
If you encounter any permission issues, particularly when accessing files or directories, you can modify the permissions recursively using chmod
. Note: Use this command with caution as it grants wide permissions.
sudo chmod -R 755 ~/.node-red/data # Permissão apenas quem criou
sudo chmod -R 777 ~/.node-red # Permissão todos usuarios
Following these instructions should help you set up and manage your Node-RED instance within a Docker container. For more detailed information on Node-RED and Docker integration, refer to the official Node-RED documentation.