ZTNET - Self-Hosted ZeroTier network controller.
Bug Report
·
Feature Request
·
Ask a Question
ZTNET - Zerotier Controller Web UI, is a robust and versatile ZeroTier controller application designed to ease the management of ZeroTier networks. Crafted with state-of-the-art technologies like T3-Stack with Next.js, Prisma, tRPC, TypeScript, Tailwind CSS, and DaisyUI, it streamlines the process of creating, updating, and overseeing your ZeroTier networks.
With a rich palette of features, and an intuitive user interface, ZTNET embodies a paradigm shift in network management experience. It elegantly handles the complexity, letting you focus on what you do best.
Table of Contents
🍬 ZeroTier Central API Support 🌐 Custom Root: Craft Your Private World 🛰️ 6plane and rfc4193 IPv6 Support 🚀 Personalized User Spaces & Networks 🌍 Multi-Language 🛠️ Multi-Architecture 📧 Email Invitations |
Skip the hassle of cloning the repository. Simply create a docker-compose.yml
file on your machine and populate it as follows:
version: "3.1"
services:
postgres:
image: postgres:15.2-alpine
container_name: postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ztnet
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- app-network
zerotier:
image: zyclonite/zerotier:1.10.6
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:
image: sinamics/ztnet:latest
container_name: ztnet
working_dir: /app
volumes:
- zerotier:/var/lib/zerotier-one
restart: unless-stopped
ports:
- 3000:3000
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ztnet
NEXTAUTH_URL: "http://localhost:3000"
NEXTAUTH_SECRET: "random_secret"
networks:
- app-network
links:
- postgres
depends_on:
- postgres
- zerotier
volumes:
zerotier:
postgres-data:
networks:
app-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.31.255.0/29
To launch ZTNET, execute the following command in your docker-compose.yml
directory:
docker-compose up -d
This action pulls necessary images, initializes the containers, and activates the services.
Visit http://localhost:3000
to access the ZTNET web interface.
As an administrator, you possess unique capabilities not available to regular users. This includes the ability to view all registered accounts on the controller.
Please note that while admins have visibility over registered accounts, they cannot interact with or modify other users' networks directly. Each network's configuration and data remain exclusive to the respective user account, maintaining privacy and security for all users.
The docker-compose.yml
file includes several environment variables that you can customize based on your needs. Here is a description of each variable:
POSTGRES_HOST
: The hostname of the PostgreSQL service.POSTGRES_PORT
: The port number for the PostgreSQL service.POSTGRES_USER
: The username for the PostgreSQL database.POSTGRES_PASSWORD
: The password for the PostgreSQL database user.POSTGRES_DB
: The name of the PostgreSQL database.NEXTAUTH_URL
: The URL for NextAuth authentication.NEXTAUTH_SECRET
: The secret key for NextAuth authentication.
These are system environment variables used by the ZeroTier service and should not be changed:
ZT_OVERRIDE_LOCAL_CONF
: Allows overriding local ZeroTier configuration.ZT_ALLOW_MANAGEMENT_FROM
: Defines the IP range allowed to access the ZeroTier management interface.ZT_ADDR
: The address of the ZeroTier service.
To change any of these values, update the corresponding environment variable in the docker-compose.yml
file.
This project welcomes contributions. To ensure smooth collaboration, please follow the steps below:
- Before submitting a PR, make sure to run the linter and tests to check for any errors. You can do this by running the following commands in your terminal:
npm run lint
andnpm run test
- Install Visual Studio Code and the Remote Development Extension Pack.
- Clone this repository.
- Open the repository in Visual Studio Code.
- Select Remote-Containers: Open Folder in Container... from the Command Palette (F1).
- Select Reopen in Container when prompted.
- Once the container is running, hit (F1) and type Task to open the task menu.
- Select Install dependencies packages to install all the dependencies.
- Select Start Development Server to start the development server.
- Open browser and go to
http://localhost:3000
.
NOTE: Hot reloading on Windows may not be as performant as on other operating systems. If you encounter sluggish hot reloading, consider setting the environment variable WATCHPACK_POLLING=true. However, for optimal performance, we strongly suggest utilizing the Windows Subsystem for Linux (WSL) to develop your application. This approach will provide a swift and seamless hot reload experience, allowing you to focus on coding rather than waiting for the application to reload.
View the following images for a visual overview of the ZTNet application:
Please note that while this application aims to make managing ZeroTier networks easier, it is provided "as is" without any warranties or guarantees of any kind. As the user, you assume all responsibility for its use. Always ensure you have adequate backups and understanding of any changes you make to your network configurations. This includes understanding that the first registered user will be granted administrative privileges.
This project utilizes the mkworld tool, written in Go, to generate the custom planet file. While the original mkworld tool was developed by ZeroTier, the version we are using was adapted and re-implemented in Go by Patrick Young (@kmahyyg). This Go adaptation is licensed under the GNU General Public License v3.0. We would like to express our appreciation to Patrick Young (@kmahyyg) for his efforts in creating this Go version, which has benefited our project.
Our project, in its entirety, is also licensed under the GNU General Public License v3.0. For a comprehensive understanding of our project's licensing terms, please consult our LICENSE file.