IMD SolutionComputing LibraryShop main store

Selection guide

Node-RED OPC UA server node selection for edge gateways

Edge computing and IIoT Published 9 min read

Short answer

Install node-red-contrib-opcua as the pilot OPC UA server package on the first edge gateway, through the Node-RED editor's Manage palette, and keep node-red-contrib-opcua-server as the evaluated fallback. A fleet rollout past a thousand gateways is justified only when the pilot passes the qualification table: server function, real-client interoperability, NodeId stability across restarts, quality behavior, security policy and install reproducibility, all on a recorded software stack.

On this page
  1. Which OPC UA server package should a Node-RED edge gateway publish with?
  2. What does an OPC UA server node actually do in Node-RED?
  3. Which package comes first, node-red-contrib-opcua or node-red-contrib-opcua-server?
  4. Should you install through Manage palette or the terminal?
  5. What do you record about the runtime before you call a result valid?
  6. What must the pilot prove before a thousand gateways get the package?
  7. How do you test whether NodeIds survive a restart?
  8. How do you lock the endpoint down before plant clients connect?
  9. When does the pilot package become the fleet standard?
  10. Questions asked

A gateway that has to serve OPC UA out of Node-RED needs one decision and one proof, not a longer package list. The decision: make node-red-contrib-opcua the pilot package on the first gateway, install it through the Node-RED editor's Manage palette, and hold node-red-contrib-opcua-server as the evaluated fallback. The proof: a qualification table covering server function, real-client interoperability, NodeId stability across restarts, quality behavior, security policy and install reproducibility, run on the software stack you record before the first test. Release activity and reputation only order the candidates; the table decides what the fleet runs, and this fleet can grow past a thousand gateways, each exposing at most fifty variables.

Which OPC UA server package should a Node-RED edge gateway publish with? #

Install node-red-contrib-opcua as the pilot package for a gateway that serves up to 50 variables, put it in through the editor's Manage palette, and keep node-red-contrib-opcua-server as the fallback until the pilot's qualification table passes.

Both packages build a working OPC UA server inside Node-RED, so the choice between them is a testing order, not a compatibility verdict. The first package's page in the Node-RED flow library documents nodes that serve OPC UA and nodes that communicate as a client, which matches a gateway that also reads from PLCs upstream. The second package's page describes a programmable OPC UA server based on a next-generation node-opcua version with fewer dependencies, which makes it the leaner pure-server candidate. Whichever one installs first, the fleet decision waits for the qualification table below: a package name, a version number and a release history are not test results.

What does an OPC UA server node actually do in Node-RED? #

A server node publishes an address space of named variables with data types that clients browse, read and, where you allow it, write. Installing an OPC UA package only adds nodes; the address space exists once you deploy a configured server node.

OPC UA is the client-server information model standardized as IEC 62541, and these packages serve that protocol. A client node is the reverse role: it connects out to a server elsewhere and consumes data, so one install can cover a gateway that serves its own tags and reads from other servers upstream.

Three terms carry the rest of this article. The endpoint is the connection address a client aims at, and it advertises which security policies the server accepts. A NodeId is the identifier a client uses to address one node in the address space; clients store those identifiers between sessions, which is why the restart test below is a pass-or-fail row and not a nicety. The address space itself is built from the data contract: variable names, OPC UA data types matched to the source, engineering units, and read or write permissions settled before configuration starts.

Which package comes first, node-red-contrib-opcua or node-red-contrib-opcua-server? #

Start the pilot with node-red-contrib-opcua: its library page documents nodes that serve OPC UA and nodes that connect out as a client, which matches a gateway that also reads from PLCs. Update frequency is a tiebreaker only, never proof of stability on your runtime.

Package What its own library page documents Role in this decision
node-red-contrib-opcua Nodes to communicate via OPC UA and to serve it, built on the node-opcua library Pilot package: first through the qualification table
node-red-contrib-opcua-server A programmable OPC UA server on a next-generation node-opcua version with fewer dependencies Fallback candidate: runs the identical table if the pilot fails
node-red-contrib-opcua-compact-server A compact server package, installed from Manage palette or a command in the Node-RED user directory Third option where gateway footprint is tight; same table again

The flow library lists more server packages than these, and any of them may run the same table; nothing here promotes a name. Before installing, read the selected release's own documentation for four things: that it provides server nodes and not only client nodes, its runtime requirements, its security configuration, and what persists across a restart. Check the release history on the library page as a maintenance signal, and treat a fresh release as a reason to retest, because a new version can move dependencies or behavior under a running fleet.

