惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
Y
Y Combinator Blog
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
爱范儿
爱范儿
H
Help Net Security
GbyAI
GbyAI
F
Fortinet All Blogs
B
Blog
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
D
DataBreaches.Net
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享

NetBird - Networking Knowledge Hub - RSS Feed

NetBird Is Now on the Vultr Marketplace Native NetBird on the GL.iNet Comet Pro (GL-RM10) NetBird v0.71 - IPv6 Overlay Addressing NetBird Exit Nodes - Appear at Home, or Anywhere Else Reporting Bugs and Requesting Features in NetBird Setup and Use Local AdGuard Home Anywhere with NetBird DNS How to Set Up NetBird on PiKVM for Secure Remote KVM Access NetBird v0.69 - CrowdSec IP Reputation for the Reverse Proxy Cloudflare Mesh vs NetBird vs Tailscale: Performance Compared Self-Hosting Nextcloud with Docker and NetBird Implementing Zero Trust with NetBird NetBird v0.67 - Layer 4 Proxy Support for TCP, UDP, and TLS Solwr Enhances Remote Connectivity with NetBird Self-Hosting NetBird with Authentik Jellyfin Media Server - Self-Host Your Movies, TV, and Music Cloudflare Tunnels vs. NetBird Reverse Proxy INFITX Builds Zero-Touch Kubernetes Networking with NetBird NetBird v0.66 - Expose Local Services to the Internet from the CLI Pangolin vs. NetBird Home Assistant Setup Guide with EASY Remote Access NetBird v0.65 - Built-in Reverse Proxy with Custom Domains Docker for Beginners - Everything You Need to Get Started NetBird for SOC 2 Compliance NetBird v0.63 - Custom DNS Zones for Private Network Resolution Vibecode This in a Weekend and Take 5% of the Company NetBird v0.62 - Built-in Local Users with Optional IdP Integration NetBird v0.61.0 - Granular SSH Access Control and Automatic Updates Top 5 Alternatives to OpenVPN Top 5 Open Source Alternatives to Tailscale Top 5 Alternatives to ZeroTier
How to Install n8n v2.0 with NPM and PM2
Written byBrandon Hopkins · 2025-12-15 · via NetBird - Networking Knowledge Hub - RSS Feed

n8n, a tool we use almost every day here at NetBird, just had a major release. v2.0 beta is now ready to test out in their next release branch. While version 1.0 was about stability and reaching "maturity," Version 2.0 is an architectural shift designed to make n8n enterprise-ready and developer-friendly. The shift is comparable to moving from "writing scripts directly on a server" to "using a proper CI/CD pipeline."

Here is the breakdown of some of the major changes.

1. The End of "Hot Edits" (Draft vs. Publish)

The single biggest workflow change in v2 is the separation of development and production.

  • In v1: There was only one button: Save. If you saved a workflow, you effectively deployed it. Debugging a live production workflow was risky; if you hit save on a broken node, you broke production immediately.
  • In v2: You now have Draft and Published states. You can edit, debug, and break your "Draft" version as much as you want without affecting the live version running in the background. You must explicitly click Publish to push your changes to production.

2. True Human-in-the-Loop

If you build AI agents or approval flows, v2 fixes a major architectural limitation regarding long-running tasks.

  • The Fix: In v1, if a parent workflow called a sub-workflow that needed to wait for a human approval (e.g., via Slack), the connection would often time out or return incorrect results. In v2, this is native. The Parent Workflow effectively "pauses" and waits for the Sub-workflow to complete—even if it takes days for a human to click "Approve." Once approved, the data flows back to the Parent seamlessly.

The Architecture of Stability

This is arguably the most critical "under the hood" change in v2, specifically regarding stability and security.

In v1, running custom code (JavaScript/Python) was like letting a stranger drive your car while you were sitting in the passenger seat. If they crashed, you both crashed. In v2, with Task Runners, it's like controlling a remote-controlled car. If the RC car crashes, you are safe standing on the sidewalk.

v1: In-Process Execution (The Risk)

