Skip to content

How to Set Up Node-RED on a Linux Server – Visually Automate Devices, APIs, and Webhooks

Set up Node-RED as a One-Click App or with Docker Compose on your VPS, protect the editor with a login, and build your first flow with a webhook.

1 December 202611 min read0 Views0 helpful

Introduction

Node-RED is a low-code tool that lets you connect devices, APIs, and online services into workflows in your browser. Instead of writing code, you drag blocks (nodes) onto a workspace and connect them with lines to create a flow: a webhook comes in, Node-RED processes the data, then forwards a message, writes to a database, or switches on a device. Originally built for IoT, Node-RED is now often used for home automation, MQTT, small data pipelines, and connecting services without their own integration. In this guide, we’ll show you two ways to get started: the easy way with a One-Click App and a manual installation with Docker Compose. Then you’ll build your first flow and learn how to install extensions.

When it makes sense to run Node-RED on a VPS

Node-RED also runs on a Raspberry Pi at home. A VPS is a good fit when:

  • You want your flows to run around the clock, regardless of whether your computer or home router is turned on.
  • You want to receive webhooks from the internet, for example from GitHub, an online shop, or a payment service. A static IP and domain make this much easier than running Node-RED behind a home internet connection.
  • You want to connect online services, for example by regularly querying an API and sending the results through Telegram, email, or Discord.
  • You want to collect data from multiple locations, such as measurements sent over MQTT or HTTP, and process them centrally.
  • You prefer working visually rather than with scripts and want to be able to understand your workflows at a glance later on.

A VPS is less suitable if Node-RED needs to communicate directly with hardware, such as GPIO pins, USB drives, serial interfaces, or devices that are only accessible on your home network. That requires a device at your location. For pure workflow automation with lots of ready-made app integrations, n8n is another option, also available in the app catalog.

The easy way: Node-RED as a One-Click App

The fastest way to get Node-RED running is through your VPS’s One-Click Apps. The app is accessible directly over HTTPS with a domain and stores flows, credentials, and installed extensions in its own volume. You don’t need a reverse proxy or certificate.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
  • At least 512 MB RAM and 1 vCPU core; 1 GB RAM, 2 vCPU cores, and 5 GB of free storage are recommended. Node-RED itself is lightweight, but resource usage increases with the number of flows and installed extensions.

Install

  1. Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
  2. Search the app catalog for Node-RED and click Install app.
  3. Use a custom subdomain or zap.cloud is already selected, with a random name. Leave the option enabled or enter your own name, such as flows or nodered. With a domain, the editor is accessible over HTTPS.
  4. Under App configuration, you’ll see that two values are generated automatically: the username and password for the editor. You don’t need to enter anything. The app’s time zone is set to Europe/Berlin.
  5. Click Queue installation.

After a short time, Node-RED is ready. The app card displays the Login notice and the names of the variables containing your credentials.

First login: find your credentials

Node-RED is installed with a protected editor. Without logging in, you can’t view or change flows, deploy them, or install extensions. The username and password are generated during installation:

  1. Click the gear icon on the app card and go to App environment.
  2. Under Automatically generated values, you’ll find SERVICE_USER_NODERED (username, usually zapx) and SERVICE_PASSWORD_NODERED (password). Click the eye icon to show a value, or the icon next to it to copy it.
  3. Open the app using the Access link. Node-RED displays its login page.
  4. Log in with the username and password shown in the App environment.

When you log in for the first time, Node-RED asks whether it can notify you about new versions. To do so, it sends anonymized data to the Node-RED team; your flows and user details are not included. You can accept or decline, and change the setting later in your user preferences. Next, a short tour of what’s new in Node-RED 5 starts. You can close it using the X.

Warning: The editor gives access to your server

Anyone logged in to the Node-RED editor can run commands in the container and read files using nodes such as exec or function. Treat your credentials like a server password: don’t share them, and don’t give access to the editor to anyone you wouldn’t trust with your server.

Webhooks and endpoints are public

The login only protects the editor. Endpoints you create in a flow with the http in node are intentionally accessible without authentication at your domain, so other services can call them. In these flows, check for yourself whether a request is authorized, for example by using a secret value in the header or URL. Never pass unverified webhook requests on to exec or file nodes.

Custom settings in settings.js

You don’t need custom settings for most flows. If you do want to change something, such as setting your own credential key (credentialSecret) or adding password protection for endpoints (httpNodeAuth), create a custom settings.js file in the /data data directory. The One-Click App loads this file at startup instead of the default settings. Connect to your VPS over SSH:

