Migration Guide to ZTNET
This guide provides step-by-step instructions to help you migrate from other ZeroTier web UIs to ZTNET.
It is important to note that merging two ZeroTier instances is not possible, as they are fundamentally separate entities.
However, you can configure ZTNET to manage a different ZeroTier instance than the default one.
Scenario 1: Connecting Locally Installed ZeroTier to ZTNET Docker Installation
If you have ZeroTier installed locally using the official ZeroTier installation instructions, and your ZeroTier data is available at /var/lib/zerotier-one
on your host, follow these steps to move your networks to ZTNET in a Docker environment:
Step 1: Modify docker-compose.yml
for ztnet Installation
First, stop the running Docker services by navigating to the directory containing your docker-compose.yml
file and running:
docker-compose down
Next, modify your docker-compose.yml
file as follows:
- Comment out the
zerotier
service section, as ZTNET will use the local ZeroTier installation. - Comment out
zerotier
in thedepends_on
section of theztnet
service. - Update the
volumes
section of theztnet
service to mount the local ZeroTier data directory to the ZTNET container.
Example:
Only the relevant sections are shown below. The full docker-compose.yml
file should contain additional services and configurations.
services:
# zerotier:
# image: zyclonite/zerotier:1.14.0
# hostname: zerotier
# container_name: zerotier
# restart: unless-stopped
# volumes:
# - zerotier:/var/lib/zerotier-one
# cap_add:
# - NET_ADMIN
# - SYS_ADMIN
# devices:
# - /dev/net/tun:/dev/net/tun
# networks:
# - app-network
# ports:
# - "9993:9993/udp"
# environment:
# - ZT_OVERRIDE_LOCAL_CONF=true
# - ZT_ALLOW_MANAGEMENT_FROM=172.31.255.0/29
ztnet:
...
volumes:
# - zerotier:/var/lib/zerotier-one
- /var/lib/zerotier-one:/var/lib/zerotier-one
depends_on:
# - zerotier
Step 2: Configure ZeroTier
To allow ZTNET to manage your local ZeroTier instance, add the following configuration to your local.conf
file located in /var/lib/zerotier-one
:
Create the local.conf
file if it does not exist.
{
"settings": {
"allowManagementFrom": ["0.0.0.0/0"]
}
}
After updating local.conf
, restart the ZeroTier service:
sudo systemctl restart zerotier-one
Step 3: Start the Services
In your terminal, navigate to the directory containing your docker-compose.yml
file and run the following command to start the services:
docker-compose up -d
Step 4: Configure ZTNET to Use Local ZeroTier
To point ZTNET to use the local ZeroTier controller instead of the previously commented-out ZeroTier container, follow these steps:
- Go to the ZTNET web interface.
- Navigate to the Admin => Controller page.
- Add
http://server_ip:9993
to the ZeroTier API URL field. - Click save.
You should now be able to manage your ZeroTier network from the ZTNET web interface.
Example, where 10.0.0.32 is the IP address of the host server:
Step 5: Migrate Networks
In the Admin => Controller page, a new table will appear displaying all the "unlinked" networks, but only if there are networks present on the local controller.
ZTNET stores the user ID for all networks created in PostgreSQL. If a network was created outside of ZTNET, it will be considered "unlinked." To manage these networks within ZTNET, you need to assign them to a user.
Select a user from the dropdown menu to link the network to the chosen user. This will integrate the network into ZTNET, allowing for seamless management through the ZTNET interface.
Example:
Scenario 2:
To be continued...