Need help with libzt?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

496 Stars 154 Forks Other 1.1K Commits 23 Opened issues


ZeroTier Sockets - Put a network stack in your app

Services available


Need anything else?

Contributors list

ZeroTier SDK


Peer-to-peer and cross-platform encrypted connections built right into your app or service. No drivers, no root, and no host configuration.

Examples | API Documentation | Community | Report a Bug

@zerotier r/zerotier

latest libzt version Last Commit Build Status (master branch)

| Language/Platform | Installation | Version | Example | |:----------|:---------|:---|:---| | C/C++ | Build from source | version|C/C++ | | Objective-C | See examples/objective-c | version |Objective-C | | C# |

Install-Package ZeroTier.Sockets
| |C# | | Python |
pip install libzt
| |Python | | Rust | Coming very soon | version|Rust | | Swift | See examples/swift |version |Swift | | Java |
./ host-jar
| |Java | | Node.js | See examples/nodejs ||Node.js | | Linux | Build from source | version| C/C++ | | macOS |
brew install libzt
| | C/C++, Objective-C | | iOS / iPadOS |
./ ios-framework
| | Objective-C, Swift | | Android |
./ android-aar
| | Java |

#include "ZeroTierSockets.h"

int main() { zts_start(...) zts_join(networkId); int fd = zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0); zts_connect(fd, ...); ... }

Build from source

git submodule update --init

This project uses CMake as a build system generator. The scripts

simplify building and packaging for various targets. There are many targets and configurations not mentioned here.

|Platform| Build instructions | Notes | |:---|:---|:---| |Linux |

./ host "release"
| | |macOS |
./ host "release"
| | |Windows |
. .\build.ps1; Build-Host -BuildType "Release"
| build.ps1, Requires PowerShell|

Using the

keyword will automatically detect the current machine type and build standard libzt for use in C/C++ (no additional language bindings.) See
./ list
for additional target options.
depends on cURL for the optional portion of the API that interfaces with our hosted web offering ( If you do not need this functionality you can omit it by passing
to CMake.

Example output:

├── bin
│   ├── client
│   ├── server
│   └── ...
└── lib
    ├── libzt.a
    └── libzt.dylib

Important directories:

|Directory| Purpose| |:---|:---| |

| Contains finished targets (libraries, binaries, packages, etc.)| |
| Contains build system caches that can safely be deleted after use.| |
| Contains project, script and spec files to generate packages.|

Self-hosting (Optional)

We provide ways for your app or enterprise to function indepenently from any of our services if desired.

While we do operate a global network of redundant root servers, network controllers and an admin API/UI called Central, some use-cases require full control over the infrastructure and we try to make it as easy as possible to set up your own controllers and root servers: See here to learn more about how to set up your own network controller, and here to learn more about setting up your own roots.



ZeroTier and the ZeroTier SDK (libzt and libztcore) are licensed under the BSL version 1.1. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license. A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.). If you want a commercial license to use the ZeroTier SDK in your product contact us directly via [email protected]

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.