Zerotier Self-Hosted Moon Node
4/15/26Less than 1 minute
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.