Server configuration
Put startup settings in server.yml. The server binary includes the management console. A native deployment can start with SQLite. Configuration file rules
Startup, root CA, and Tunnel CA
- Generate the ML-DSA-87 root offline and issue the online Tunnel CA. Import its material directory using
managed_pki_seed. Generate a root CA - Set the gateway DNS name or IP address, database, and initial administrator password.
- Run
./server --config ./server.yml runfrom the deployment directory. On Windows, use./server.exe.
host: api.tunnel.example.com
database: sqlite
managed_pki_seed: ./pki
admin_password_file: ./admin-password.txt| Key | Purpose |
|---|---|
host | Required. Use the gateway DNS name or IP address clients connect to. Tunnel uses it for the gateway certificate SAN and the default XTCP probe address. Precedence is --host, TUNNEL_HOST, then host in the configuration file. |
data_path | SQLite storage directory. Defaults to data/ beside the executable and holds state.db and its auxiliary files. |
log_path | Directory for log files. SQLite defaults to logs/ beside the data directory. MySQL and PostgreSQL default to logs/ beside the executable. The server logs to the console only if the path resolves to the SQLite data directory or a subdirectory. |
database | sqlite, postgres, or mysql. Set the external database URL in TUNNEL_DATABASE_URL. For a fresh installation, use a dedicated empty database for the gateway. The first start creates the current schema. |
managed_pki_seed | First-start directory prepared by server init-pki --pki DIR --offline-root OFFLINE_DIR. It contains root.pem, issuer.pem, and issuer.key. Set TUNNEL_MANAGED_PKI_SEED or --managed-pki-seed. |
The server refuses to start if all three sources omit host. For local testing, you can explicitly set 127.0.0.1.
The server stores managed online material and the generated transport token in the database on its first start. Keep root.key offline when importing a pre-issued Tunnel CA. To let the server issue the Tunnel CA, omit managed_pki_seed and provide cert/root.pem and cert/root.key in its working directory, or set root_ca_pem_path and root_ca_key_path to the existing root CA files. The server also uses these root CA files for managed CA rotation. Data and logs · Backup and controlled recovery
Initial administrator password
Set a 12–256 byte password for the first startup with an empty database. Use --admin-password, TUNNEL_INIT_ADMIN_PASSWORD, or admin_password. For a UTF-8 password file, use --admin-password-file, TUNNEL_ADMIN_PASSWORD_FILE, or admin_password_file.
Put the password from this example in admin-password.txt and grant read access only to the server account. Use a regular UTF-8 file, optionally ending in one LF or CRLF. The command line takes precedence over the environment, which takes precedence over the configuration file. At the same level, the password value takes precedence over the file. The server uses these settings to create the single administrator account admin when the accounts table is empty. Later starts use the stored password hash and skip reading the initial password file. You can remove these settings after initialization.
Listeners
| Key | Default bind address | Purpose |
|---|---|---|
admin | 0.0.0.0:9650 | TCP serves cleartext management HTTP. UDP is dedicated to device enrollment over PQC HTTP/3. |
control | 0.0.0.0:9651 | TCP control listener for native mutual TLS, WSS, and WS with inner mutual TLS. It verifies device certificates and transport tokens. |
relay | 0.0.0.0:9652 | Work relay over TCP/TLS, WSS, WS with inner TLS, or QUIC on UDP. |
gateway | 0.0.0.0:9653 | Visitor ingress over TCP/TLS, WSS, or QUIC. UDP also carries XTCP probes. |
kcp_relay | 0.0.0.0:9654 | KCP work relay over UDP. |
Open http://SERVER_ADDRESS:9650/ in a browser to sign in. You can configure a separate HTTPS entry point for the console. HTTPS reverse proxy
Management request addresses
Management TCP requests use the peer IP in login records and access checks and apply cleartext HTTP session handling. Requests through the Unix socket use the single valid X-Real-IP forwarded by Nginx. A missing, repeated, or invalid header results in HTTP 400. Nginx configuration
Create /run/xigexb-tunnel on Linux to enable the admin.sock listener at startup. On the same host, Nginx can forward the console and management API over the socket with X-Forwarded-Proto: https. HTTPS requests through the socket use secure session cookies. Socket permissions and mount
The device enrollment endpoint /_xigexb/device-key is served only over direct HTTP/3 on the gateway. It uses the gateway certificate and the management UDP port, 9650/UDP by default. Enrollment address
Business ingress
Select a listen_port from the pool when creating a web reverse proxy or TCPMUX route under Business Routes. Enable web_tls for HTTPS. To enable web_http3, keep the same port available on UDP. Using force_https requires web_tls on that port. Set the domain certificate under Domains and Certificates. Web routing example · TCPMUX example
Fixed business listeners
| Key | Port protocol | Purpose |
|---|---|---|
http_proxy | TCP | Dedicated WS ingress. |
https_proxy | TCP | HTTPS SNI passthrough. The target terminates TLS. |
https_terminate | TCP | Dedicated WSS ingress. |
These listeners bind with the corresponding enabled routes. Set public_listen_always: true to bind at startup. WebSocket TCP/UDP also requires a registered port, domain, and path. Restart the server after changing fixed listener settings.
Public certificates and port publishing
Upload the ML-DSA-87 certificate chain and key for the domain in Domains and Certificates when Tunnel terminates HTTPS, WSS, or HTTP/3. The peer must support TLS 1.3, ML-DSA-87 certificate authentication, pure MLKEM1024, and TLS_AES_256_GCM_SHA384. HTTPS passthrough routes by SNI, with TLS terminating at the target service. Web routing
The bundled Let's Encrypt DNS-01 adapter lacks PQC issuance support, so the server marks issuance as unavailable. Upload an externally issued ML-DSA-87 business certificate, or terminate public HTTPS at Nginx with the site certificate and proxy over HTTP to the corresponding Tunnel business port. HTTPS reverse proxy
Register a port in Resources → Port resources before creating a native TCP or UDP mapping. Every 45 seconds, the server tests each general-purpose port over TCP and UDP and each dedicated WS/WSS port over TCP. You can retest an individual port. Creating a mapping rechecks the listener for its ingress protocol. Server listener ports are reserved. Native mapping example · Deployment ports
Work relay tuning and diagnostics
QUIC defaults to the same port number as relay. Set quic_relay for a separate UDP listener. Use tcp_relay and ws_tls_relay for extra dedicated listeners. XTCP probes share the visitor QUIC port by default. The advertised address uses the gateway hostname and the probe listener's port. Relay tuning · XTCP
Compose configuration
The image reads /app/app.yml by default. Its built-in configuration uses MySQL. The container working directory is /app. For Nginx on the same host, mount the shared runtime directory at /run/xigexb-tunnel. Compose deployment
MQTT relays
Add a broker under Resources → MQTT Relays. Set its TLS port, topic namespace, gateway certificate name, and credentials. Saving and changing relay status takes effect at runtime. Both the server and MQTT clients need access to the broker. MQTT example
Supply a dedicated ML-DSA-87 CA for the broker. The broker must support TLS 1.3, ML-DSA-87 certificate authentication, pure MLKEM1024, and TLS_AES_256_GCM_SHA384. When the broker requires client authentication, provide the ML-DSA-87 certificate and private key together. The inner MQTT tunnel uses the device certificate and Tunnel CA from the ZIP.
Use mqtt_profiles, --mqtt-profiles, or TUNNEL_MQTT_PROFILES to specify an optional initial relay file. Tunnel imports the relays, credentials, and certificates when it initializes MQTT settings, then reads the database on later starts. The resource list shows imported relays as deployment configuration. Use the console to create and edit managed relays. Configuration keys
Advanced service settings
- Prometheus requires
metricsandmetrics_token_file. A non-loopback listener also requires TLS. Metrics and hooks - Import externally issued ML-DSA-87 certificates for Tunnel business TLS. Certificate operations
- Set
ssh_gateway_listento reserve the port for a standalone SSH gateway on the same host. SSH gateway policy