Code
docker ps --format '{{.Names}}' | grep node-red
docker exec CONTAINER cp /usr/src/node-red/node_modules/node-red/settings.js /data/settings.js
docker cp CONTAINER:/data/settings.js /root/node-red-settings.js
nano /root/node-red-settings.js
docker cp /root/node-red-settings.js CONTAINER:/data/settings.js

Replace CONTAINER with the name shown in the first line. Then restart the app from its app card for the changes to take effect.

Info: Who can log in

If your settings.js doesn’t contain an adminAuth section, the generated login from the App environment remains active. If you add your own adminAuth section, it takes precedence: only the users in your file will be able to log in, and the generated login will no longer work. A typo in the file will prevent Node-RED from starting. If this happens, check the app logs and correct the file.

Updates and backups

To check whether an update is available for your installation, click the gear icon on the app card, select App update, and click Check for updates. If there’s a new version, install it using Apply update. The app uses the Node-RED 5.0 release series, so bug fixes in that series are applied automatically this way.

All flows, credentials from flows, settings, and installed extensions are stored in the app’s /data data directory. You can also export important flows from the editor as JSON files using the menu (three lines in the top-right corner) > Export. It’s quick and helpful if you only need to restore a single flow.

Manual installation

If you want to add Node-RED to an existing server environment or manage everything yourself, install it from the command line with Docker Compose. This uses the official Docker image; see the official Node-RED Docker guide for more information.

Requirements

MinimumRecommended
CPU1 vCPU core2 vCPU cores
RAM512 MB1 GB
Storage2 GB5 GB
Operating systemDebian 12/13 or Ubuntu 22.04/24.04Current LTS version

You’ll also need root access over SSH, Docker with Docker Compose installed, and a domain pointing to your server’s IP address with an A record for HTTPS.

Prepare the firewall

Only open SSH, HTTP, and HTTPS for the reverse proxy. Keep Node-RED’s port 1880 closed to external traffic; the editor will only be accessible over HTTPS later:

Code
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Warning: Docker bypasses ufw

Ports published in Docker Compose with ports: are accessible from the internet even if ufw doesn’t allow them. That’s why you should bind Node-RED to 127.0.0.1, as shown below. If the Node-RED editor is open without a password, any visitor can run commands on your server. Automated scanners actively search for these instances.

Install with Docker Compose

Create a directory and create the docker-compose.yml file inside it:

Code
mkdir -p /opt/node-red && cd /opt/node-red
nano docker-compose.yml
yaml
services:
  node-red:
    image: nodered/node-red:5.0
    restart: unless-stopped
    environment:
      - TZ=Europe/Berlin
    ports:
      - "127.0.0.1:1880:1880"
    volumes:
      - node-red-data:/data

volumes:
  node-red-data:

The most important lines:

  • nodered/node-red:5.0 is the official image for the 5.0 release series. This gets you bug fixes without an unexpected jump to the next major version.
  • 127.0.0.1:1880:1880 makes the editor accessible only from the server itself. You’ll access it externally through the reverse proxy later.
  • node-red-data:/data is the data directory containing flows, settings (settings.js), and installed extensions.
  • TZ ensures time values in flows and logs match your time zone.

Start Node-RED:

Code
docker compose up -d

Protect the editor with a password

By default, Node-RED has no login. Set one up before making the editor accessible through a domain. First, generate a hash for your password:

Code
docker compose exec node-red node-red admin hash-pw

Enter a long password after Password:. Node-RED will output a hash that starts with $2. Then open the settings file in the volume:

Code
nano /var/lib/docker/volumes/node-red_node-red-data/_data/settings.js

The volume name starts with the directory name, which is node-red in this example. Run docker volume ls to see the exact name. Find the adminAuth section, remove the comment markers //, and enter your username and hash:

js
adminAuth: {
    type: "credentials",
    users: [{
        username: "admin",
        password: "HASH_AUS_DEM_VORHERIGEN_SCHRITT",
        permissions: "*"
    }]
},

Restart Node-RED for the setting to take effect:

Code
docker compose restart
Tip: Set your own credential key

Node-RED encrypts passwords and tokens you enter in nodes in flows_cred.json. If you don’t configure this yourself, Node-RED generates the key and saves it in .config.runtime.json in the data directory. To manage the key yourself, set credentialSecret in settings.js. Don’t change it later, or Node-RED won’t be able to read saved credentials.

First access

Before setting up the reverse proxy, access the editor from your computer through an SSH tunnel:

Code
ssh -L 1880:127.0.0.1:1880 root@SERVER_IP

Then open http://localhost:1880 in your browser and log in with the username and password from adminAuth. If you see the editor without logging in, adminAuth is still commented out or Node-RED hasn’t been restarted.

Access over HTTPS through a reverse proxy

