Skip to content

Environment Variables

Complete reference for all environment variables used by TunTun components.

Control plane (tuntun-control)

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgres://user:pass@localhost:5432/tuntun
TUNTUN_SERVICE_SECRETInternal API shared secreta-long-random-string-at-least-32-characters

Management server

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgres://user:pass@localhost:5432/tuntun
BETTER_AUTH_SECRETAuth signing secret (32+ chars)a-long-random-string-at-least-32-characters
BETTER_AUTH_URLPublic URL of management serverhttp://localhost:3000
MANAGEMENT_PORTListen port3000
MANAGEMENT_WEB_ORIGINDashboard origin (CORS)http://localhost:5173
CONTROL_PLANE_ADMIN_URLControl plane admin APIhttp://127.0.0.1:9091
TUNTUN_SERVICE_SECRETInternal API shared secreta-long-random-string-at-least-32-characters

Dashboard

VariableDescriptionExample
VITE_MANAGEMENT_API_URLManagement API URLhttp://localhost:3000

Agent (tuntun)

VariableDescriptionExample
TUNTUN_STATE_DIRAgent state directory~/.local/state/tuntun
TUNTUN_CONTROL_URLControl plane URLhttp://127.0.0.1:8080
TUNTUN_MANAGEMENT_URLManagement API URLhttp://localhost:3000
TUNTUN_ENROLL_TOKENEnrollment tokeneyJ...
TUNTUN_ORG_SLUGOrganization slug (quick enroll)my-company
TUNTUN_HOSTNAMEMachine hostnameapi-prod
TUNTUN_IFNAMETUN interface nametuntun0
TUNTUN_POLL_SECSSnapshot poll interval30
TUNTUN_METRICS_BINDPrometheus metrics bind127.0.0.1:9100
TUNTUN_DISABLE_GOSSIPDisable gossiptrue
TUNTUN_RECORDEREnable SSH recordingtrue
TUNTUN_JSON_LOGSJSON log formattrue

Released under the AGPL-3.0 License.