Node-RED GitHub Integration
This guide will help you create a Node-RED project, push it to GitHub, and maintain flow versions. It includes video tutorials and step-by-step instructions, derived from here.
Creating a Node-RED Project and Pushing to GitHub | Explained in 5 mins | Maintaining Flow Versions
Important: To login to your GitHub account in Node-RED, follow step 4 below. The method shown in the video no longer works.
Steps to Create and Push a Node-RED Project to GitHub
1. Install Git
Go with all the default settings.
2. Modify settings.js File
To enable project support in Node-RED, you need to modify the settings.js file.
Locate
settings.jsIf you're using Windows and installed Node-RED with the default settings, the
settings.jsfile is typically located inC:\Users\<YourUsername>\.node-red. Replace<YourUsername>with your Windows username (e.g.,Admin).Edit
settings.jsUse a text editor like Notepad++ to open the
settings.jsfile.Find the
editorThemesection. If you have a current version of Node-RED (as of May 2024), theprojectssetting should already be present.Change
enabled: falsetoenabled: true.
3. Create a Node-RED Project
Open Node-RED:
Start Node-RED by running
node-redin your terminal or command prompt.Open Node-RED in your web browser at
http://127.0.0.1:1880/.Create a New Project:
Click on the menu button (three horizontal lines) in the top right corner.
Select
Projects→New ProjectFollow the prompts to create your project. You can initialize it with a Git repository.
4. Connect Node-RED to Github
To push your Node-RED project to Github, you need to connect Node-RED to your Github account.
Login to GitHub:
During your project setup, you will be prompted to log in to your GitHub account.
Use your GitHub username.
Use a Personal Access Token:
For the password, use a Personal Access Token (classic) instead of your GitHub password.
Create a personal access token by following the GitHub guide.
5. Push Your Project to GitHub
Commit Your Changes:
Make changes to your Node-RED flow and commit them using the Node-RED interface.
Push to GitHub:
Push your commits to the GitHub repository directly from Node-RED.