Skip to content

Quick start

Run the CLI with npx and expose a local HTTP service with a public HTTPS URL.

1. Prepare the CLI

Install Node.js 26.7 or later, then run:

npx tubu-cli --help

2. Get an API key

Create an account, verify your email, and save the API key shown after verification. If you already have an account, create a key in your account. Key secrets are shown only when created.

Set the key in the terminal where you will publish the tunnel. Replace YOUR_API_KEY with your key:

export TUBU_TOKEN='YOUR_API_KEY'

The environment variable applies to this terminal session. It authenticates the publisher; it does not protect visitors to the public URL.

3. Start a local service

Start your app on port 3000. For a standalone test, run this HTTP server in a second terminal:

node --input-type=module -e 'import { createServer } from "node:http"; const server = createServer((request, response) => response.end("Hello from Tubu\n")); server.listen(3000, "127.0.0.1");'

Check that http://127.0.0.1:3000 responds before you continue.

4. Publish the tunnel

Use the terminal with TUBU_TOKEN set. Replace my-app.tubu.dev with an available name throughout the examples.

npx tubu-cli http 3000 --domain my-app.tubu.dev

Wait for Tunnel ready:. Keep the CLI and your service running.

5. Verify and stop

Open https://my-app.tubu.dev in your browser, or use another terminal:

curl --fail https://my-app.tubu.dev

Expect your app response, or Hello from Tubu from the test server. Use Ctrl+C in each terminal to stop the tunnel and test server.

Next, run multiple tunnels with YAML, or connect to SSH with TCP.