HowTo: Node Red – Set up user login

After installing NodeRed for the first time, you can (or should) normally access the NodeRed configuration interface without any major obstacles. This is practical because you can start the configuration directly.

Unfortunately, it is also dangerous. Because if anyone on the network can access the NodeRed configuration interface, this also means that anyone on the network can execute commands on the respective system.

Access should be made as difficult as possible here. This is a must, especially as soon as you enable access to the NodeRed configuration via the Internet. Otherwise your own RaspberryPi will probably very quickly no longer only work for your own NodeRed server but also for the next botnet.

An important step to make access to NodeRed more difficult is to set up a user login for the configuration interface. How to set this up is explained in the following article.

In the article NodeRed - Encrypt connection also describes how you can encrypt the connection to your NodeRed configuration. Connection encryption is another important security plus, especially if you want to access your NodeRed configuration via the Internet.

Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support in being able to offer other useful projects in the future. 🙂 


Helpful articles:
NodeRed should of course already be installed so that you can set up a user login.
How to prepare a RaspberryPi and then install NodeRed on it is described in the following articles.

The following three articles describe what needs to be done to prepare the RaspberryPi:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH

NodeRed – Installing NodeRed on the RaspberryPi

Required tool:

Required material:

In the following list you will find all the parts you need to implement this article.

Log in to the RaspberryPi via SSH

To start, you must first log in to the Rasp Pi with Putty via SSH. How to do this is in the article RaspberryPi - Control the RaspberryPi via SSH described.

After entering your username and password you can enter the first commands.

Update package management

The package management in Linux is a "central place" through which various software packages can be installed. In order for this to work reliably, the lists and sources of the package management should be updated before each installation of new packages.

To start the update of the package management you have to enter the following command.
sudo apt-get update && sudo apt-get upgrade
Depending on how long ago your last update of the package management was, this process can now take a while. The lists that refer to the individual package sources are updated first.
After that, the packages themselves are updated. Since additional memory is occupied, you will be asked again for your consent. You have to confirm this with a "J" and "Enter".
Once the update is complete, you will see a small summary of the duration and scope of the update.

Generate password hash value

The password for your user interface will later be entered in the configuration file of your NodeRed installation. As it is a security risk to save passwords as plain text (i.e. unencrypted) in configuration files, a hash value of your password is generated in this case and entered in the configuration file. It is not possible to directly deduce the password from the hash value.

So that you can generate the hash value, it is recommended to install the "node-red-admin" tools.
The command to do this is:

sudo npm install -g node-red-admin
The installation of the "node-red-admin" tools takes approx. 30 seconds.

Once the installation is complete, you can call up the hash value generator with the following command:

sudo node-red-admin hash-pw
In the prompt that then appears, enter your password from which you want to generate a hash value and confirm this with "Enter".
You will then be shown the corresponding hash value. It is best to copy this into a text file so that you have it ready for the next steps.

Enter the user name and hash value in the config file

Now open the configuration file of your NodeRed installation

sudo nano /home/pi/.node-red/settings.js

Navigates in the configuration file with the arrow keys to... have arrived at this part.
There you delete the slashes in front of the lines shown.
In the "username" area, you can now enter any user name between the quotation marks. In this case, this has been left at "admin". In the "password" area, you must now enter the previously created hash value. To do this, remove the existing hash value and copy your own hash value to the same place.
This is what the area should look like after you have entered your hash value.
To save and close the configuration file, press "CTRL+X"...
...and confirms the request with "Y" and "Enter".

Restart NodeRed

To apply the changes you have made, you must restart your NodeRed installation once. This can be done with the following command:

sudo service node red restart

After a restart, you will be asked for a user name and password when you call up your NodeRed configuration page.

Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at       


    1. Hi Mathias,
      you mean you installed NodeRed as a docker container?
      The same should actually work there. You probably connected the NodeRed user data to the file system of your host via a share, right?
      Then you should also be able to edit the settings.js and Co. 🙂
      Best regards

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.