Create a mesh
jalth init creates a new mesh in your Cloudflare account. It takes about two minutes and orchestrates six Cloudflare products behind a single interactive flow.
Prerequisites
Section titled “Prerequisites”- Cloudflare account (free tier is fine)
- Cloudflare API token with the recommended permissions
- WARP client installed (
jalth doctorreports missing prerequisites)
Optional: A domain on Cloudflare — required only for jalth serve with custom hostnames. Pass --domain myteam.com during init or set it later with jalth domain set.
Basic usage
Section titled “Basic usage”jalth initWith a custom domain (enables jalth serve immediately):
jalth init --domain myteam.comFor headless servers and CI (no browser SSO):
jalth init --unattendedWhat init does
Section titled “What init does”Validate credentials — Verifies API token permissions and auto-detects your admin email and Zero Trust team name.
Deploy Registry Worker — Creates D1 database, runs migrations, deploys the Worker with your API token as a secret.
Configure Zero Trust — Email OTP IdP, Access Groups (
jalth-members,jalth-admins,jalth-operators), enrollment policies, WARP device profile, SSH CA.Enroll this device — Writes WARP MDM config, registers device, assigns CGNAT IP.
Save config — Writes
~/.jalth/config.jsonwith registry URL and device token.
API token permissions
Section titled “API token permissions”The API token is bound to the Worker as a secret during deploy. It is never stored in D1 or client config. Future jalth init runs need the token again; upgrades do not.
| Permission | Scope | Level | Used for |
|---|---|---|---|
| User Details | User | Read | Auto-detect admin email |
| Zero Trust | Account | Edit | Devices, Gateway DNS, connectivity |
| Access: Organizations, IdPs, Groups | Account | Edit | Enrollment policies, Access Groups |
| Access: Apps and Policies | Account | Edit | WARP enrollment app, service apps |
| Access: SSH Auditing | Account | Edit | Gateway SSH CA |
| Access: Service Tokens | Account | Edit | Headless init + auth-key joins |
| Cloudflare Tunnel | Account | Edit | jalth serve tunnel lifecycle |
| Cloudflare DEX | Account | Read | Fleet status enrichment |
| Workers Scripts | Account | Edit | Deploy Worker, bind secrets |
| D1 | Account | Edit | Mesh database |
| DNS | Zone | Edit | Exposed service hostnames |
After init
Section titled “After init”Add people and headless servers:
jalth role set sarah@team.com memberjalth group add members --domain myteam.comjalth auth-key create --name homelab --reusableShare the join URL:
jalth join https://jalth.myteam.comCoexistence with existing Cloudflare setup
Section titled “Coexistence with existing Cloudflare setup”jalth reuses existing resources when safe:
- WARP enrollment — Works alongside same-org enrollment; different org requires leaving first.
- Device profile — Creates
jalth-mesh-routingwith its own split tunnel; default profile untouched. - Resources — All jalth resources are prefixed
jalth-*. Existing resources are never modified. - Destroy — Only deletes resources jalth created; pre-existing resources are left intact.
Idempotent resume
Section titled “Idempotent resume”If init fails midway, run jalth init again. Step 3 reconciles control-plane state — reuses what exists, creates what’s missing.