selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Tunnet logo

Self-host Tunnet

v0.9.1

Open-source mesh VPN with tunnels, SSH, and Kubernetes

BetaOpen CoreOther
Updatedlast week
LanguageRust
Setup difficultyAdvanced
Stars
223
Ports
8080 (Agent WebSocket connections), 3000 (Management API), 9091 (Control plane admin API (internal)), 9090 (Control plane metrics (internal))
Requires
PostgreSQL
Install with Docker Compose

What is Tunnet?

Tunnet is an open-source mesh networking platform that connects machines into a private encrypted network anywhere. It provides a self-hosted stack with several server components and a web dashboard, plus optional edge and relay servers. The platform combines mesh VPN, public HTTPS tunnels, internal service exposure, peer-to-peer file transfer, identity-based SSH with session recording, device posture checks, and a Kubernetes operator under one identity and ACL system. Two modes exist: Managed for teams and Direct for individuals. The agent runs on Linux, macOS, and Windows. Self-hosting uses Docker Compose with PostgreSQL; the control plane listens on port 8080. Licensing is component-level: MPL-2.0 for agent/SDKs, AGPL-3.0-only for control plane/dashboard, Apache-2.0 for common code, with a commercial license option for AGPL components.

Should you self-host Tunnet?

Tunnet scores 46/100 on selfhost.directory (how scoring works) and ranks #42 of 56 in VPN. It has 223 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v0.9.1, came out on 2 September 2026.

Setup is advanced: plan for several services and some ongoing maintenance. It is Other-licensed and written mostly in Rust.

Its closest alternative on selfhost.directory is headscale (82/100, 45 138 stars). It scores higher overall, so compare the two before you pick. See Tunnet vs headscale side by side.

Features

  • Audit Logs
  • Device Posture
  • Direct Mode (Zero-Server P2P)
  • Embeddable SDKs
  • Go Management SDK
  • Identity-based SSH
  • Internal Service Exposure (Serve)
  • Kubernetes operator
  • Mesh VPN
  • Peer-to-Peer File Transfer (Send)
  • Policy as Code
  • Public HTTPS Tunnels
  • Self-hosted relay
  • SSO/OIDCManaged mode only
  • Web DashboardManaged mode only

Tunnet README

How to install Tunnet

Install Tunnet with Docker Compose

Docker and Docker Compose
Environment variables
DATABASE_URL, BETTER_AUTH_SECRET, TUNNET_SERVICE_SECRET, TUNNET_AUDIT_HMAC_KEY, TUNNET_LICENSE, DASHBOARD_URL, MANAGEMENT_URL, CONTROL_PLANE_URL, BETTER_AUTH_COOKIE_DOMAIN

Clone the repository

git clone https://github.com/tunnetio/Tunnet.git cd Tunnet

Set secrets (or use the defaults for local development)

export TUNNET_SERVICE_SECRET="$(openssl rand -base64 32)" export BETTER_AUTH_SECRET="$(openssl rand -base64 32)"

Start everything

docker compose up -d

Production-ready docker-compose.yml at repository root with postgres, migrate, control, management, and dashboard services

How to configure Tunnet

  • BETTER_AUTH_COOKIE_DOMAINOptional shared parent domain for dashboard/management auth cookies

    Optional shared parent domain for dashboard/management auth cookies

    values: example.com

  • BETTER_AUTH_SECRETAuth signing secret (32+ chars)

    Auth signing secret (32+ chars)

    values: a-long-random-string-at-least-32-characters

  • CONTROL_PLANE_URLhttp://localhost:8080Control plane URL (agent enroll, edge register)

    Control plane URL (agent enroll, edge register)

    values: http://example.com:8080

  • DASHBOARD_URLhttp://localhost:5173Dashboard origin (CORS, OAuth redirects, SSH browser auth)

    Dashboard origin (CORS, OAuth redirects, SSH browser auth)

    values: http://example.com

  • DATABASE_URLPostgreSQL connection string

    PostgreSQL connection string

    values: postgres://user:pass@host:5432/db

  • MANAGEMENT_URLhttp://localhost:3000Management API public URL (auth, REST API, CLI login)

    Management API public URL (auth, REST API, CLI login)

    values: http://example.com

  • TUNNET_ADMIN_BIND0.0.0.0:9091Control plane admin API bind address

    Control plane admin API bind address

    values: 127.0.0.1:9091

  • TUNNET_AUDIT_HMAC_KEYAudit integrity key (32+ chars)

    Audit integrity key (32+ chars)

    values: another-long-random-string-at-least-32-chars

  • TUNNET_BIND0.0.0.0:8080Control plane bind address

    Control plane bind address

    values: 0.0.0.0:8080

  • TUNNET_JSON_LOGStrueEnable JSON logging

    Enable JSON logging

    values: true|false

  • TUNNET_LICENSEOptional commercial license certificate

    Optional commercial license certificate

    values: /etc/tunnet/license.json or inline JSON or HTTPS URL

  • TUNNET_SERVICE_SECRETInternal API shared secret (management ↔ control)

    Internal API shared secret (management ↔ control)

    values: a-long-random-string-at-least-32-characters

Tunnet releases & version history

More in Kubernetes

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…