Installing Node-RED on Fedora Server Latest
Node-RED is an open-source programming tool that allows users to connect different hardware devices, APIs, and online services. In this article, we will guide you through the process of installing Node-RED on Fedora Server Latest using the command line interface (CLI).
Prerequisites
Before moving forward, make sure that you have a Fedora Server Latest installed with the following requirements:
- Access to the command line interface (CLI) with administrative privileges
- A working internet connection
- Node.js, which comes pre-installed with Fedora Server Latest
Step 1: Install Node-RED on Fedora Server Latest
- Open the terminal and run the following command to install Node-RED:
sudo npm install -g --unsafe-perm node-red
- Wait for the installation to complete.
Step 2: Start the Node-RED server
- After the installation is complete, run the following command to start the Node-RED server:
node-red
Once the server is running, open your web browser and enter the following URL in the address bar:
http://localhost:1880.You should see the Node-RED dashboard in the web browser.
Step 3: Secure your Node-RED installation
By default, Node-RED does not have any authentication. As a result, anyone who has access to your network can access and modify your Node-RED flows. To protect your installation, it is recommended that you enable basic authentication.
Stop the Node-RED server by pressing
Ctrl + Cin the terminal.Run the following command to install the
bcryptmodule:
sudo npm install -g bcrypt
- Once the
bcryptmodule is installed, open the Node-RED settings file using the following command:
nano ~/.node-red/settings.js
- Add the following lines to the end of the file:
adminAuth: {
type: "credentials",
users: [{
username: "your_username",
password: "$2a$08$tyzV7nW8TvDlXwhHPs6l1eLOsWHo85MwFOmYeFt56DJi/Yb2Px.S.",
permissions: "*"
}]
},
Replace
your_usernamewith a username of your choice.Generate a password hash by running the following command:
node-red-admin hash-pw
Enter the password that you want to use for Node-RED.
Copy the generated hash and replace the
$2a$08$tyzV7nW8TvDlXwhHPs6l1eLOsWHo85MwFOmYeFt56DJi/Yb2Px.S.string in the settings file with the hash.Save and close the settings file by pressing
Ctrl + X, followed byY, and thenEnter.Start the Node-RED server by running the command
node-red.Open your web browser and enter the following URL in the address bar:
http://localhost:1880.You should now be prompted to enter a username and password to access the Node-RED dashboard.
Conclusion
In this tutorial, we have guided you through the installation of Node-RED on Fedora Server Latest and securing it with basic authentication. You can now start building flows and connecting different hardware devices, APIs, and online services in Node-RED.