Zerotier Self-Hosted Moon Node
This guide explains how to set up a self-hosted Zerotier Moon node to improve network performance. Steps include installing dependencies, configuring the moon.json file, generating the moon file, and adding nodes using platform-specific paths (Linux, macOS, Windows). Completing these steps creates a private Moon server for reduced latency and greater control.
Zerotier Self-Hosted Moon Node
1. Install Zerotier Dependencies
First, the Linux host needs to install the necessary dependencies for Zerotier.
# Install dependencies
yum install wget gcc gcc-c++ git -y
yum install json-devel -y
# Download and install
curl -s https://install.zerotier.com/ | sudo bash2. Configure the moon.json File
Next, modify the Moon node configuration file.
cd /var/lib/zerotier-one/
# Export dependency info
zerotier-idtool initmoon identity.public >> moon.json
# Edit the configuration file - modify the stableEndpoints entry (IP address and port): "ip/9993"
vim moon.json3. Modify Configuration and Generate the Moon File
After adjusting the configuration file, restart the service.
# Create the moon server file
zerotier-idtool genmoon moon.json
# Create the moons.d directory
mkdir /var/lib/zerotier-one/moons.d
# Copy the generated .moon file into the moons.d directory (adjust the filename to match your actual generated file)
cp 000000951a0ea9af.moon ./moons.d/
# Restart the zerotier service
systemctl restart zerotier-one4. Add Other Nodes to the Moon Service
Place the generated .moon file into the moons.d folder within the Zerotier configuration directory on the respective operating system.
Configuration File Paths by Platform
- Linux:
/var/lib/zerotier-one/moons.d/ - macOS:
/Library/Application Support/ZeroTier/One/moons.d/ - Windows:
C:\ProgramData\ZeroTier\One\moons.d\
Note: On Windows, the
ProgramDatafolder is hidden. You need to enable "Show hidden items" in File Explorer to view it.