{"id":111617,"date":"2022-06-16T13:07:17","date_gmt":"2022-06-16T13:07:17","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=111617"},"modified":"2024-01-22T11:02:35","modified_gmt":"2024-01-22T11:02:35","slug":"install-node-red-raspberry-pi","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/install-node-red-raspberry-pi\/","title":{"rendered":"Install Node-RED on Raspberry Pi (works on RPI OS 64-bit)"},"content":{"rendered":"\n<p>This is a quick guide showing how to install Node-RED on a Raspberry Pi. We tested this installation on Raspberry Pi OS (32-bit) and Raspberry Pi OS (64-bit).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install Node-RED on Raspberry Pi works on RPI OS 64-bit\" class=\"wp-image-111636\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before proceeding: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need a <a href=\"https:\/\/makeradvisor.com\/best-raspberry-pi-starter-kits\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi board<\/a><\/li>\n\n\n\n<li>You should have a <a href=\"https:\/\/randomnerdtutorials.com\/installing-raspbian-lite-enabling-and-connecting-with-ssh\/#install-raspberry-pi-os\">Raspberry Pi running Raspberry Pi OS<\/a> (32-bit or 64-bit).<\/li>\n\n\n\n<li>You should be able to<a href=\"https:\/\/randomnerdtutorials.com\/installing-raspbian-lite-enabling-and-connecting-with-ssh\/#connect-RPi-SSH\"> establish an SSH connection with your Raspberry Pi<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Node-RED on Raspberry Pi<\/h2>\n\n\n\n<p>Having an&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/installing-raspbian-lite-enabling-and-connecting-with-ssh\/#connect-RPi-SSH\">SSH connection established with your Raspberry Pi<\/a>, enter the following to install Node-RED:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bash &lt;(curl -sL https:\/\/raw.githubusercontent.com\/node-red\/linux-installers\/master\/deb\/update-nodejs-and-nodered)<\/code><\/pre>\n\n\n\n<p>Node-RED is installed by default on the Raspberry Pi OS (32-bit). However, it is recommended to run the previous command to install the required packages and update it to the most recent version. You\u2019ll get a message informing you about this. Press <strong>Y<\/strong> and press <strong>Enter <\/strong>to accept.<\/p>\n\n\n\n<p>Node-RED is not installed by default on Raspberry Pi OS (64-bit).<\/p>\n\n\n\n<p>Then, you&#8217;ll be asked: &#8220;Would you like to install Pi-specific nodes?&#8221; Press <strong>Y<\/strong> and <strong>Enter<\/strong>.<\/p>\n\n\n\n<p>It will take a few minutes to install Node-RED. In the end, you should get a similar message on the Terminal window:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"653\" height=\"466\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/%E2%80%8CInstall-Node-RED-RaspberryPi.png?resize=653%2C466&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing Node-RED on Raspberry Pi\" class=\"wp-image-111618\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/%E2%80%8CInstall-Node-RED-RaspberryPi.png?w=653&amp;quality=100&amp;strip=all&amp;ssl=1 653w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/%E2%80%8CInstall-Node-RED-RaspberryPi.png?resize=300%2C214&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Configure Node-RED Settings<\/h2>\n\n\n\n<p>After installing, it is recommended to configure initial options and settings. Run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node-red admin init<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"621\" height=\"386\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Configure-Node-RED-Settings.png?resize=621%2C386&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Configure Node-RED Settings\" class=\"wp-image-111633\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Configure-Node-RED-Settings.png?w=621&amp;quality=100&amp;strip=all&amp;ssl=1 621w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Configure-Node-RED-Settings.png?resize=300%2C186&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Press <strong>Enter <\/strong>to create a Node-RED Settings file on <span class=\"rnthl rntliteral\">\/home\/pi\/.node-red\/settings.js<\/span><\/li>\n\n\n\n<li>Do you want to set up user security? <strong>Yes<\/strong>.<\/li>\n\n\n\n<li>Enter a username and press <strong>Enter<\/strong> (you need to remember it later).<\/li>\n\n\n\n<li>Enter a password and press <strong>Enter <\/strong>(you need to remember it later).<\/li>\n\n\n\n<li>Then, you need to define user permissions. We\u2019ll set full access, make sure the full access option is highlighted in blue and press <strong>Enter<\/strong>.<\/li>\n\n\n\n<li>You can add other users with different permissions if you want. We\u2019ll just create one user for now. You can always add other users later.<\/li>\n\n\n\n<li>Do you want to enable the Projects feature? <strong>No<\/strong>.<\/li>\n\n\n\n<li>Enter a name for your flows file. Press <strong>Enter<\/strong> to select the default name <span class=\"rnthl rntliteral\">flows.json<\/span>.<\/li>\n\n\n\n<li>Provide a passphrase to encrypt your credentials file. Learn more about what is a <a href=\"https:\/\/www.techtarget.com\/searchsecurity\/definition\/passphrase\" target=\"_blank\" rel=\"noreferrer noopener\">passphrase<\/a>.<\/li>\n\n\n\n<li>Select a theme for the editor. Simply press <strong>Enter<\/strong> to select default.<\/li>\n\n\n\n<li>Press <strong>Enter <\/strong>again to select the default text editor.<\/li>\n\n\n\n<li>Allow Function nodes to load external modules? <strong>Yes<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>Node-RED configuration was successful. All settings are saved on <span class=\"rnthl rntliteral\">settings.js<\/span>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Start Node-RED<\/h2>\n\n\n\n<p>Run the following command to start Node-RED:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node-red-start<\/code><\/pre>\n\n\n\n<p>You should get a similar message on the Terminal:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"610\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-start-terminal.png?resize=671%2C610&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Node-RED start Terminal Window\" class=\"wp-image-111631\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-start-terminal.png?w=671&amp;quality=100&amp;strip=all&amp;ssl=1 671w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-start-terminal.png?resize=300%2C273&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 671px) 100vw, 671px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Access Node-RED<\/h2>\n\n\n\n<p>Node-RED runs on port 1880. To access Node-RED open a browser and type the Raspberry Pi IP address followed by :1880. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>192.164.1.106<strong>:1880<\/strong><\/code><\/pre>\n\n\n\n<p>You&#8217;ll get access to the Node-RED login page. Login with the username and password you&#8217;ve set previously.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"531\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Node-RED-login-Page.png?resize=797%2C531&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Node-RED Login Page\" class=\"wp-image-111624\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Node-RED-login-Page.png?w=797&amp;quality=100&amp;strip=all&amp;ssl=1 797w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Node-RED-login-Page.png?resize=300%2C200&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Node-RED-login-Page.png?resize=768%2C512&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/figure><\/div>\n\n\n<p>Now, you have access to Node-RED. You can start building your flows.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"557\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-welcome-screen.png?resize=845%2C557&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Node-RED Welcome Screen\" class=\"wp-image-111625\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-welcome-screen.png?w=845&amp;quality=100&amp;strip=all&amp;ssl=1 845w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-welcome-screen.png?resize=300%2C198&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/node-red-welcome-screen.png?resize=768%2C506&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 845px) 100vw, 845px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Autostart Node-RED on boot<\/h2>\n\n\n\n<p>To automatically run&nbsp;Node-RED when the Pi boots up, you&nbsp;need to enter&nbsp;the following command. This means that as long as your Raspberry Pi is powered up, Node-RED will be running.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable nodered.service<\/code><\/pre>\n\n\n\n<p>Now, restart your Pi so the&nbsp;autostart takes effect. The next time the Raspberry Pi restarts, Node-RED will be already running.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo reboot<\/code><\/pre>\n\n\n\n<p>If, later on, you want to disable autostart on boot, you can run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl disable nodered.service<\/code><\/pre>\n\n\n\n<p>For more information about the installation process, check the official <a href=\"https:\/\/nodered.org\/docs\/getting-started\/raspberrypi\" target=\"_blank\" rel=\"noreferrer noopener\">documentation<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>Congratulations! You successfully installed Node-RED on your Raspberry Pi. Now, you can start building your Home Automation System. Using MQTT with Node-RED is a great option to gather data from several sensor nodes and send commands to actuators. You can also resend your sensor data to InfluxDB and have a history of your data saved on a database.<\/p>\n\n\n\n<p>You may also like reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/install-influxdb-2-raspberry-pi\/\">Install InfluxDB on Raspberry Pi<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-influxdb\/\">ESP32: Getting Started with InfluxDB<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/what-is-mqtt-and-how-it-works\/\">What is MQTT and How It Works<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/how-to-install-mosquitto-broker-on-raspberry-pi\/\">Install Mosquitto MQTT Broker on Raspberry Pi<\/a><\/li>\n<\/ul>\n\n\n\n<p>Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick guide showing how to install Node-RED on a Raspberry Pi. We tested this installation on Raspberry Pi OS (32-bit) and Raspberry Pi OS (64-bit). Prerequisites Before &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Install Node-RED on Raspberry Pi (works on RPI OS 64-bit)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/install-node-red-raspberry-pi\/#more-111617\" aria-label=\"Read more about Install Node-RED on Raspberry Pi (works on RPI OS 64-bit)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":111636,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301,264,268,190],"tags":[],"class_list":["post-111617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-0-raspberrypi","category-project","category-raspberry-pi-project","category-raspberry-pi"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2022\/06\/Install-Node-RED-Raspberry-Pi.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/111617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=111617"}],"version-history":[{"count":15,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/111617\/revisions"}],"predecessor-version":[{"id":146108,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/111617\/revisions\/146108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/111636"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=111617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=111617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=111617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}