Node-Red Install Ubuntu Server 18.0.4

Hi all, new to node-red and ubuntu l. I have followed the installation guides I found online for Ubuntu Server 18.0.4 (clean install) and everything seems to have gone well. Installing node+npm+node-red.
After install, no ( found 0 vulnerabilities) and no warnings etc.

However, when I start node red with "node-red" it seems to start without issue but I cannot access the server (local network) using it's IP:1880. I just get the server cannot be found message (safari mac). Tried other browsers as well. It seems that node-red is not reachable on the server even though the port is open and node-red is listening on it.
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN 3170/node-red

I should mentioned I have done this in the past and it worked i the past. But I have tried a few ways, some producing errors. This has been a clean error free install but cant access node-red in the browser.

Anyone has this issue? Appreciate the help.

Install commands used:
sudo apt-get install nodejs
sudo npm install npm -g
sudo npm install -g --unsafe-perm node-red node-red-admin

The best thing to do is to follow the official node red docs installation guide, which is to install using the Debian/Ubuntu/Raspbian install guide. I am on my phone so can't easily link to it, but if you Google for install node red pi and find the one on the node red site then you should find it. You probably don't need to uninstall anything first.

If it still won't work (or if you don't want to do that) then stop node red and start it again in a terminal and see what messages are there. Copy/paste them here if necessary.

Further to the above, I believe that Ubuntu 18.04 comes with a version of nodejs < 12, which is the minimum that the current node-red, which probably explains the problem. You can check that using node -v. Running the script I suggested will fix that. Running on Raspberry Pi : Node-RED

Thanks for your response. I cleaned node.js and node-red out and reinstalled using the link:
https://nodered.org/docs/getting-started/raspberrypi

I am not running on a raspberry pie but a mac-mini booted with Ubuntu Server 18.0.4.

Everything installs well but accessing via the machineIP:1880 does not load node-red at all. Simply states can't connect to the server.

Here is what is shown in the terminal after start.

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.2.55:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
30 Nov 17:06:40 - [info]
Welcome to Node-RED

30 Nov 17:06:40 - [info] Node-RED version: v2.1.3
30 Nov 17:06:40 - [info] Node.js version: v14.18.1
30 Nov 17:06:40 - [info] Linux 4.15.0-163-generic x64 LE
30 Nov 17:06:40 - [info] Loading palette nodes
30 Nov 17:06:41 - [info] Settings file : /home/[redacted]/.node-red/settings.js
30 Nov 17:06:41 - [info] Context store : 'default' [module=memory]
30 Nov 17:06:41 - [info] User directory : /home/[redacted]/.node-red
30 Nov 17:06:41 - [info] Projects directory: /home/[redacted]/.node-red/projects
30 Nov 17:06:41 - [warn] No active project : using default flows file
30 Nov 17:06:41 - [info] Flows file : /home/[redacted]/.node-red/flows.json
30 Nov 17:06:41 - [info] Creating new flow file
30 Nov 17:06:41 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

30 Nov 17:06:41 - [info] Server now running at http://127.0.0.1:1880/
30 Nov 17:06:41 - [info] Starting flows
30 Nov 17:06:41 - [info] Started flows

What IP are you using and can you ping that machine from where you are running the browser.

Is port 1880 open on the server? Perhaps you are using a firewall.

I am using it on a local network accessible via a local IP (192.168.x.x).. I have another service running on this same machine and it's accessing it fine including a web sever on port 80. Port is active.
node-red 16293 iskinadmin 18u IPv4 78363 0t0 TCP *:1880 (LISTEN)
Not sure if there is another setting I am missing that would block access to this port.

Are you using http://192.168.2.55:1880?

What do you see if you run
curl http://192.168.2.55:1880

If that doesn't work then connect to the server (using ssh I presume) and try
curl http://localhost:1880

Yes, using http://192.168.2.55.

When i access that URL - I get a "Can't connect to the Server" error.

If I cURL from the terminal I get:
curl: (7) Failed to connect to 192.168.2.55 port 18080: Connection refused

If I SSH to the server and use the cURL, I get this below.

 ( <!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>

<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="mobile-web-app-capable" content="yes">

<!--

Copyright OpenJS Foundation and other contributors, https://openjsf.org/

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

-->

<title>Node-RED</title>

<link rel="icon" type="image/png" href="favicon.ico">

<link rel="mask-icon" href="red&#x2F;images&#x2F;node-red-icon-black.svg" color="#8f0000">

<link rel="stylesheet" href="vendor/jquery/css/base/jquery-ui.min.css?v=2.1.3">

<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css?v=2.1.3">

<link rel="stylesheet" href="red/style.min.css?v=2.1.3">

</head>

<body spellcheck="false">

<div id="red-ui-editor"></div>

<script src="vendor/vendor.js?v=2.1.3"></script>

<script src="red&#x2F;red.min.js?v=2.1.3"></script>

<script src="red&#x2F;main.min.js?v=2.1.3"></script>

</body>

</html>

Wrong port number.

@metadrew have you solved this problem?

Hi Colin, yes. I think the problem was the other server I had installed was modifying the firewall to block port 1880. I used the firewalld command to enable the port and all seem to be woking now via the machine's IP:1880

I used: sudo firewall-cmd --add-port=1880/tcp —permanent

Next step is securing the server :slight_smile:

Thanks for following up.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.