To access Node-RED through a domain, put a reverse proxy such as nginx in front of it. The editor keeps a WebSocket connection open, so the proxy needs the upgrade headers. Here’s a suitable server block:

nginx
server {
    listen 80;
    server_name nodered.example.com;

    location / {
        proxy_pass http://127.0.0.1:1880;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 3600;
    }
}

See Set up a reverse proxy for instructions on configuring nginx, and use Let's Encrypt to get a certificate. Without the upgrade headers, the editor loads but repeatedly displays “Lost connection to server.”

Back up your data

Everything important is stored in the /data volume. For a full backup, briefly stop Node-RED and archive the volume:

Code
cd /opt/node-red
docker compose stop
tar czf /root/node-red-backup-$(date +%F).tar.gz -C /var/lib/docker/volumes/node-red_node-red-data/_data .
docker compose start

The key files are flows.json (your flows), flows_cred.json (encrypted credentials from nodes), .config.runtime.json (the automatically generated key), settings.js, and package.json with the list of your extensions. If you back up flows_cred.json without the matching key, you’ll have to re-enter all passwords in the nodes after restoring.

Update Node-RED

Before updating, read the release notes and back up the volume. Then run:

Code
cd /opt/node-red
docker compose pull
docker compose up -d

This gets you the latest version in the 5.0 series. To move to a new major version, change the tag in docker-compose.yml. Then check under Manage palette to see whether any installed extensions need updating.

Build your first flow and extend Node-RED

Regardless of which installation method you chose, you’ll see your flows in the top left of the editor, with the palette of available nodes below. The workspace is in the middle, and the sidebar with information and debug messages is on the right.

Create a first flow with a webhook

  1. Drag an http in node onto the workspace. Double-click it and set the method to POST and the URL to /hook/test.
  2. Drag a debug node next to it and connect the two.
  3. Add an http response node and connect it to http in as well, so the caller gets a response.
  4. Click Deploy in the top right.
  5. Call the endpoint. For the One-Click App, use your domain:
Code
curl -X POST -H "Content-Type: application/json" -d '{"temp":21.5}' https://nodered.example.com/hook/test

The received message will appear in the debug messages on the right. From here, you can add more nodes, such as switch for conditions or change to transform the data.

Install extensions

Install additional nodes in the editor by opening the menu (three lines in the top-right corner) > Manage palette > Install. Popular extensions include:

  • @flowfuse/node-red-dashboard for browser dashboards with charts, switches, and displays,
  • node-red-contrib-home-assistant-websocket for connecting to Home Assistant,
  • nodes for databases such as InfluxDB, MySQL, or PostgreSQL.

Extensions are stored in the data directory and remain available after updates. Only install packages that are maintained and that you need, since every extension runs with the same permissions as Node-RED.

Use MQTT

The mqtt in and mqtt out nodes are included by default. To use sensors and devices, you’ll also need an MQTT broker such as Mosquitto, either on the same server or somewhere else. Enter the broker’s address, port, and credentials in the MQTT node, then subscribe to a topic, such as haus/wohnzimmer/temperatur.

Limitations

  • No local hardware: A VPS doesn’t have GPIO pins, USB devices, or serial devices. You can only reach devices on your home network if they send their data to the internet themselves, for example over MQTT, or if you connect through a VPN.
  • Git-based projects are disabled: The Projects feature is disabled by default in the Docker image. Back up flows using the volume or Export.

Conclusion

With Node-RED, you can connect services, webhooks, and devices into workflows without writing much code, and run them around the clock on your VPS. The fastest way to get started is with the One-Click App: a domain, HTTPS, and a protected editor are ready after just a few clicks. If you want to manage everything yourself, use the manual Docker Compose installation. In that case, make sure to protect the editor with adminAuth before making it accessible from the internet.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

No. Node-RED has no login by default, so anyone who knows the address can access the editor. The One-Click App always protects the editor: a username (usually zapx) and password are generated during installation. Find them under the gear icon in App environment > Automatically generated values as SERVICE_USER_NODERED and SERVICE_PASSWORD_NODERED. With a manual installation, set up the login yourself using adminAuth in settings.js before making the editor accessible from the internet.
The One-Click App is the fastest option: a domain, HTTPS, and a protected editor are ready after a few clicks, and you can install updates through App update. Docker Compose is a better fit if you want to add Node-RED to an existing environment or manage the reverse proxy and image version yourself. You can use a custom settings.js with either option, and the data is stored in /data.
Open the menu in the top-right corner of the editor and select Manage palette > Install. Search for packages such as @flowfuse/node-red-dashboard or node-red-contrib-home-assistant-websocket, then install them with one click. Extensions are stored in the data directory and remain available after updates.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.