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

2. Modify settings.js File

To enable project support in Node-RED, you need to modify the settings.js file.

  1. Locate settings.js

    • If you're using Windows and installed Node-RED with the default settings, the settings.js file is typically located in C:\Users\<YourUsername>\.node-red. Replace <YourUsername> with your Windows username (e.g., Admin).

  2. Edit settings.js

    • Use a text editor like Notepad++ to open the settings.js file.

    • Find the editorTheme section. If you have a current version of Node-RED (as of May 2024), the projects setting should already be present.

    • Change enabled: false to enabled: true .

3. Create a Node-RED Project

  1. Open Node-RED:

    • Start Node-RED by running node-red in your terminal or command prompt.

    • Open Node-RED in your web browser at http://127.0.0.1:1880/.

  2. Create a New Project:

    • Click on the menu button (three horizontal lines) in the top right corner.

    • Select ProjectsNew Project

    • Follow 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.

  1. Login to GitHub:

    • During your project setup, you will be prompted to log in to your GitHub account.

    • Use your GitHub username.

  2. 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

  1. Commit Your Changes:

    • Make changes to your Node-RED flow and commit them using the Node-RED interface.

  2. Push to GitHub:

    • Push your commits to the GitHub repository directly from Node-RED.

By following these steps, you can effectively manage your Node-RED projects and version control your flows using GitHub.