Previously, custom code ran inside the same operating system process as the main n8n server.

  • The Crash Risk: If your JavaScript had a memory leak or an infinite loop, it consumed the host server's resources. This would cause the entire n8n instance to crash, killing all other active workflows and webhooks.
  • The Security Risk: Because code ran in the main process, a clever user could theoretically access internal server environment variables.

v2: Task Runners (The Solution)

Version 2 introduces Task Runners—separate processes dedicated entirely to executing custom code.

  • Isolation: When a workflow hits a Code Node, n8n sends the data to the Task Runner. If your Python script crashes, only the Task Runner fails. The main n8n server stays alive, simply marking that specific execution as an "Error."
  • Performance: Heavy data transformation tasks (like processing large JSON files) no longer block the main event loop. Your webhook listeners remain responsive even while heavy computation happens in the background.

Python as a First-Class Citizen

This architecture moves Python from "experimental" to stable. The old Pyodide-based Python node has been removed and replaced with a native Python implementation running on Task Runners. Because the Task Runner is a native Python environment, it supports  installs and provides a reliable playground for data scientists who prefer Python over JS.

Summary Checklist for Upgrading

If you are moving to v2, be aware of these requirements:

  1. Database: MySQL and MariaDB are no longer supported. You must use PostgreSQL or SQLite. If you're currently on MySQL/MariaDB, migrate your data before upgrading.
  2. Docker: You will likely need to adjust your container setup to include the new "Task Runner" sidecar containers if you want code isolation in external mode.
  3. Variables: Code nodes can no longer access  by default; you must explicitly allowlist the variables you want to expose.

This is just an overview of the changes; please check out their official docs, website, and blog post on this update!

Installing n8n with NPM

This quick guide walks through setting up n8n as a persistent background service using PM2.

Prerequisites

Install Node.js, npm, and nvm. Visit the official download page for an updated command and different platforms.

Step 1: Install or Update n8n

Install n8n globally via npm:


Install n8n globally via npm with their next channel for v2:


To update an existing installation to the latest version:


Verify the installation:


Step 2: Install PM2

PM2 is a production-ready process manager for Node.js applications. Running n8n directly in a terminal means it stops when you close the session. PM2 solves this by:

  • Keeping n8n running in the background
  • Automatically restarting it if it crashes
  • Starting n8n on system boot
  • Managing environment variables cleanly
  • Providing monitoring and log management

Install PM2 globally:


Step 3: Create the PM2 Configuration File

Create a configuration file in your home directory. This file tells PM2 how to run n8n and what environment variables to use.


Add the following content:


Save and exit (Ctrl+X, then Y, then Enter).

Environment Variables Explained

VariablePurpose
Set to to remove the [DEV] tag in the browser and enable production optimizations
The IP address n8n listens on. Use to accept connections from any interface, or a specific IP to restrict access
The port n8n runs on (default: 5678)
The public URL for webhooks. Required for triggers and external integrations to reach your instance

Step 4: Start n8n with PM2

Launch n8n using the configuration file:


Step 5: Enable Startup on Boot

Generate the startup script and save the current process list:


This outputs a command you need to run with sudo—copy and execute it. Then save the process list:


Now n8n will automatically start when your system boots.

PM2 Command Reference

Basic Process Management

CommandDescription
Start n8n using the config file
Stop the n8n process
Restart n8n
Remove n8n from PM2's process list

Monitoring and Logs

CommandDescription
Show all managed processes and their status
Real-time monitoring dashboard (CPU, memory, logs)
View n8n logs (Ctrl+C to exit)
View last 100 lines of logs

Configuration Changes

When you modify , apply the changes with:


Alternatively, for environment variable updates only:


Useful Diagnostics

CommandDescription
Detailed information about the n8n process
Show environment variables for process ID 0

Where is My Data Stored?

Your n8n data (workflows, credentials, settings) is stored separately from PM2 in:


Deleting and recreating the PM2 process does not affect your workflows or credentials.

Using n8n with NetBird

Check out our initial n8n video for a real use-case example using NetBird peers and resources with your workflows.