Install n2x-node Agent
The n2x-node agent is an open-source app that runs on the devices or applications you want to connect to the n2x.io platform.
n2x-node is available for a variety of Linux platforms, macOS and Windows.
Check out its GitHub repository for more details and information on support, contributing, etc.
Minimum Requirements
n2x-node has the same minimum requirements as Go:
- Linux kernel version 2.6.23 or later
- Windows 7 or later
- FreeBSD 11.2 or later
- MacOS 10.11 El Capitan or later
Download Binaries
Linux, macOS and Windows binary downloads are available from the Releases page at the n2x-node GitHub Repository.
You can download the pre-compiled binaries and install them with the appropriate tools.
Linux Installation
The n2x.io platform provides a one-line command for the simplest and quickest way to install the n2x-node agent in Linux. You'll find this command readily available when you add a new node through the n2x.io webUI.

-
Download the latest release.
curl -LO "https://dl.n2x.io/binaries/stable/latest/linux/amd64/n2x-node" -
Validate the binary (optional).
Download the
n2x-nodechecksum file:curl -LO "https://dl.n2x.io/binaries/stable/latest/linux/amd64/n2x-node_checksum.sha256"Validate the
n2x-nodebinary against the checksum file:sha256sum --check < n2x-node_checksum.sha256If valid, the output must be:
n2x-node: OKIf the check fails, sha256 exits with nonzero status and prints output similar to:
n2x-node: FAILED sha256sum: WARNING: 1 computed checksum did NOT match -
Install
n2x-nodeand create its configuration file according to your needs.sudo install -o root -g root -m 0750 n2x-node /usr/local/bin/n2x-node sudo mkdir /etc/n2x sudo vim /etc/n2x/n2x-node.ymlConfiguration Options
For detailed information and a complete list of configuration options, refer to the n2x-node configuration reference. These options allow you to customize your
n2x-nodeagent for specific needs. -
Create the
n2x-node.servicefor systemd.sudo cat << EOF > /etc/systemd/system/n2x-node.service [Unit] Description=n2x-node service Documentation=https://github.com/n2x-io/x-node After=network.target [Service] Type=simple # Another Type: forking # User= WorkingDirectory=/var/local/n2x ExecStart=/usr/local/bin/n2x-node start Restart=always # Other restart options: always, on-abort, etc # The install section is needed to use # 'systemctl enable' to start on boot # For a user service that you want to enable # and start automatically, use 'default.target' # For system level services, use 'multi-user.target' [Install] WantedBy=multi-user.target EOF -
Ensure the
tunkernel module is loaded.sudo modprobe tun -
Start the
n2x-nodeservice.sudo systemctl daemon-reload sudo systemctl enable n2x-node sudo systemctl start n2x-node -
Check
n2x-nodeservice status.sudo systemctl status n2x-node
n2x.io provides a package repository that contains both DEB and RPM downloads.
-
Run the following to setup a new APT
sources.listentry and installn2x-node.echo 'deb [trusted=yes] https://repo.n2x.io/apt/ /' | sudo tee /etc/apt/sources.list.d/n2x.list sudo apt update sudo apt install n2x-node -
Check
n2x-nodeservice status.sudo systemctl status n2x-node
-
Run the following to create a
n2x.repofile and installn2x-node.cat <<EOF | sudo tee /etc/yum.repos.d/n2x.repo [n2x] name=n2x Repository - Stable baseurl=https://repo.n2x.io/yum enabled=1 gpgcheck=0 EOF sudo yum install n2x-node -
Check
n2x-nodeservice status.sudo systemctl status n2x-node
Automating Installation on Main Cloud Platforms
Let's explore how to automate the n2x-node agent installation process on Linux VMs within main cloud environments.
Simplify the installation process for the n2x-node agent on your Linux VMs within the AWS cloud environment:
-
Configure User Data: During VM creation within AWS, navigate to the
Advanced detailssection and scroll down to locate theUser datafield. Here, paste the one-line installation command provided by n2x.io when you add a new node to your n2x.io platform.
-
Launch VM: Once you've added the command, proceed with launching your virtual machine instance.
Monitoring Script Output
The script's output will be logged to the file
/var/log/cloud-init-output.logon your newly created VM. You can access this log file to review the installation process and confirm successful deployment of then2x-nodeagent.Additional Resources
For a deeper dive into AWS user data, refer to the official documentation.
Simplify the installation process for the n2x-node agent on your Linux VMs within the Azure cloud environment:
-
Configure Custom Data: When creating a new VM in Azure, navigate to the
Advanced settingssection. Locate theCustom datafield and paste the one-line installation command provided by n2x.io when you add a new nodeto your n2x.io platform.
-
Launch VM: After adding the command, proceed with launching your virtual machine instance.
Monitoring Script Output
The script's output will be logged to the file
/var/log/cloud-init-output.logon your newly created VM. You can access this log file to review the installation process and confirm successful deployment of then2x-nodeagent.Additional Resources
For a deeper dive into Azure custom data, refer to the official documentation.
Simplify the installation process for the n2x-node agent on your Linux VMs within the Google Cloud Platform (GCP) environment:
-
Configure Startup Script: When creating a new VM in GCP, navigate to the
Advanced Optionssection and then selectManagement. Under theAutomationsection, locate the field forstartup scriptsand paste the one-line installation command provided by n2x.io when you add a new node to your n2x.io platform.
-
Launch VM: Proceed with launching your virtual machine instance after adding the command.
Monitoring Script Output
To review the installation process and confirm successful deployment of the n2x-node agent, access the script's output on your VM using the following command:
sudo journalctl -u google-startup-scripts.serviceAdditional Resources
For a deeper understanding of GCP startup scripts, refer to the official documentation.
macOS Installation
The n2x.io platform provides a one-line command for the simplest and quickest way to install the n2x-node agent in macOs. You'll find this command readily available when you add a new node through the n2x.io web interface.

