CHAN-GATEWAY / SELF-HOSTED ACCESS
Always-on environments.
Your domain.
Provision managed devservers with your team's tools and a personal access token (PAT). People sign in with OAuth2 and reach their environment from Chan Desktop or a browser, without ssh.
open its windows
WebSocket
forwards traffic
a TLS tunnel
After admission, data flows both ways through the tunnel. Files and processes live on the devserver; their traffic passes through your gateway. Access grants cover a devserver's entire library. Read the gateway design doc →
- Always on.Keep builds, agents, and shells running on managed hosts. Disconnect your client and return to your work.
- OAuth2, without ssh.Manage access through accounts, devserver grants, and tokens.
- Provision once.Prepare tools and dependencies on each host. Its PAT connects it to your gateway.
- Scale the proxy fleet.Add proxy nodes as usage grows. Terminal and file traffic bypasses the central controller.
01 / INTEGRATION POINTS
Sign-in, access, and traffic.
gw.example.comrevocation
commands
Identity also stores account sessions in Postgres. Workspace traffic travels through the proxy; the controller carries only metadata and commands. Internal APIs stay private.
02 / CONTROL PLANE
Access is an operational control.
Decide what connects.
Set per-user devserver limits, suspend access, and pause fleet admissions. Every tunnel passes signed admission checks.
Keep authority in one place.
Manage enrolment, devserver grants, and PATs. Durable policy and audit records live in Postgres.
Act on running connections.
Inspect proxies and tunnels, revoke sessions, or pause the fleet with fleet pause --drain. A drain disconnects active sessions and tunnels; resume reopens admission.
chan-gateway-admin fleet status
chan-gateway-admin proxy ps
chan-gateway-admin tunnel psWork runs on the devservers independently of client connections. Proxy nodes scale the data path; a singleton controller coordinates admission and policy. On loss of control connectivity, admission stops and existing tunnels close after a bounded grace period. See the scaling and recovery design and operator commands.
03 / SETUP
Bring your domain.
Start with one proxy node, p1. These example names show the DNS and TLS boundaries.
gw.example.com- Sign-in, accounts, and desktop discovery.
proxy.example.com- Outbound tunnel ingress and proxy health.
*.p1.proxy.example.com- A separate origin for each devserver.
- 01
Deploy the services and database.
Run identity, profile, devserver-control, devserver-proxy, and Postgres. Configure distinct service credentials and signing keys. Apply the database schema jobs before starting runtime services. Use the deployment guide and manifests.
- 02
Connect DNS, TLS, and OAuth.
Point the names above to your TLS edge and configure a sign-in provider. Route account requests to identity, tenant HTTP/WebSockets to the proxy, and
/v1/tunnelto its HTTP/2 ingress. Keep internal listeners on loopback or an authenticated, encrypted private network. - 03
Provision tools and publish the devserver.
Enrol users and grant the sign-in and devserver feature flags, which default to off. Install Chan and your team's tools on each managed host. Create a PAT with the
tunnelscope in your gateway and supply it asCHAN_TUNNEL_TOKENon the devserver. Then run:chan devserver run \ --tunnel-url https://proxy.example.com/v1/tunnel \ --tunnel-devserver-name build-hostEach devserver uses its own token. The token identifies that devserver's registration.
- 04
Add your gateway to Chan.
In Computers, press
gto open Gateways. Choose Add gateway, enterhttps://gw.example.com, connect, and sign in. Return to Computers to open owned and shared devservers.
The gateway design explains the architecture. The service documentation covers configuration, and the enrolment guide covers first sign-in.
04 / WIREGUARD
Reach a private gateway.
The devserver and Chan Desktop can each run a userspace WireGuard peer inside their process, with no OS interface, host routes, root privileges, or separate VPN client. The gateway side uses an ordinary WireGuard peer. On the devserver, add --tunnel-wireguard /absolute/path/to/devserver.conf to the command above, or set CHAN_TUNNEL_WIREGUARD; the tunnel URL and PAT are still required.
In the desktop launcher's Add or Edit gateway form, set WireGuard file to the desktop's wg-quick file, using an absolute path or ~/. The file takes effect as soon as you save: changing the path starts the new tunnel, and clearing it ends the old one. Its HTTP requests, window feed and webviews reach destinations in the configured AllowedIPs through WireGuard; other destinations connect directly. Browser sign-in uses your system browser, which needs its own network access to the gateway's identity URL.
The file has one [Interface] with PrivateKey, Address and optional MTU, and one [Peer] with PublicKey, Endpoint, AllowedIPs and optional PresharedKey and PersistentKeepalive. OS settings (DNS, Table, FwMark, ListenPort), hooks (PreUp, PostUp, PreDown, PostDown), SaveConfig, unknown keys and additional peers are refused. On Unix, remove all group and other permission bits with chmod 600 FILE; Windows ACLs are left to the user.
The devserver manual has the command example. The chan-wireguard design describes the peer, TCP stack and desktop proxy.