Should you install through Manage palette or the terminal? #

Install through the Node-RED editor's Manage palette. It resolves the package into the same user directory the running service uses, shows the exact version before you confirm, and avoids the terminal's classic failure mode: installing into a different directory or under a different account.

  1. Open Manage palette from the editor's menu and search the exact package name on its Install tab.
  2. Compare the offered version with the version recorded for the pilot, then install.
  3. Read the install result and the runtime log; unresolved dependency or module-loading errors mean the install failed, not noise to ignore.
  4. Restart Node-RED if the package documentation calls for it, refresh the editor, and confirm the documented server nodes appear.
  5. Drop one server node into a test flow and open its configuration; a missing-node banner means the package landed outside the running instance.

Scripted fleet builds legitimately use the terminal instead, and the package's own page gives the command:

npm install node-red-contrib-opcua

Run it inside the user directory the Node-RED startup log names, under the account that runs the service; anything else installs a package the editor never sees. On compact industrial gateways the palette install itself can fail for device-side reasons — the walkthrough for Manage palette install failures on an IOT2040 gateway lists those causes to clear before you switch methods.

What do you record about the runtime before you call a result valid? #

Record the gateway image, the operating system base, the Node.js version, the Node-RED version, the installed package version and the dependency list before the first test. A pass belongs to that stack alone; nothing transfers to an untested one.

Read the values off the device instead of assuming them: Node-RED and Node.js versions from the runtime's own diagnostic output, the package version as Manage palette reports it, and the dependencies exactly as the install printed them. Compare the recorded stack with the candidate release's documented requirements before the first test, and fix a mismatch before testing rather than after a pass. If Node-RED is not on the gateway yet, installing Node-RED natively on a Linux edge computer is the step that also pins the distribution base these packages compile against.

What must the pilot prove before a thousand gateways get the package? #

The pilot must prove six things: the server serves, real clients interoperate, identifiers survive restarts, stale data is marked as stale, the security policy holds, and the install reproduces on a second box. Any failed row stops the rollout until it is fixed or the package is swapped.

Qualification row How you run it Pass criterion
Server function Deploy the configured server node and browse it with a generic OPC UA test client Every variable in the tag contract appears with its declared name and data type
Client interoperability Connect the plant client that will consume the data, not only the test client Reads return current values; a deliberately writable tag accepts only authorized writes
NodeId stability Record every identifier, run the restart cycle plan, re-browse after each cycle Every identifier identical after each cycle
Quality behavior Stop the upstream acquisition while a client stays connected The stale source is visible as bad or uncertain quality, never as a live value
Security policy Negotiate with the intended policy, then attempt a session with a disabled policy The intended policy connects; the disabled policy is refused
Install reproducibility Repeat the install on a second identical gateway from the recorded versions and a flows backup Same package versions, clean runtime log, nodes present

A generic test client passing while the real plant client fails is the classic trap in the interoperability row; when the two disagree, the walkthrough on troubleshooting Node-RED OPC UA when UaExpert connects separates server-side faults from client-side ones.

How do you test whether NodeIds survive a restart? #

Configure all 50 variables, record every NodeId, restart the runtime three times plus one power cycle, and re-browse after each cycle. The pass criterion is every identifier unchanged; a single changed identifier fails the package for this application.

Worked example with illustrative numbers: the tag contract holds 50 variables, and the browse list is saved before the first restart. After the second restart the fresh browse returns 49 identifiers matching the saved list and one variable addressed by a different NodeId. Identifier stability is 49 / 50 = 0.98, so 98 percent, against a required 100 percent: that row fails. If the package lets you assign identifiers explicitly in the node configuration, pin the drifting variable and re-run the entire cycle plan; if an identifier still moves after that, the package loses the pilot.

The row is brutal on purpose. Client screens, subscriptions and tag databases store NodeIds, so an identifier that changes after a restart breaks consumers silently: the server looks healthy while every stored reference points at a node that no longer exists. Where the package separates variable creation from value updates, respect that split in the flow design, and match each declared data type to the source type so a client's decode never surprises.

How do you lock the endpoint down before plant clients connect? #

Decide the security policy before the first plant client connects, not after. Configure the server node for signed and encrypted sessions with certificate trust where the client supports it, and disable the no-security policy so an anonymous session cannot read the tag contract.

