Node-RED: Manage projects

How to use "Projects" in Node-RED

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use Node-RED cloud solution that provides a host of benefits, including:

  • MQTT server included (Mosquitto).
  • Full access to Node-RED admin UI.
  • Node-RED Dashboard included.
  • Unlimited and dedicated SMTP email server included.
  • Effortless updates with just a click.
  • Customisable domain name secured with HTTPS (for example, https://node-red.your-company.com).
  • Optimal performance and robust security powered by a private and dedicated VM.

Save time and simplify your life: it only takes 5 minutes to try Stackhero's Node-RED cloud hosting solution!

"Projects" in Node-RED is an advanced feature that seamlessly integrates Git-based version control into your workflow. By leveraging this functionality, you can efficiently manage and synchronise your flows with external Git repositories, fostering collaborative and structured development practices.

To get started, log in to your Node-RED instance. Locate the "hamburger" menu icon in the top-left corner, navigate to "Projects", and select "New".

Welcome screenWelcome screen

Before creating or cloning a project, you need to generate a public key. Select the Not right now option. Then, open the menu (the "hamburger" button in the top-right corner), navigate to Settings, and proceed to the Git config section.

In the "Committer Details" section, provide your Git username and email address. These details associate your Git commits with your identity. For consistency, you might choose Node-RED as the username and use an email format like nodered@xxxxx.stackhero-network.com, replacing xxxxx.stackhero-network.com with the domain of your Node-RED instance.

Git configuration panelGit configuration panel

Click the Add key button, assign a meaningful name to the key, and then click Generate key. Use the Copy public key to clipboard option to copy the key and close the panel.

To configure a remote repository, follow these steps tailored for GitHub (similar steps apply to other platforms):

  1. Add the public key to the platform's settings.
  2. Obtain the SSH URL for your repository.

You can create a new repository or use an existing one. In GitHub, navigate to your repository, click Settings, then Deploy keys, and select Add deploy key. Paste the public key you copied earlier, assign it a descriptive name like "Node-RED", check the Allow write access box, and click Add key.

Add public key on GitHubAdd public key on GitHub

Return to the Code tab of your repository and copy the SSH URL. This URL typically looks like git@github.com:<yourOrganization>/<yourRepositoryName>.git. For existing repositories, click the Clone or download button to locate this URL.

In Node-RED, open the menu (top-right hamburger icon), navigate to Projects, and select "New".

Choose Clone Repository and ensure your username and email settings are correct. Paste the SSH URL of your repository into the Git repository URL field (e.g., git@github.com:<yourOrganization>/<yourRepositoryName>.git) and click Clone Project.

For new repositories, Node-RED may prompt you to create default project files. If prompted, select Create default project file.

Node-RED provides an option to encrypt your flow credentials files before adding them to Git. Enabling encryption is highly recommended to protect sensitive data. Store the encryption key securely, as it will be required for decryption.

Finally, click Create project files to complete the setup.

For more detailed guidance, refer to the official Node-RED documentation on Projects: Node-RED Projects Documentation.

You might also find this video tutorial insightful: Introduction to Node-RED Projects (YouTube).