Skip to content
EN

Tunnels

A tunnel is a public link to your Varin, so you can reach it from an ordinary browser on another network. Use varin tunnel to create one for a running instance.

Connecting your own devices (the mobile app, another desktop) usually doesn’t need a tunnel — pair them instead and let the end-to-end encrypted Private Relay handle away-from-home access once the server has a relay configured (VARIN_RELAY_URL).

Varin starts the tunnel provider CLI on your machine. Install the provider you want to use first:

Terminal window
brew install cloudflared
brew install ngrok

Cloudflare quick tunnels can run with cloudflared. Ngrok requires an ngrok account and an authtoken from the ngrok dashboard:

Terminal window
ngrok config add-authtoken <your-ngrok-token>
  1. Start Varin:
Terminal window
varin

If you skip this step, varin tunnel start can auto-start a CLI server. When auto-starting, you can pass server options such as --port, --host, --lan, --ui-password, and --api-only.

  1. Start a Cloudflare tunnel:
Terminal window
varin tunnel start --provider cloudflare --mode quick

Or start an Ngrok tunnel:

Terminal window
varin tunnel start --provider ngrok --mode quick
  1. Check status:
Terminal window
varin tunnel status

When the tunnel is up, status shows a public URL. Open it, or scan the QR code, to reach Varin from anywhere.

By default, Varin prints a QR code in interactive TTY sessions. Use --qr to force QR output, or --no-qr to disable it.

  • cloudflare: quick, managed remote, and managed local modes
  • ngrok: quick mode

Use a token + hostname managed by Cloudflare:

Terminal window
varin tunnel start --provider cloudflare --mode managed-remote --token-file ~/.secrets/cf-token --hostname app.example.com

Use a local cloudflared config:

Terminal window
varin tunnel start --provider cloudflare --mode managed-local --config ~/.cloudflared/config.yml

Save a reusable profile:

Terminal window
varin tunnel profile add --provider cloudflare --mode managed-remote --name prod-main --hostname app.example.com --token-file ~/.secrets/cf-token

Start using the saved profile:

Terminal window
varin tunnel start --profile prod-main
Terminal window
varin tunnel providers
varin tunnel ready --provider cloudflare
varin tunnel ready --provider ngrok
varin tunnel doctor --provider cloudflare
varin tunnel doctor --provider ngrok
varin tunnel stop --port 3000
  • one active tunnel per Varin instance (port)
  • starting a new mode/provider on same instance replaces previous tunnel
  • generating a new connect link revokes previous unused one
  • tunnel auto-start preserves server flags like --ui-password and --api-only in the instance settings used by restart/update flows