# Install node red in Raspberry Pi

All this step will show you how to install node-red on Raspberry Pi. Open the terminal of Raspberry Pi and do as below:

* **Install node:**
  * `$ sudo apt update`                 (*you need to update first*)
  * `$ sudo apt install nodejs`   (Install nodejs)
  * `$ node -v`                              (check version of nodejs if you get v10.12.0 you need to update to v14.5.0)
* **Update node if your node is v10.12.0:**
  * `$ curl -sL` [`https://deb.nodesource.com/setup_14.x`](https://deb.nodesource.com/setup_14.x) `| sudo -E bash -`                  (This command use for update your package repository)
  * `$ sudo apt install nodejs`   (install nodejs)
  * `$ node -v`                               (you will get node v14.5.0)
* **Install node-red:**
  * `$bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)`
    * This script will:
      * remove the pre-packaged version of Node-RED and Node.js if they are present
      * Install the current Node.js LTS release using the [NodeSource](https://github.com/nodesource/distributions/blob/master/README.md). If it detects Node.js is already installed from NodeSource, it will ensure it is at least Node 8, but otherwise leave it alone
      * install the latest version of Node-RED using npm
      * optionally install a collection of useful Pi-specific nodes
      * setup Node-RED to run as a service and provide a set of commands to work with the service
  * `$ sudo npm install -g npm@2.x`
  * `$ npm install node-red-dashboard` (If you did with all the step you will get node-red on your Raspberry Pi)
  * `$ node-red-start`       (to open your node red)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aic-eec.com/general/node-red/install-node-red-in-raspberry-pi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