-
Download the latest release.
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/amd64/n2x-node"curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/arm64/n2x-node" -
Validate the binary (optional).
Download the n2x-node checksum file:
curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/amd64/n2x-node_checksum.sha256"curl -LO "https://dl.n2x.io/binaries/stable/latest/darwin/arm64/n2x-node_checksum.sha256"Validate the n2x-node binary against the checksum file:
shasum --algorithm 256 --check n2x-node_checksum.sha256If valid, the output must be:
n2x-node: OKIf the check fails, sha256 exits with nonzero status and prints output similar to:
n2x-node: FAILED sha256sum: WARNING: 1 computed checksum did NOT match -
Install
n2x-nodeand create its configuration file according to your needs.chmod +x n2x-node sudo mkdir -p /usr/local/libexec sudo mv n2x-node /usr/local/libexec/n2x-node sudo chown root: /usr/local/libexec/n2x-node sudo mkdir /etc/n2x sudo vim /etc/n2x/n2x-node.yml sudo chmod 600 /etc/n2x/n2x-node.ymlWarning
In macOS,
agent.ifacemust beutun[0-9]+in then2x-node.yml, beingutun5usually a good choice for that setting. Use the commandifconfig -abefore launching then2x-nodeservice and check that the interface is not in-use.Configuration Options
For detailed information and a complete list of configuration options, refer to the n2x-node configuration reference. These options allow you to customize your
n2x-nodeagent for specific needs. -
Install and start the n2x-node agent as a system service.
sudo /usr/local/libexec/n2x-node service-install -
Check the service status.
launchctl print system/io.n2x.n2x-nodeYou should get an output like this:
system/io.n2x.n2x-node = { active count = 1 path = /Library/LaunchDaemons/io.n2x.n2x-node.plist state = running program = /usr/local/libexec/n2x-node arguments = { /usr/local/libexec/n2x-node service-start } working directory = /var/tmp stdout path = /usr/local/var/log/io.n2x.n2x-node.out.log stderr path = /usr/local/var/log/io.n2x.n2x-node.err.log default environment = { PATH => /usr/bin:/bin:/usr/sbin:/sbin } environment = { XPC_SERVICE_NAME => io.n2x.n2x-node } domain = system minimum runtime = 10 exit timeout = 5 runs = 1 pid = 3925 immediate reason = speculative forks = 28 execs = 1 initialized = 1 trampolined = 1 started suspended = 0 proxy started suspended = 0 last exit code = (never exited) spawn type = daemon (3) jetsam priority = 4 jetsam memory limit (active) = (unlimited) jetsam memory limit (inactive) = (unlimited) jetsamproperties category = daemon submitted job. ignore execute allowed jetsam thread limit = 32 cpumon = default properties = keepalive | runatload | inferred program }
Windows Installation
The n2x.io platform provides a one-line command for the simplest and quickest way to install the n2x-node agent in Windows. You'll find this command readily available when you add a new node through the n2x.io web interface.