Where the package's configuration exposes security policy selection and certificate trust, set the policy the plant client actually supports and turn the rest off; where it does not expose them, that limitation is a qualification result in itself and belongs in the pilot report. A writable variable is a command path into a running process: leave every tag read-only unless a documented control action needs the write, and let writes come only from authorized client identities.

Keep data validity separate from connectivity as well; publish quality and timestamps where the package exposes them, so an acquisition that died upstream shows the client bad or stale data instead of a convincing live value. The full pass over policies, certificates, write access and exposure is in the guide to hardening a Node-RED OPC UA server that exposes PLC tags.

A successful local browse proves the server runs, not that a remote client can reach it. Listening interface, routing, firewall rules and what the endpoint advertises each fail on their own; when the server answers on the gateway itself but refuses remote clients, the article on why an edge OPC UA server accepts local clients but not remote ones walks exactly that split.

When does the pilot package become the fleet standard? #

When every qualification row passes on the recorded stack, freeze that stack — gateway image, Node.js, Node-RED, package version — as the fleet baseline, and raise it only after a new release re-runs the full table on one gateway. Any failed row keeps the fleet where it is.

Save the flows and the recorded stack with the pilot report, and restore those flows onto the second gateway as part of the reproducibility row; the guide on troubleshooting Manage palette installs and lost flows lists where those saves tend to disappear.

Decision, case by case. Every row passes on the recorded stack: standardize node-red-contrib-opcua at exactly those versions across the fleet. A row fails on configuration — identifier assignment, a security policy, a permission: fix it, re-run the whole table, then standardize. The package fails structurally — an identifier still drifts after explicit assignment, or the plant client will not interoperate: swap in node-red-contrib-opcua-server, run the identical table from its own install, and standardize whichever package survives. The pilot's verdict, not the package's reputation, is what a thousand gateways inherit.

Questions asked

Can one Node-RED install serve OPC UA and act as a client at the same time?

Yes on the pilot package, because it documents nodes for both roles, so one install can serve the gateway's tags and read from another server at the same time. Keep the roles on separate tabs, expect both to consume runtime memory on a small gateway, and include the combined load in the soak test.

Do these packages also speak classic OPC?

No. Both candidates are OPC UA packages built on the node-opcua library, and classic OPC is a separate, older technology with its own stack. If the consuming application only speaks classic OPC, plan a converter or a dedicated gateway product in front of the Node-RED server; neither package answers it directly.

Does the pilot have to run on the same hardware as the fleet gateways?

Run the table on the same image and hardware class the fleet will use. A pass on a development laptop says little about a fanless edge box with a different Node.js build; if the fleet mixes hardware classes, each class gets its own recorded run of the qualification table.

How many variables should the pilot actually be sized for?

Size it for the full tag contract plus headroom, not a token subset: build the server once and run the qualification table against everything the clients will browse. Neither package page documents a variable-count limit, so the honest check is CPU, memory and restart behavior at full count during the soak.

How long should the pilot soak before the fleet rollout is approved?

Soak long enough to cross shift changes and scheduled tasks, for example a full week, with a client holding subscriptions the whole time. Restart and power-cycle at both ends of the window; intermittent palette, memory or connection faults show up across days, not in an afternoon demonstration.

Keep reading

  • Troubleshooting

    Why node-red-contrib-iiot-opcua installs with 3 npm vulnerabilities

    The install did not fail: the transcript shows npm completing a global install, and the three reported vulnerabilities are audit findings on a dependency tree no update will change, because node-red-contrib-iiot-opcua is deprecated and closed since April 2020. Back up the flows, run npm audit fix followed by npm audit, and migrate new work to node-red-contrib-opcua after checking node compatibility.

    Edge computing and IIoT

  • How-to

    MQTT to Modbus TCP with Node-RED on an edge gateway

    Yes: Node-RED with the node-red-contrib-modbus package can serve MQTT data to a SCADA client as Modbus TCP. Read the RTU device in Node-RED first, give the Modbus server node a port nothing else owns, and scale each MQTT payload to one integer per holding register before the first end-to-end test.

    Edge computing and IIoT

  • Troubleshooting

    Why Node-RED crashes on deploy for a missing OPC UA certificate

    The crash is a local file lookup, not a network or server fault: deploying starts the OPC UA connector, the connector builds an OPC UA client, and that client throws cannot locate certificate file for its self-signed certificate before touching the network. Recover the editor in safe mode, give the Node-RED service account a writable certificate directory, redeploy, and only replace the package or move to a container if provisioning stays unmaintainable.

    Edge computing and IIoT

Setting up Sparkplug B on an edge gateway controller