Gather what you need
You need a Mac, Homebrew to install things from the Terminal, and a free Cloudflare account. Your own domain is optional. Without one you still get a random address.
- A Mac with Homebrew. Check with
brew --version. If that fails, install it from brew.sh. - A free Cloudflare account at dash.cloudflare.com.
- Optional: a domain you own. It can stay with the company you bought it from, such as Hover.
- Optional: the Claude desktop app, if you want Claude to run shares for you (step 9).
Install Teitunnel
Teitunnel is the app that builds and runs the tunnel. Homebrew downloads it and puts it in an Applications folder.
Are you an administrator on this Mac (can you use sudo)?
brew install --cask --appdir=~/Applications teispace/tap/teitunnelWithout admin rights, Homebrew can't write to the main /Applications folder. That's what the error "is not in the sudoers file" means. This puts the app in your own ~/Applications instead.
To make every future install and upgrade go there too, run this once:
echo 'export HOMEBREW_CASK_OPTS="--appdir=~/Applications"' >> ~/.zprofilebrew install --cask teispace/tap/teitunnelOpen Teitunnel. It's signed and notarised, so macOS lets it run, and it downloads and checks cloudflared, Cloudflare's tunnel program, for you.
Try a quick share
Before any setup, check it works. Teitunnel can give any app on your Mac a temporary public address.
- Start something on a port, such as a dev server on 3000.
- In Teitunnel, open Quick Share in the sidebar.
- Type the port, keep Random address, and choose Share.
You get an address ending in trycloudflare.com that anyone with the link can open. It changes every time, which is why the next steps set up your own domain.
Move your domain's DNS to Cloudflare
DNS is the internet's address book. A domain's nameservers decide which company keeps its page in that book. For your own addresses to reach a tunnel, Cloudflare has to keep it.
You don't transfer the domain
The company you bought it from stays the same, and so do renewal and billing. You change one setting there: the nameservers. What moves to Cloudflare is the list of DNS records.
Why the free plan means moving all of it
| Setup | What it means | Plan |
|---|---|---|
| Full | Cloudflare keeps the whole address book | Free and up |
| Partial (CNAME) | Keep your current DNS host, point chosen names at Cloudflare | Business, Enterprise |
| Subdomain | Hand just one subdomain to Cloudflare | Enterprise |
Do it
- In Cloudflare, use Add a domain, type your domain, choose Connect, then the Free plan. Leave DNS import on Automatic.
- Check the records it found. Keep anything still in use, especially MX records for email. Delete leftovers from old tools, such as a
*record pointing at a Pinggy tunnel. If nothing on the domain is live, delete them all. - Choose Continue to activation. Cloudflare shows two nameservers, for example
mariah.ns.cloudflare.comandphil.ns.cloudflare.com. Use the two it gives you. - At your registrar, turn DNSSEC off if it's on. With it on, the domain won't work through Cloudflare.
- Replace the registrar's nameservers (on Hover,
ns1.hover.comandns2.hover.com) with Cloudflare's two, and save. - Wait for Cloudflare to mark the domain Active. It's usually within an hour and can take up to 24. Cloudflare emails you.
Connect Teitunnel to Cloudflare
Teitunnel needs a key, called an API token, that lets it build tunnels and write address-book entries for your domain, and nothing more.
- In Teitunnel, connect your Cloudflare account. In the connect sheet, Open Cloudflare opens the token page with the core permissions already ticked.
- Under the token's resources, include your account and your domain. A token with no resources can't reach anything.
- Create the token, copy it, and paste it into Teitunnel.
| Permission | Level | Lets Teitunnel |
|---|---|---|
| Cloudflare Tunnel · Edit | Account | Create and run tunnels |
| DNS · Edit | Zone | Add and remove a record for each share |
| Zone · Read | Zone | See your domains |
| Account Settings · Read | Account | Read the account it's working in |
If a permission is missing, Teitunnel shows a card titled "The token needs one more permission", for example in Doctor or under Settings ▸ Accounts. Edit adds it to your token in Cloudflare. Use a New Token Instead replaces the token.
Check: run Doctor in Teitunnel. "No problems found" means you're ready.
Pause, stop and run several at once
Each share is its own address, so you can run several side by side and switch each one off without touching the others.
| Action | What happens |
|---|---|
| Pause | Keeps the address and its DNS record. Visitors see a "paused" page. |
| Stop Sharing | Removes the route and DNS record. Share again to bring it back. |
| Quit Teitunnel | Every share stops. |
| Menu bar icon | Share a running service in one click, pause or stop shares. |
Share from Terminal optional
Handy for scripts. The address exists while the command runs and disappears when it ends.
If the Teitunnel app isn't open, the command runs the tunnel itself. For a one-word shortcut, add this to ~/.zshrc, then type share 3333 catalogue:
Let Claude run it optional
Teitunnel includes an MCP server, a plug that lets Claude list, start and check your shares.
teitunnel mcp install claude-desktopThen quit the Claude app fully with ⌘Q, not just its window, and reopen it. For Claude Code, use claude-code instead of claude-desktop.
| Mode | What Claude can do |
|---|---|
| ask (default) | Make changes only after you approve each one in a Teitunnel dialog |
| read-only | Look at tunnels, shares and traffic, change nothing |
| full | Make changes without asking |
To choose a mode, add it to the install command, such as --mode read-only.
When something goes wrong
"is not in the sudoers file" when installing
You're not an admin. Install into ~/Applications with the command in step 2.
The connector isn't connected, or error 1033
Nothing is carrying traffic to your Mac. Open the Teitunnel app, which runs the connector. Shares only work while it's open.
502 Bad gateway
Cloudflare reached your Mac but not your app. Check the app is running on that port. If you've just resumed a paused share, use Stop Sharing and share again (see step 7).
Doctor says the token can't manage routes
The token is missing a permission. Add the four in step 5, then choose Check Again.
The domain stays Pending in Cloudflare
Check the nameservers at your registrar match Cloudflare's two exactly and that DNSSEC is off. Allow up to 24 hours.
"cloudflared is running a tunnel outside Teitunnel"
It's probably left over from an old install. Stop it from Teitunnel's Tunnels page. If it comes back after a restart, run brew services list, and if cloudflared is listed, brew services stop cloudflared. Neither needs admin.
Claude can't see Teitunnel's tools
Check it's in the desktop app's config with grep teitunnel ~/Library/Application\ Support/Claude/claude_desktop_config.json. Quit Claude fully and reopen it. Startup errors appear in ~/Library/Logs/Claude/mcp*.log.