-
Open the Windows PowerShell as Administrator and create a folder for n2x.
mkdir 'C:\Program Files\n2x' -
Download the latest release into the n2x folder.
curl -Uri "https://dl.n2x.io/binaries/stable/latest/windows/amd64/n2x-node.exe" -Outfile n2x-node.exe -
Validate the binary (optional).
Download the n2x-node.exe checksum file:
curl -Uri "https://dl.n2x.io/binaries/stable/latest/windows/amd64/n2x-node.exe_checksum.sha256" -Outfile n2x-node.exe_checksum.sha256Validate the
n2x-node.exebinary against the checksum file:-
Using Command Prompt to manually compare CertUtil's output to the checksum file downloaded:
CertUtil -hashfile n2x-node.exe SHA256 type n2x-node.exe_checksum.sha256 -
Using PowerShell to automate the verification using the -eq operator to get a
TrueorFalseresult:$($(CertUtil -hashfile .\n2x-node.exe SHA256)[1] -replace " ", "") -eq $(type .\n2x-node.exe_checksum.sha256).split(" ")[0]
-
-
Download the
wintundriver from https://wintun.net. -
Unzip the wintun archive and copy the AMD64 binary
wintun.dlltoC:\Program Files\n2x. -
Use an editor to create the n2x-node configuration file
C:\Program Files\n2x\n2x-node.yml.Configuration Options
For detailed information and a complete list of configuration options, refer to the n2x-node configuration reference. These options allow you to customize your
n2x-nodeagent for specific needs. -
Install the
n2x-nodeagent as a Windows service.'C:\Program Files\n2x\n2x-node.exe' service-installInfo
The instructions below assume that the
wintun.dll,n2x-node.exeandn2x-node.ymlfiles are stored inC:\Program Files\n2x. -
Start the
n2x-nodeservice.start-Service n2x-node -
Check
n2x-nodeservice status.get-Service n2x-node
Running with Docker
You can also run the n2x-node agent as a Docker container.
Registry:
ghcr.io/n2x-io/n2x-node
The n2x.io platform provides a one-line command for the simplest and quickest way to running the n2x-node agent in Docker. You'll find this command readily available when you add a new node through the n2x.io web interface.

Example usage:
docker run -d --restart=always \
--net=host \
--cap-add=net_admin \
--device=/dev/net/tun \
--name n2x-node \
-v /etc/n2x:/etc/n2x:ro \
ghcr.io/n2x-io/n2x-node:latest start
Artifacts Verification
All artifacts are checksummed and the checksum file is signed with cosign.
-
Download the files you want and the
checksums.txt,checksum.txt.pemandchecksums.txt.sigfiles from the Releases page: -
Verify the signature:
cosign verify-blob \ --cert checksums.txt.pem \ --signature checksums.txt.sig \ checksums.txt -
If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary:
sha256sum --ignore-missing -c checksums.txt
Our Docker images are signed with cosign.
Verify the signatures:
COSIGN_EXPERIMENTAL=1 cosign verify ghcr.io/n2x-io/n2x-node
Configuration
Once installed you can review the configuration at /etc/n2x/n2x-node.yml.
Configuration Options
For detailed information and a complete list of configuration options, refer to the n2x-node configuration reference. These options allow you to customize your n2x-node agent for specific needs.
Uninstall
To remove n2x-node agent from the system, use the following commands:
sudo systemctl stop n2x-node
sudo systemctl disable n2x-node
sudo rm /etc/systemd/system/n2x-node.service
sudo systemctl daemon-reload
sudo rm /usr/local/bin/n2x-node
sudo rm /etc/n2x/n2x-node.yml
sudo rmdir /etc/n2x
sudo rm -rf /var/lib/n2x
sudo rm -rf /var/cache/n2x
sudo systemctl stop n2x-node
sudo apt-get -y remove n2x-node
sudo rm /etc/n2x/n2x-node.yml
sudo rmdir /etc/n2x
sudo rm -rf /var/lib/n2x
sudo rm -rf /var/cache/n2x
sudo systemctl stop n2x-node
sudo yum -y remove n2x-node
sudo rm /etc/n2x/n2x-node.yml
sudo rmdir /etc/n2x
sudo rm -rf /var/lib/n2x
sudo rm -rf /var/cache/n2x
To remove n2x-node agent from the system, use the following commands:
sudo /usr/local/libexec/n2x-node service-uninstall
sudo rm /usr/local/libexec/n2x-node
sudo rm /etc/n2x/n2x-node.yml
sudo rmdir /etc/n2x
To remove n2x-node agent from the system, open the Windows PowerShell as Administrator and use the following commands:
stop-Service "n2x-node"
'C:\Program Files\n2xn2x-node.exe` service-uninstall
rm 'C:\Program Files\n2x' -r -force