Update NEXTAUTH_URL
in the docker-compose.yml
to the IP address you will use to access the ztnet web ui.
This is important or you will not be able to login. Generally you'll want to set it to your machine's LAN IP address.
Start everything with:
docker-compose up -d
Wait a few minutes for the database to be setup. It should take around 2 minutes. If you want to check, you can check with docker-compose logs
and see if ztnet
has said The seed command has been executed.
. Any errors after this can be ignored.
Run
docker exec -it $(docker ps | grep zt-controller | head -n 1 | cut -d ' ' -f1) cat /var/lib/zerotier-one/authtoken.secret
To get the API key for your controller.
Open the WebUI, signup, login and then navigate to the ZT Controller
menu.
Click Change on the Zerotier Secret
field and place in the API key from the step above and click submit.
Click Change on the Local Zerotier URL
field and place in http://zt-controller:9993
and click submit.
You should now see some of the errors on that screen disappear and see that it is communicating with the controller.
In the WebUI, create a new network by clicking on Local Controller
and then Create a netowrk
. A ID will be automatically generated, it'll look something like 8056c2e21c000001
.
Run the following command:
docker exec $(docker ps | grep zt-router | head -n 1 | cut -d ' ' -f1) zerotier-cli join 8056c2e21c000001
Be sure to update 8056c2e21c000001
with the actual network ID you created.
In the WebUI, inside the network's detail page (Can be accessed by clicking the network), scroll down to Network Members
. You should see your router there. Click the Auth
checkbox to grant it access. New network members must be approved the same way.
Restart the stack after joining and granting access to the network:
docker-compose down
docker-compose up
Check that the network interface on your host matches one of the ones under zerotier-router.environment["ZEROTIER_ONE_LOCAL_PHYS"]
. You can do this by running either iconfig
or ip addr
on the host machine.
Exec shell into a container:
docker exec -it $(docker ps | grep sinamics/ztnet | head -n 1 | cut -d ' ' -f1) /bin/bash
docker exec -it $(docker ps | grep zerotier-controller | head -n 1 | cut -d ' ' -f1) /bin/sh
docker exec -it $(docker ps | grep zerotier-router | head -n 1 | cut -d ' ' -f1) /bin/sh